8039861: Fix fallthrough lint warnings in awt
authordarcy
Thu, 17 Apr 2014 09:45:16 -0700
changeset 24191 75ee64f51cb4
parent 24190 bbd2288a8a29
child 24192 9139cea9e2c2
child 24520 e8afd90fcb69
8039861: Fix fallthrough lint warnings in awt Reviewed-by: pchelko
jdk/src/share/classes/java/awt/dnd/DragSourceContext.java
jdk/src/share/classes/sun/awt/image/GifImageDecoder.java
jdk/src/share/classes/sun/awt/image/PixelConverter.java
jdk/src/solaris/classes/sun/awt/X11/XComponentPeer.java
jdk/src/solaris/classes/sun/awt/X11/XWM.java
--- a/jdk/src/share/classes/java/awt/dnd/DragSourceContext.java	Thu Apr 17 16:26:45 2014 +0400
+++ b/jdk/src/share/classes/java/awt/dnd/DragSourceContext.java	Thu Apr 17 09:45:16 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -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
--- a/jdk/src/share/classes/sun/awt/image/GifImageDecoder.java	Thu Apr 17 16:26:45 2014 +0400
+++ b/jdk/src/share/classes/sun/awt/image/GifImageDecoder.java	Thu Apr 17 09:45:16 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -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) {
--- a/jdk/src/share/classes/sun/awt/image/PixelConverter.java	Thu Apr 17 16:26:45 2014 +0400
+++ b/jdk/src/share/classes/sun/awt/image/PixelConverter.java	Thu Apr 17 09:45:16 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -53,6 +53,7 @@
 
     protected PixelConverter() {}
 
+    @SuppressWarnings("fallthrough")
     public int rgbToPixel(int rgb, ColorModel cm) {
         Object obj = cm.getDataElements(rgb, null);
         switch (cm.getTransferType()) {
--- a/jdk/src/solaris/classes/sun/awt/X11/XComponentPeer.java	Thu Apr 17 16:26:45 2014 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XComponentPeer.java	Thu Apr 17 09:45:16 2014 -0700
@@ -548,6 +548,7 @@
         }
     }
 
+    @SuppressWarnings("fallthrough")
     public void handleEvent(java.awt.AWTEvent e) {
         if ((e instanceof InputEvent) && !((InputEvent)e).isConsumed() && target.isEnabled())  {
             if (e instanceof MouseEvent) {
--- a/jdk/src/solaris/classes/sun/awt/X11/XWM.java	Thu Apr 17 16:26:45 2014 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XWM.java	Thu Apr 17 09:45:16 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -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;
         }