Skip to content

Commit 44d8ba2

Browse files
authored
Merge pull request #221 from BobHanson/hanson1
Hanson1
2 parents 0e42fc6 + 6b2be11 commit 44d8ba2

33 files changed

+1141
-853
lines changed
Binary file not shown.

sources/net.sf.j2s.core/dist/swingjs/differences.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
java2script/SwingJS Notes
22
=========================
33

4+
updated 3/11/2023 -- adds support for Java Regex Matcher.start/end(groupID) and .start/end(groupName)
45
updated 12/31/2020 -- full support for 64-bit long
56
updated 12/6/2020 -- note about restrictions on long, including BitSet and Scanner
67
updated 3/21/2020 -- adds note about HashMap, Hashtable, and HashSet iterator ordering
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20230311212845
1+
20230831104534
Binary file not shown.

sources/net.sf.j2s.core/dist/swingjs/ver/3.3.1/differences.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
java2script/SwingJS Notes
22
=========================
33

4+
updated 3/11/2023 -- adds support for Java Regex Matcher.start/end(groupID) and .start/end(groupName)
45
updated 12/31/2020 -- full support for 64-bit long
56
updated 12/6/2020 -- note about restrictions on long, including BitSet and Scanner
67
updated 3/21/2020 -- adds note about HashMap, Hashtable, and HashSet iterator ordering
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20230311212845
1+
20230831104534

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,12 @@ public class CorePlugin extends Plugin {
2525
* "net.sf.j2s.core.jar" not "net.sf.j2s.core.3.2.5"
2626
*
2727
*/
28-
public static String VERSION = "3.3.1-v6";
28+
public static String VERSION = "3.3.1-v7";
2929

3030
// if you change the x.x.x number, be sure to also indicate that in
3131
// j2sApplet.js and also (Bob only) update.bat, update-clean.bat
3232

33+
// BH 2023.03.29 -- 3.3.1-v7 fixes outer static method call from within lambda expression.
3334
// BH 2023.02.09 -- 3.3.1.v6 fixes j2s.excluded.paths needing /src/xxxx
3435
// BH 2022.06.27 -- 3.3.1-v5 fixes missing method annotations
3536
// BH 2022.01.17 -- 3.3.1-v4 fixes default interface methods referencing their own static fields

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

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,9 @@
136136
// TODO: superclass inheritance for JAXB XmlAccessorType
137137
// TODO: Transpiler bug allows static String name, but JavaScript function().name is read-only and will be "clazz"
138138

139+
//BH 2023.03.29 -- 3.3.1-v7 fixes outer static method call from within lambda expression.
140+
//BH 2023.02.09 -- 3.3.1.v6 fixes j2s.excluded.paths needing /src/xxxx
141+
//BH 2022.06.27 -- 3.3.1-v5 fixes missing method annotations
139142
//BH 2022.01.17 -- 3.3.1-v4 fixes default interface methods referencing their own static fields
140143
//BH 2021.01.14 -- 3.3.1-v3 fixes missing finals for nested () -> {...}
141144
//BH 2021.01.03 -- 3.3.1-v2 adds @j2sAsync adds async for function - experimental
@@ -1578,11 +1581,16 @@ private boolean addMethodInvocation(SimpleName javaQualifier, List<?> arguments,
15781581
String privateVar = (isPrivateAndNotStatic ? getPrivateVar(declaringClass, false) : null);
15791582
boolean doLogMethodCalled = (!isPrivate && global_htMethodsCalled != null);
15801583
boolean needBname = (
1581-
1582-
!isStatic && lambdaArity < 0 && (expression == null
1584+
!isStatic
1585+
&& (lambdaArity < 0
1586+
&& (expression == null
15831587
? !areEqual(declaringClass, class_typeBinding)
15841588
&& !class_typeBinding.isAssignmentCompatible(declaringClass)
1585-
: expression instanceof ThisExpression && ((ThisExpression) expression).getQualifier() != null) || class_localType == LAMBDA_EXPRESSION);
1589+
: expression instanceof ThisExpression
1590+
&& ((ThisExpression) expression).getQualifier() != null)
1591+
|| class_localType == LAMBDA_EXPRESSION)
1592+
);
1593+
15861594
String bname = (needBname ? getThisRefOrSyntheticReference(javaQualifier, declaringClass, null) : null);
15871595
// add the qualifier
15881596
int pt = buffer.length();
@@ -4879,7 +4887,7 @@ private void addQualifiedNameForBinding(IVariableBinding varBinding, boolean isS
48794887
*
48804888
* For general fields, this will be "this.".
48814889
*
4882-
* For fields in outer classes, we need a synthetic references,
4890+
* For nonstatic fields in outer classes, we need a synthetic references,
48834891
* this.b$[className] that points to the outer object, which may be one or more
48844892
* levels higher than this one.
48854893
*

0 commit comments

Comments
 (0)