Be explicit when case fall-through is intentional

This commit is contained in:
Ben Liblit 2017-08-06 14:56:44 -05:00 committed by Manu Sridharan
parent da5f925cab
commit ea95940d0f
2 changed files with 4 additions and 1 deletions

View File

@ -39,7 +39,7 @@ org.eclipse.jdt.core.compiler.problem.discouragedReference=error
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=error
org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
org.eclipse.jdt.core.compiler.problem.fallthroughCase=error
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=error
org.eclipse.jdt.core.compiler.problem.finalParameterBound=error

View File

@ -579,6 +579,7 @@ public abstract class Compiler implements Constants {
if (!fallToConditional) {
break;
}
//$FALL-THROUGH$
case OP_aconst_null:
if (!fallToConditional && inBasicBlock(i, 2) && instructions[i + 1] instanceof ConditionalBranchInstruction) {
ConditionalBranchInstruction cbr = (ConditionalBranchInstruction) instructions[i + 1];
@ -593,6 +594,7 @@ public abstract class Compiler implements Constants {
break;
}
// by Xiangyu
//$FALL-THROUGH$
case OP_ifeq:
case OP_ifge:
case OP_ifgt:
@ -798,6 +800,7 @@ public abstract class Compiler implements Constants {
break;
}
}
//$FALL-THROUGH$
case OP_lload:
case OP_fload:
case OP_dload: