Re: RFR: 8167523: JDK 9 build failure on MacOS due to unhandled cases in switch statement
> Looks fine. +1 Thanks! Sergey A. Malenkov
Re: RFR: 8167523: JDK 9 build failure on MacOS due to unhandled cases in switch statement
Looks fine. On 12.10.16 0:23, Philip Race wrote: 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. - -- Best regards, Sergey.
RFR: 8167523: JDK 9 build failure on MacOS due to unhandled cases in switch statement
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. -