Skip to content

Commit c822ee2

Browse files
hansonrhansonr
authored andcommitted
transpiler fix for java/util/streams/StreamOpFlags use of 0b00 in boxing
of parameter
1 parent afbe60f commit c822ee2

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

sources/net.sf.j2s.core/src/net/sf/j2s/core/Java2ScriptVisitor.java

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@
134134
import org.eclipse.jdt.core.dom.WhileStatement;
135135
import org.eclipse.jdt.core.dom.WildcardType;
136136

137+
// BH 2019.08.29 fix for boxing of binary representation 0b01... (Google Closure Compiler bug)
137138
// BH 2019.05.13 fix for Math.getExponent, ulp, nextDown, nextUp, nextAfter needing qualification
138139
// BH 2019.05.13 fix for Function reference in new Foo()::test(...)
139140
// BH 2019.04.03 fix for @j2sIgnore not including {}
@@ -3208,18 +3209,7 @@ public boolean visit(Modifier node) {
32083209
}
32093210

32103211
public boolean visit(NumberLiteral node) {
3211-
String token = node.getToken();
3212-
if (token.endsWith("L") || token.endsWith("l")) {
3213-
buffer.append(token.substring(0, token.length() - 1));
3214-
} else if (!token.startsWith("0x") && !token.startsWith("0X")) {
3215-
if (token.endsWith("F") || token.endsWith("f") || token.endsWith("D") || token.endsWith("d")) {
3216-
buffer.append(token.substring(0, token.length() - 1));
3217-
} else {
3218-
buffer.append(token);
3219-
}
3220-
} else {
3221-
buffer.append(token);
3222-
}
3212+
buffer.append(node.resolveConstantExpressionValue());
32233213
return false;
32243214
}
32253215

0 commit comments

Comments
 (0)