Semantics-preserving control-flow tweaks to fix switch warnings
Eclipse was warning that these `switch` statements had no `default` cases. Each did have some default behavior, but implemented outside the `switch`. By moving the default behavior into a `default` case within the `switch`, we eliminate a static warning with no change whatsoever to the run-time behavior.
This commit is contained in:
parent
30966195c8
commit
61e9641094
|
@ -1185,8 +1185,9 @@ public class RhinoToAstTranslator implements TranslatorToCAst {
|
||||||
case Token.DEBUGGER: {
|
case Token.DEBUGGER: {
|
||||||
return Ast.makeConstant(null);
|
return Ast.makeConstant(null);
|
||||||
}
|
}
|
||||||
|
default:
|
||||||
|
throw new RuntimeException("unexpected keyword literal " + node + " (" + node.getType() +")");
|
||||||
}
|
}
|
||||||
throw new RuntimeException("unexpected keyword literal " + node + " (" + node.getType() +")");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -169,8 +169,9 @@ public class BinaryLiteralOperation extends Instruction {
|
||||||
return IBinaryOpInstruction.Operator.DIV;
|
return IBinaryOpInstruction.Operator.DIV;
|
||||||
case REM_DOUBLE:
|
case REM_DOUBLE:
|
||||||
return IBinaryOpInstruction.Operator.REM;
|
return IBinaryOpInstruction.Operator.REM;
|
||||||
|
default:
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isFloat()
|
public boolean isFloat()
|
||||||
|
|
|
@ -166,8 +166,9 @@ public class BinaryOperation extends Instruction {
|
||||||
return IBinaryOpInstruction.Operator.DIV;
|
return IBinaryOpInstruction.Operator.DIV;
|
||||||
case REM_DOUBLE:
|
case REM_DOUBLE:
|
||||||
return IBinaryOpInstruction.Operator.REM;
|
return IBinaryOpInstruction.Operator.REM;
|
||||||
|
default:
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
public boolean isFloat()
|
public boolean isFloat()
|
||||||
{
|
{
|
||||||
|
|
|
@ -262,8 +262,9 @@ public class CopyWriter {
|
||||||
return w.addCPDouble(cp.getCPDouble(i));
|
return w.addCPDouble(cp.getCPDouble(i));
|
||||||
case ClassConstants.CONSTANT_Utf8:
|
case ClassConstants.CONSTANT_Utf8:
|
||||||
return w.addCPUtf8(cp.getCPUtf8(i));
|
return w.addCPUtf8(cp.getCPUtf8(i));
|
||||||
|
default:
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void doClass(final ClassInstrumenter ci) throws Exception {
|
private void doClass(final ClassInstrumenter ci) throws Exception {
|
||||||
|
|
Loading…
Reference in New Issue