changeset 9703:38cb74e9db7d

8039864: Fix fallthrough lint warnings in other libs Reviewed-by: alanb, lancea
author darcy
date Thu, 10 Apr 2014 08:43:46 -0700
parents 0b2627ad873c
children b1e7a6433b7a
files src/share/classes/sun/tools/java/Environment.java src/share/classes/sun/tools/java/Scanner.java src/share/classes/sun/tools/javac/Main.java src/share/classes/sun/tools/jinfo/JInfo.java src/share/classes/sun/tools/tree/AssignOpExpression.java src/share/classes/sun/tools/tree/NewInstanceExpression.java
diffstat 6 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/sun/tools/java/Environment.java	Thu Apr 10 07:09:13 2014 -0700
+++ b/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/src/share/classes/sun/tools/java/Scanner.java	Thu Apr 10 07:09:13 2014 -0700
+++ b/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/src/share/classes/sun/tools/javac/Main.java	Thu Apr 10 07:09:13 2014 -0700
+++ b/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/src/share/classes/sun/tools/jinfo/JInfo.java	Thu Apr 10 07:09:13 2014 -0700
+++ b/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/src/share/classes/sun/tools/tree/AssignOpExpression.java	Thu Apr 10 07:09:13 2014 -0700
+++ b/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/src/share/classes/sun/tools/tree/NewInstanceExpression.java	Thu Apr 10 07:09:13 2014 -0700
+++ b/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());