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

Skip to content

hanson master to java2script master #222

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified sources/net.sf.j2s.core/dist/swingjs/SwingJS-site.zip
Binary file not shown.
4 changes: 3 additions & 1 deletion sources/net.sf.j2s.core/dist/swingjs/differences.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
java2script/SwingJS Notes
=========================

updated 3/11/2023 -- adds support for Java Regex Matcher.start/end(groupID) and .start/end(groupName)
updated 12/31/2020 -- full support for 64-bit long
updated 12/6/2020 -- note about restrictions on long, including BitSet and Scanner
updated 3/21/2020 -- adds note about HashMap, Hashtable, and HashSet iterator ordering
Expand Down Expand Up @@ -1468,7 +1469,8 @@ Formatter/Regex limitations
Some browsers cannot process Regex "look-behind" process such as (?<=\W)
java.util.regex.Matcher and Pattern use JavaScript's RegExp object rather than
the native Java object. These are not identical. Only flags /igm are supported.
Matcher.start(groupID) is not supported.
Matcher.start(groupID)/.end(groupID) is supported.
(x*)? failure returns null, not empty string.

java.util.Formatter will function correctly for all standard %... patterns.

Expand Down
Binary file modified sources/net.sf.j2s.core/dist/swingjs/net.sf.j2s.core.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion sources/net.sf.j2s.core/dist/swingjs/timestamp
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20230304111725
20230831104534
Binary file modified sources/net.sf.j2s.core/dist/swingjs/ver/3.3.1/SwingJS-site.zip
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
java2script/SwingJS Notes
=========================

updated 3/11/2023 -- adds support for Java Regex Matcher.start/end(groupID) and .start/end(groupName)
updated 12/31/2020 -- full support for 64-bit long
updated 12/6/2020 -- note about restrictions on long, including BitSet and Scanner
updated 3/21/2020 -- adds note about HashMap, Hashtable, and HashSet iterator ordering
Expand Down Expand Up @@ -1468,7 +1469,8 @@ Formatter/Regex limitations
Some browsers cannot process Regex "look-behind" process such as (?<=\W)
java.util.regex.Matcher and Pattern use JavaScript's RegExp object rather than
the native Java object. These are not identical. Only flags /igm are supported.
Matcher.start(groupID) is not supported.
Matcher.start(groupID)/.end(groupID) is supported.
(x*)? failure returns null, not empty string.

java.util.Formatter will function correctly for all standard %... patterns.

