8039864: Fix fallthrough lint warnings in other libs
authordarcy
Thu, 10 Apr 2014 08:43:46 -0700
changeset 23740 1d63a6c00b26
parent 23739 2815f34a64c5
child 23741 03987fb914a9
8039864: Fix fallthrough lint warnings in other libs Reviewed-by: alanb, lancea
jdk/src/share/classes/sun/tools/java/Environment.java
jdk/src/share/classes/sun/tools/java/Scanner.java
jdk/src/share/classes/sun/tools/javac/Main.java
jdk/src/share/classes/sun/tools/jinfo/JInfo.java
jdk/src/share/classes/sun/tools/tree/AssignOpExpression.java
jdk/src/share/classes/sun/tools/tree/NewInstanceExpression.java
--- a/jdk/src/share/classes/sun/tools/java/Environment.java	Thu Apr 10 07:09:13 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/java/Environment.java	Thu Apr 10 08:43:46 2014 -0700
@@ -648,6 +648,7 @@
      * Return true if an implicit cast from this type to
      * the given type is allowed.
      */
+    @SuppressWarnings("fallthrough")
     public boolean implicitCast(Type from, Type to) throws ClassNotFound {
         if (from == to)
             return true;
--- a/jdk/src/share/classes/sun/tools/java/Scanner.java	Thu Apr 10 07:09:13 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/java/Scanner.java	Thu Apr 10 08:43:46 2014 -0700
@@ -511,6 +511,7 @@
      * Scan a number. The first digit of the number should be the current
      * character.  We may be scanning hex, decimal, or octal at this point
      */
+    @SuppressWarnings("fallthrough")
     private void scanNumber() throws IOException {
         boolean seenNonOctal = false;
         boolean overflow = false;
@@ -532,6 +533,7 @@
                 // We can't yet throw an error if reading an octal.  We might
                 // discover we're really reading a real.
                 seenNonOctal = true;
+                // Fall through
               case '0': case '1': case '2': case '3':
               case '4': case '5': case '6': case '7':
                 seenDigit = true;
@@ -668,6 +670,7 @@
      * Scan a float.  Should be called with the current character is either
      * the 'e', 'E' or '.'
      */
+    @SuppressWarnings("fallthrough")
     private void scanReal() throws IOException {
         boolean seenExponent = false;
         boolean isSingleFloat = false;
@@ -984,6 +987,7 @@
        return xscan();
    }
 
+    @SuppressWarnings("fallthrough")
     protected long xscan() throws IOException {
         final ScannerInputReader in = this.in;
         long retPos = pos;
@@ -1006,6 +1010,7 @@
                     token = COMMENT;
                     return retPos;
                 }
+                // Fall through
               case ' ':
               case '\t':
               case '\f':
--- a/jdk/src/share/classes/sun/tools/javac/Main.java	Thu Apr 10 07:09:13 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/javac/Main.java	Thu Apr 10 08:43:46 2014 -0700
@@ -192,6 +192,7 @@
     /**
      * Run the compiler
      */
+    @SuppressWarnings("fallthrough")
     public synchronized boolean compile(String argv[]) {
         String sourcePathArg = null;
         String classPathArg = null;
--- a/jdk/src/share/classes/sun/tools/jinfo/JInfo.java	Thu Apr 10 07:09:13 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/jinfo/JInfo.java	Thu Apr 10 08:43:46 2014 -0700
@@ -41,6 +41,7 @@
  */
 public class JInfo {
 
+    @SuppressWarnings("fallthrough")
     public static void main(String[] args) throws Exception {
         if (args.length == 0) {
             usage(1); // no arguments
@@ -118,6 +119,7 @@
             case "-help":
             case "-h":
                 usage(0);
+                // Fall through
             default:
                if (args.length == 1) {
                    // no flags specified, we do -sysprops and -flags
--- a/jdk/src/share/classes/sun/tools/tree/AssignOpExpression.java	Thu Apr 10 07:09:13 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/tree/AssignOpExpression.java	Thu Apr 10 08:43:46 2014 -0700
@@ -53,7 +53,7 @@
      * Select the type
      *
      */
-
+    @SuppressWarnings("fallthrough")
     final void selectType(Environment env, Context ctx, int tm) {
         Type rtype = null;      // special conversion type for RHS
         switch(op) {
--- a/jdk/src/share/classes/sun/tools/tree/NewInstanceExpression.java	Thu Apr 10 07:09:13 2014 -0700
+++ b/jdk/src/share/classes/sun/tools/tree/NewInstanceExpression.java	Thu Apr 10 08:43:46 2014 -0700
@@ -487,6 +487,7 @@
     public void codeValue(Environment env, Context ctx, Assembler asm) {
         codeCommon(env, ctx, asm, true);
     }
+    @SuppressWarnings("fallthrough")
     private void codeCommon(Environment env, Context ctx, Assembler asm,
                             boolean forValue) {
         asm.add(where, opc_new, field.getClassDeclaration());