Skip to content
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
31 changes: 31 additions & 0 deletions sources/net.sf.j2s.core/dist/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,37 @@ This is the main README file for the Java2Script/SwingJS distribution

https://github.com/BobHanson/java2script/blob/master/sources/net.sf.j2s.core/dist/README.txt

8/14/2018 Bob Hanson hansonr@stolaf.edu

- allows for no-package applets and applications (which is quite common in the Java applet world).

- totally refactored, streamlined Java-to-JavaScript class name conversion, including the "j2s/_" (single underscore) package, which contains (originally) package-less applets and applications. All Java2ScriptVisitor "getFinal..." methods return JavaScript-ready names that are intended for immediate appending to the output buffer. Prior to that moment, all class names are maintained as their Java values.

- more efficient anonymous class creation (including lambda methods, constructors, and expressions).

- full support for method-local named classes.

- full, efficient support for default interface methods.

- fully qualified methods [ excluding Math.* and *.toString() ], so no conflict with any standard JavaScript objects.

- bullet-proof "final or effectively final" variables.

- strongly anonymous-function scoped for "private" methods.

- corrects several issues with java.util.function.* and java.util.stream.*.

- adds ?j2sverbose option (former standard logging all class loading), with the default being "quiet" mode, which gives no indication of file loading. (Also settable as J2S._quiet = [true|false]

- adds hooks into Clazz object loading, allowing page intervention just after Clazz itself has been loaded, but the core files have not been loaded, and also just after core files have been loaded. This could be useful for customization of the loading process -- for example, dynamically settable core file configuration.

- adds System.getProperty("user.home"), which defaults to https://./ (which isn't a standard protocol, but is passed through the Java system and interpreted in JavaScript as the document base).

- reorganizes java2script project files for better version control.

- adds {project}/resources/ and {project}/libjs as standard places for non-Java resources and zip-equivalents of JAR files that are automatically copied into the {project}/site directory.


8/12/2018 Bob Hanson hansonr@stolaf.edu

The dist/dropins folder has been renamed dist/swingjs
Expand Down
Binary file modified sources/net.sf.j2s.core/dist/swingjs/SwingJS-site.zip
Binary file not shown.
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 @@
20180814211809
20180815205622
Binary file modified sources/net.sf.j2s.core/dist/swingjs/ver/3.2.2/SwingJS-site.zip
Binary file not shown.
Binary file modified sources/net.sf.j2s.core/dist/swingjs/ver/3.2.2/net.sf.j2s.core.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion sources/net.sf.j2s.core/dist/swingjs/ver/3.2.2/timestamp
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20180814211809
20180815205622
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ public boolean visit(ClassInstanceCreation node) {

private void addConstructor(Type type, IMethodBinding constructorMethodBinding, List<?> arguments,
int lambdaArity) {
String javaClassName = getClassJavaNameForClass(type);
String javaClassName = getClassJavaNameForType(type);
if ("java.lang.Object".equals(javaClassName)) {
buffer.append(" Clazz.new_()");
return;
Expand Down Expand Up @@ -603,19 +603,19 @@ private void openNew(String javaClassName, String anonJavaName, IMethodBinding c
* @param type
* @return
*/
private String getClassJavaNameForClass(Type type) {
private String getClassJavaNameForType(Type type) {
if (type instanceof QualifiedType) {
QualifiedType qualType = (QualifiedType) type;
return getClassJavaNameForClass(qualType.getQualifier()) + "." + qualType.getName().getIdentifier();
return getClassJavaNameForType(qualType.getQualifier()) + "." + qualType.getName().getIdentifier();
}
// if (type instanceof NameQualifiedType) {
// NameQualifiedType nType = (NameQualifiedType) type;
// return getClassJavaNameForClass(nType.getQualifier()) + "." + nType.getName().getIdentifier();
// }
if (type instanceof ArrayType)
return getClassJavaNameForClass(((ArrayType) type).getElementType());
return getClassJavaNameForType(((ArrayType) type).getElementType());
if (type instanceof ParameterizedType)
return getClassJavaNameForClass(((ParameterizedType) type).getType());
return getClassJavaNameForType(((ParameterizedType) type).getType());
if (type instanceof SimpleType) {
ITypeBinding binding = ((SimpleType) type).resolveBinding();
return getJavaClassNameQualified(binding);
Expand Down Expand Up @@ -1515,7 +1515,7 @@ public boolean visit(TryStatement node) {
}
buffer.append(haveType ? " || " : "if (");
buffer.append("Clazz.exceptionOf(" + catchEName + ",\"");
type.accept(this);
buffer.append(getFinalJ2SClassName(getClassJavaNameForType(type), FINAL_RAW));
buffer.append("\")");
haveType = true;
}
Expand Down
Binary file modified sources/net.sf.j2s.java.core/dist/SwingJS-site.zip
Binary file not shown.