Skip to content

Commit

Permalink
Remove an obsolete TODO
Browse files Browse the repository at this point in the history
JDK 9 and newer javac versions reject boolean constants that are outside the
expected range.

PiperOrigin-RevId: 578591371
  • Loading branch information
cushon authored and Javac Team committed Nov 1, 2023
1 parent a86fafc commit af956f2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions java/com/google/turbine/binder/bytecode/BytecodeBinder.java
Original file line number Diff line number Diff line change
Expand Up @@ -175,14 +175,13 @@ public static Const.Value bindConstValue(Type type, Const.Value value) {
}
// Deficient numberic types and booleans are all stored as ints in the class file,
// coerce them to the target type.
// TODO(b/32626659): this is not bug-compatible with javac
switch (((Type.PrimTy) type).primkind()) {
case CHAR:
return new Const.CharValue((char) asInt(value));
case SHORT:
return new Const.ShortValue((short) asInt(value));
case BOOLEAN:
// boolean constants are encoded as integers
// boolean constants are encoded as integers, see also JDK-8171132
return new Const.BooleanValue(asInt(value) != 0);
case BYTE:
return new Const.ByteValue((byte) asInt(value));
Expand Down

0 comments on commit af956f2

Please sign in to comment.