changeset 9825:095dac8cf52c

8039861: Fix fallthrough lint warnings in awt Reviewed-by: pchelko
author darcy
date Thu, 17 Apr 2014 09:45:16 -0700
parents a673ffda4f64
children 525b6c4aded7 75b062617601
files src/share/classes/java/awt/dnd/DragSourceContext.java src/share/classes/sun/awt/image/GifImageDecoder.java src/share/classes/sun/awt/image/PixelConverter.java src/solaris/classes/sun/awt/X11/XComponentPeer.java src/solaris/classes/sun/awt/X11/XWM.java
diffstat 5 files changed, 11 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/awt/dnd/DragSourceContext.java	Thu Apr 17 16:26:45 2014 +0400
+++ b/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/src/share/classes/sun/awt/image/GifImageDecoder.java	Thu Apr 17 16:26:45 2014 +0400
+++ b/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/src/share/classes/sun/awt/image/PixelConverter.java	Thu Apr 17 16:26:45 2014 +0400
+++ b/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/src/solaris/classes/sun/awt/X11/XComponentPeer.java	Thu Apr 17 16:26:45 2014 +0400
+++ b/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/src/solaris/classes/sun/awt/X11/XWM.java	Thu Apr 17 16:26:45 2014 +0400
+++ b/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;
         }