8039864: Fix fallthrough lint warnings in other libs

Reviewed-by: alanb, lancea
This commit is contained in:
Joe Darcy 2014-04-10 08:43:46 -07:00
parent 34b9e5a9bb
commit 002e08e73d
6 changed files with 11 additions and 1 deletions

View File

@ -648,6 +648,7 @@ public class Environment implements Constants {
* 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;

View File

@ -511,6 +511,7 @@ class Scanner implements Constants {
* 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 @@ class Scanner implements Constants {
// 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 @@ class Scanner implements Constants {
* 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 @@ class Scanner implements Constants {
return xscan();
}
@SuppressWarnings("fallthrough")
protected long xscan() throws IOException {
final ScannerInputReader in = this.in;
long retPos = pos;
@ -1006,6 +1010,7 @@ class Scanner implements Constants {
token = COMMENT;
return retPos;
}
// Fall through
case ' ':
case '\t':
case '\f':

View File

@ -192,6 +192,7 @@ class Main implements Constants {
/**
* Run the compiler
*/
@SuppressWarnings("fallthrough")
public synchronized boolean compile(String argv[]) {
String sourcePathArg = null;
String classPathArg = null;

View File

@ -41,6 +41,7 @@ import sun.tools.attach.HotSpotVirtualMachine;
*/
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 @@ public class JInfo {
case "-help":
case "-h":
usage(0);
// Fall through
default:
if (args.length == 1) {
// no flags specified, we do -sysprops and -flags

View File

@ -53,7 +53,7 @@ class AssignOpExpression extends BinaryAssignExpression {
* Select the type
*
*/
@SuppressWarnings("fallthrough")
final void selectType(Environment env, Context ctx, int tm) {
Type rtype = null; // special conversion type for RHS
switch(op) {

View File

@ -487,6 +487,7 @@ class NewInstanceExpression extends NaryExpression {
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());