<AWT Dev> JDK 9 RFR of JDK-8039861: Fix fallthrough lint warnings in awt

Petr Pchelko petr.pchelko at oracle.com
Tue Apr 15 17:37:02 UTC 2014


Hello, Joe.

The fix looks good to me.

With best regards. Petr.

10 апр. 2014 г., в 6:44 до полудня, Joe Darcy <joe.darcy at oracle.com> написал(а):

> Hello,
> 
> Please review the changes for
> 
>    JDK-8039861: Fix fallthrough lint warnings in awt
>    http://cr.openjdk.java.net/~darcy/8039861.0/
> 
> Thanks,
> 
> -Joe
> 
> --- old/src/share/classes/java/awt/dnd/DragSourceContext.java 2014-04-09 19:41:33.000000000 -0700
> +++ new/src/share/classes/java/awt/dnd/DragSourceContext.java 2014-04-09 19:41:33.000000000 -0700
> @@ -472,7 +472,7 @@
>      *               <code>ENTER</code>, <code>OVER</code>,
>      *               <code>CHANGED</code>
>      */
> -
> +    @SuppressWarnings("fallthrough")
>     protected synchronized void updateCurrentCursor(int sourceAct, int targetAct, int status) {
> 
>         // if the cursor has been previously set then don't do any defaults
> --- old/src/share/classes/sun/awt/image/GifImageDecoder.java 2014-04-09 19:41:33.000000000 -0700
> +++ new/src/share/classes/sun/awt/image/GifImageDecoder.java 2014-04-09 19:41:33.000000000 -0700
> @@ -114,6 +114,7 @@
>     /**
>      * produce an image from the stream.
>      */
> +    @SuppressWarnings("fallthrough")
>     public void produceImage() throws IOException, ImageFormatException {
>         try {
>             readHeader();
> @@ -238,7 +239,7 @@
>                     if (frameno == 0) {
>                         return;
>                     }
> -                    // NOBREAK
> +                    // Fall through
> 
>                   case TERMINATOR:
>                     if (nloops == 0 || nloops-- >= 0) {
> --- old/src/share/classes/sun/awt/image/PixelConverter.java 2014-04-09 19:41:34.000000000 -0700
> +++ new/src/share/classes/sun/awt/image/PixelConverter.java 2014-04-09 19:41:33.000000000 -0700
> @@ -53,6 +53,7 @@
> 
>     protected PixelConverter() {}
> 
> +    @SuppressWarnings("fallthrough")
>     public int rgbToPixel(int rgb, ColorModel cm) {
>         Object obj = cm.getDataElements(rgb, null);
>         switch (cm.getTransferType()) {
> --- old/src/solaris/classes/sun/awt/X11/XWM.java    2014-04-09 19:41:34.000000000 -0700
> +++ new/src/solaris/classes/sun/awt/X11/XWM.java    2014-04-09 19:41:34.000000000 -0700
> @@ -1112,6 +1112,7 @@
>      * Therefore, a compound state is just ICONIFIED | anything else.
>      *
>      */
> +    @SuppressWarnings("fallthrough")
>     boolean supportsExtendedState(int state) {
>         switch (state) {
>           case Frame.MAXIMIZED_VERT:
> @@ -1131,6 +1132,7 @@
>                       return true;
>                   }
>               }
> +              /* FALLTROUGH */
>           default:
>               return false;
>         }
> 



More information about the awt-dev mailing list