src/share/classes/sun/tools/java/Scanner.java

Print this page

        

@@ -509,10 +509,11 @@
 
     /**
      * 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;
         boolean seenDigit = false; // used to detect invalid hex number 0xL
         radix = (ch == '0' ? 8 : 10);

@@ -530,10 +531,11 @@
 
               case '8': case '9':
                 // 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;
                 putc(ch);
                 if (radix == 10) {

@@ -666,10 +668,11 @@
      * Scan a float.  We are either looking at the decimal, or we have already
      * seen it and put it into the buffer.  We haven't seen an exponent.
      * 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;
         char lastChar;
         if (ch == '.') {

@@ -982,10 +985,11 @@
      */
    public long scan() throws IOException {
        return xscan();
    }
 
+    @SuppressWarnings("fallthrough")
     protected long xscan() throws IOException {
         final ScannerInputReader in = this.in;
         long retPos = pos;
         prevPos = in.pos;
         docComment = null;

@@ -1004,10 +1008,11 @@
                     // Do not just call in.read; we want to present
                     // a null token (and also avoid read-ahead).
                     token = COMMENT;
                     return retPos;
                 }
+                // Fall through 
               case ' ':
               case '\t':
               case '\f':
                 ch = in.read();
                 break;