Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 068cea2

Browse files
committed
//BH 2024.02.22 -- 3.3.1-v7 fixes long extension issue causing
MutableBitInteger to miscalculate subtraction(no change in version #) situation was long a = b - c - d - e... where later minus signs were not been replaced by commas when wrapped into Long.$sub(b,c,d,e,...)
1 parent a826557 commit 068cea2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
// TODO: superclass inheritance for JAXB XmlAccessorType
3232
// TODO: Transpiler bug allows static String name, but JavaScript function().name is read-only and will be "clazz"
3333

34+
//BH 2024.02.22 -- 3.3.1-v7 fixes long extension issue causing MutableBitInteger to miscalculate subtraction(no change in version #)
3435
//BH 2023.03.29 -- 3.3.1-v7 fixes outer static method call from within lambda expression.
3536
//BH 2023.02.09 -- 3.3.1.v6 fixes j2s.excluded.paths needing /src/xxxx
3637
//BH 2022.06.27 -- 3.3.1-v5 fixes missing method annotations
@@ -4313,11 +4314,10 @@ && boxType(exp) == NO_BOX) {
43134314
private void addExtendedOperands(List<?> extendedOperands, String op, char pre, char post, boolean isToString,
43144315
boolean isLongCall) {
43154316
buffer.append(' ');
4317+
if (isLongCall)
4318+
op = ",";
43164319
for (Iterator<?> iter = extendedOperands.iterator(); iter.hasNext();) {
43174320
Expression exp = (Expression) iter.next();
4318-
// op may be int for a while, but after that it changes to long
4319-
if (isLongCall && exp.resolveTypeBinding().getName().equals("long"))
4320-
op = ",";
43214321
buffer.append(op);
43224322
buffer.append(pre);
43234323
addOperand(exp, isToString);

0 commit comments

Comments
 (0)