<AWT Dev> RFR: 8167523: JDK 9 build failure on MacOS due to unhandled cases in switch statement

Philip Race philip.race at oracle.com
Tue Oct 11 21:23:26 UTC 2016


The fix for 8166591: [macos 10.12] Trackpad scrolling of text on OS X 
10.12 Sierra is very fast (Trackpad, Retina only) added a switch 
statement with unhandled cases.
On later versions of the clang compiler this causes a build failure due 
to a warning

/jdk9-client/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/LWCToolkit.m:92:13: 
error: 4 enumeration values not handled in switch: 'NSEventPhaseNone', 
'NSEventPhaseStationary', 'NSEventPhaseChanged'... [-Werror,-Wswitch]
     switch (phase) {
             ^
1 error generated.

Simple fix in-line below that builds with xcode 6.3 and xcode 7 :-
diff --git 
a/src/java.desktop/macosx/native/libawt_lwawt/awt/LWCToolkit.m 
b/src/java.desktop/macosx/native/libawt_lwawt/awt/LWCToolkit.m
--- a/src/java.desktop/macosx/native/libawt_lwawt/awt/LWCToolkit.m
+++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/LWCToolkit.m
@@ -93,8 +93,8 @@
          case NSEventPhaseBegan: return SCROLL_PHASE_BEGAN;
          case NSEventPhaseCancelled: return SCROLL_PHASE_CANCELLED;
          case NSEventPhaseEnded: return SCROLL_PHASE_ENDED;
+ default: return SCROLL_PHASE_CONTINUED;
      }
- return SCROLL_PHASE_CONTINUED;
  }


-phil.

-
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/awt-dev/attachments/20161011/50332b0f/attachment.html>


More information about the awt-dev mailing list