Expand Down
Binary file modified sources/net.sf.j2s.core/dist/swingjs/ver/3.3.1/net.sf.j2s.core.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion sources/net.sf.j2s.core/dist/swingjs/ver/3.3.1/timestamp
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20230304111725
20230831104534
3 changes: 2 additions & 1 deletion sources/net.sf.j2s.core/src/net/sf/j2s/core/CorePlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@ public class CorePlugin extends Plugin {
* "net.sf.j2s.core.jar" not "net.sf.j2s.core.3.2.5"
*
*/
public static String VERSION = "3.3.1-v6";
public static String VERSION = "3.3.1-v7";

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

// BH 2023.03.29 -- 3.3.1-v7 fixes outer static method call from within lambda expression.
// BH 2023.02.09 -- 3.3.1.v6 fixes j2s.excluded.paths needing /src/xxxx
// BH 2022.06.27 -- 3.3.1-v5 fixes missing method annotations
// BH 2022.01.17 -- 3.3.1-v4 fixes default interface methods referencing their own static fields
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@
// TODO: superclass inheritance for JAXB XmlAccessorType
// TODO: Transpiler bug allows static String name, but JavaScript function().name is read-only and will be "clazz"

//BH 2023.03.29 -- 3.3.1-v7 fixes outer static method call from within lambda expression.
//BH 2023.02.09 -- 3.3.1.v6 fixes j2s.excluded.paths needing /src/xxxx
//BH 2022.06.27 -- 3.3.1-v5 fixes missing method annotations
//BH 2022.01.17 -- 3.3.1-v4 fixes default interface methods referencing their own static fields
//BH 2021.01.14 -- 3.3.1-v3 fixes missing finals for nested () -> {...}
//BH 2021.01.03 -- 3.3.1-v2 adds @j2sAsync adds async for function - experimental
Expand Down Expand Up @@ -1578,11 +1581,16 @@ private boolean addMethodInvocation(SimpleName javaQualifier, List<?> arguments,
String privateVar = (isPrivateAndNotStatic ? getPrivateVar(declaringClass, false) : null);
boolean doLogMethodCalled = (!isPrivate && global_htMethodsCalled != null);
boolean needBname = (

!isStatic && lambdaArity < 0 && (expression == null
!isStatic
&& (lambdaArity < 0
&& (expression == null
? !areEqual(declaringClass, class_typeBinding)
&& !class_typeBinding.isAssignmentCompatible(declaringClass)
: expression instanceof ThisExpression && ((ThisExpression) expression).getQualifier() != null) || class_localType == LAMBDA_EXPRESSION);
: expression instanceof ThisExpression
&& ((ThisExpression) expression).getQualifier() != null)
|| class_localType == LAMBDA_EXPRESSION)
);

String bname = (needBname ? getThisRefOrSyntheticReference(javaQualifier, declaringClass, null) : null);
// add the qualifier
int pt = buffer.length();
Expand Down Expand Up @@ -4879,7 +4887,7 @@ private void addQualifiedNameForBinding(IVariableBinding varBinding, boolean isS
*
* For general fields, this will be "this.".
*
* For fields in outer classes, we need a synthetic references,
* For nonstatic fields in outer classes, we need a synthetic references,
* this.b$[className] that points to the outer object, which may be one or more
* levels higher than this one.
*
Expand Down
7 changes: 7 additions & 0 deletions sources/net.sf.j2s.java.core/_j2sheadlessclasslist.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
java/lang/Class.js
java/lang/Runtime.js
java/lang/Shutdown.js
java/lang/Thread.js
java/lang/ThreadGroup.js
javajs/util/JSThread.js
swingjs/JSThreadGroup.js
53 changes: 53 additions & 0 deletions sources/net.sf.j2s.java.core/build-core-headless.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<project name="JSmol" default="toJs" basedir=".">

<property name="site.path" value="site/swingjs" />

<target name="toJs" id="toJs">


<property name="site.dir" value="site" />
<property name="j2s.dir" value="${site.dir}/swingjs/j2s" />
<!-- make core files -->

<echo>creating and compressing core files - warnings are OK; "does not exist" is trouble</echo>

<loadresource property="coreclasses">
<file file="_j2sheadlessclasslist.txt"/>
</loadresource>

<antcall target="call-core">
<param name="call-core.name" value="swingjsheadless" />
<param name="call-core.list" value="
${coreclasses}
" />
</antcall>


</target>


<target name="call-core" id="call-core">
<echo>......Creating core${call-core.name}.js</echo>
<concat destfile="${site.path}/js/core/tmp.js" fixlastline="yes">
<filelist dir="${site.path}/j2s" files="${call-core.list}" />
</concat>

<replace dir="${site.path}/js/core" includes="tmp.js" token="Clazz." value="Clazz_"/>
<replace dir="${site.path}/js/core" includes="tmp.js" token="Clazz__" value="Clazz._"/>
<echo>......Generating ${site.path}/j2s/core/core${call-core.name}.js</echo>
<concat destfile="${site.path}/j2s/core/core${call-core.name}.js"><filelist dir="${site.path}/js" files="
core/coretop2.js
core/tmp.js
core/corebottom2.js
" />
</concat>
<echo>......Generating ${site.path}/j2s/core/core${call-core.name}.z.js</echo>
<java jar="jars/closure_compiler.jar" fork="true" dir="${site.path}/j2s/core" failonerror="false">
<arg line="--js core${call-core.name}.js --js_output_file core${call-core.name}.z.js" />
</java>
<delete quiet="true" file="${site.path}/js/core/tmp.js" />
</target>



</project>
Binary file modified sources/net.sf.j2s.java.core/dist/SwingJS-site.zip
Binary file not shown.
4 changes: 3 additions & 1 deletion sources/net.sf.j2s.java.core/dist/differences.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
java2script/SwingJS Notes
=========================

updated 3/11/2023 -- adds support for Java Regex Matcher.start/end(groupID) and .start/end(groupName)
updated 12/31/2020 -- full support for 64-bit long
updated 12/6/2020 -- note about restrictions on long, including BitSet and Scanner
updated 3/21/2020 -- adds note about HashMap, Hashtable, and HashSet iterator ordering
Expand Down Expand Up @@ -1468,7 +1469,8 @@ Formatter/Regex limitations
Some browsers cannot process Regex "look-behind" process such as (?<=\W)
java.util.regex.Matcher and Pattern use JavaScript's RegExp object rather than
the native Java object. These are not identical. Only flags /igm are supported.
Matcher.start(groupID) is not supported.
Matcher.start(groupID)/.end(groupID) is supported.
(x*)? failure returns null, not empty string.

java.util.Formatter will function correctly for all standard %... patterns.

Expand Down
4 changes: 3 additions & 1 deletion sources/net.sf.j2s.java.core/doc/Differences.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
java2script/SwingJS Notes
=========================

updated 3/11/2023 -- adds support for Java Regex Matcher.start/end(groupID) and .start/end(groupName)
updated 12/31/2020 -- full support for 64-bit long
updated 12/6/2020 -- note about restrictions on long, including BitSet and Scanner
updated 3/21/2020 -- adds note about HashMap, Hashtable, and HashSet iterator ordering
Expand Down Expand Up @@ -1468,7 +1469,8 @@ Formatter/Regex limitations
Some browsers cannot process Regex "look-behind" process such as (?<=\W)
java.util.regex.Matcher and Pattern use JavaScript's RegExp object rather than
the native Java object. These are not identical. Only flags /igm are supported.
Matcher.start(groupID) is not supported.
Matcher.start(groupID)/.end(groupID) is supported.
(x*)? failure returns null, not empty string.

java.util.Formatter will function correctly for all standard %... patterns.

Expand Down
1 change: 1 addition & 0 deletions sources/net.sf.j2s.java.core/src/java/util/Hashtable.java
Original file line number Diff line number Diff line change
Expand Up @@ -1947,6 +1947,7 @@ public void remove() {
* key = p.value[0];
*/
Hashtable.this.remove(key);
expectedModCount++;
} else {

synchronized (Hashtable.this) {
Expand Down
Loading