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
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 @@
20180815205622
20180816081255
Binary file modified sources/net.sf.j2s.core/dist/swingjs/ver/3.2.2/SwingJS-site.zip
Binary file not shown.
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 @@
20180815205622
20180816081255
10 changes: 5 additions & 5 deletions sources/net.sf.j2s.core/src/net/sf/j2s/core/CorePlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ public class CorePlugin extends Plugin {
*
*/
public static String VERSION = "3.2.2.04";

// 3.1.1 last Zhou Renjian unqualified name version
// 3.2.1.01 original SwingJS version through 2017 adds $-signatures for methods
// 3.2.2.02 adds $-qualified names for all methods
// 3.2.2.04 2018.08.15 fixing Java->JavaScript "getFinal" code for class names.
// 3.2.2.04 adds support for window-level applets, such as JmolApplet
// 3.2.2.03 adds Java 8 function and stream
// 3.2.2.04 adds support for window-level applets, such as JmolApplet
// 3.2.2.02 adds $-qualified names for all methods
// 3.2.1.01 original SwingJS version through 2017 adds $-signatures for methods
// 3.1.1 last Zhou Renjian unqualified name version
/**
* The constructor.
*/
Expand Down
Binary file modified sources/net.sf.j2s.java.core/dist/SwingJS-site.zip
Binary file not shown.
6 changes: 6 additions & 0 deletions sources/net.sf.j2s.java.core/src/test/Test_Format.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ public static void main(String[] args) {

String s;

s = String.format("%s %d", "testing", 3);
assert(s.equals("testing 3"));

assert(String.format("%s %d-%d", "testing", 3, 4).equals("testing 3-4"));


s = test(100 * Math.pow(10, -6), 2);
System.out.println(s);
assert s.equals("prec=2 0.00 0.00010 1.00e-04");
Expand Down
70 changes: 39 additions & 31 deletions sources/net.sf.j2s.java.core/srcjs/js/j2sClazz.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
// TODO: CharacterSequence does not implement Java 8 default methods chars() or codePoints()
// It is possible that these might be loaded dynamically.

// BH 8/16/2018 3.2.2.04 fixes Character.toTitleCase$C, [Integer,Long,Short,Byte].toString(i,radix)
// BH 8/13/2018 3.2.2.04 $finals to $finals$ -- basically variables are $xxx, methods are xxx$, and special values are $xxx$
// BH 8/12/2018 3.2.2 adding J2S.onClazzLoaded hook for Clazz loaded
// BH 8/11/2018 3.2.2 Clazz.newLambda removed
Expand Down Expand Up @@ -98,7 +99,7 @@ window["j2s.clazzloaded"] = true;
_debugging: false,
_loadcore: true,
_nooutput: 0,
_VERSION: "3.2.2.03",
_VERSION_R: "3.2.2.05",
_VERSION_T: "unknown",
};

Expand Down Expand Up @@ -3477,14 +3478,15 @@ var decorateAsNumber = function (clazz, qClazzName, type, PARAMCODE) {

decorateAsNumber(Integer, "Integer", "int", "I");

Integer.toString=Integer.toString$I=Integer.prototype.toString=function(){
if(arguments.length!=0){
return "" + arguments[0];
}
if(this===Integer){
return "class java.lang.Integer";
}
return "" + this.valueOf();
Integer.toString=Integer.toString$I=Integer.toString$I$I=Integer.prototype.toString=function(i,radix){
switch(arguments.length) {
case 2:
return i.toString(radix);
case 1:
return "" +i;
case 0:
return (this===Integer ? "class java.lang.Integer" : ""+this.valueOf());
}
};

m$(Integer, ["c$", "c$$S", "c$$I"], function(v){
Expand Down Expand Up @@ -3668,13 +3670,15 @@ if (typeof arguments[0] != "object")this.c$(arguments[0]);
});

decorateAsNumber(Long, "Long", "long", "L");
Long.toString=Long.toString$J=Long.prototype.toString=function(){
if(arguments.length!=0){
return""+arguments[0];
}else if(this===Long){
return"class java.lang.Long";
}
return""+this.valueOf();
Long.toString=Long.toString$J=Long.toString$J$I = Long.prototype.toString=function(i, radix){
switch(arguments.length) {
case 2:
return i.toString(radix);
case 1:
return "" +i;
case 0:
return (this===Long ? "class java.lang.Long" : ""+this.valueOf());
}
};

m$(Long, ["c$", "c$$S", "c$$J"], function(v){
Expand Down Expand Up @@ -3742,13 +3746,15 @@ function (v,radix) {
this.valueOf = function () {return v;};
}, 1);

Short.toString = Short.prototype.toString = function () {
if (arguments.length != 0) {
return "" + arguments[0];
} else if (this === Short) {
return "class java.lang.Short"; // Short.class.toString
}
return "" + this.valueOf();
Short.toString = Short.toString$H = Short.toString$H$I = Short.prototype.toString = function (i,radix) {
switch(arguments.length) {
case 2:
return i.toString(radix);
case 1:
return "" +i;
case 0:
return (this===Short ? "class java.lang.Short" : ""+this.valueOf());
}
};

Short.MIN_VALUE = Short.prototype.MIN_VALUE = -32768;
Expand Down Expand Up @@ -3804,13 +3810,15 @@ this.valueOf=function(){return v;};
this.byteValue = function(){return v};
}, 1);

Byte.toString=Byte.toString$B=Byte.prototype.toString=function(){
if(arguments.length!=0){
return""+arguments[0];
}else if(this===Byte){
return"class java.lang.Byte";
}
return""+this.valueOf();
Byte.toString=Byte.toString$B=Byte.toString$B$I=Byte.prototype.toString=function(i,radix){
switch(arguments.length) {
case 2:
return i.toString(radix);
case 1:
return "" +i;
case 0:
return (this===Byte ? "class java.lang.Byte" : ""+this.valueOf());
}
};

Byte.serialVersionUID=Byte.prototype.serialVersionUID=-7183698231559129828;
Expand Down Expand Up @@ -4788,7 +4796,7 @@ return(""+c).toLowerCase().charAt(0);
}, 1);
m$(C$,"toTitleCase$C",
function(c){
return Character.toUpperCase(c);
return Character.toUpperCase$C(c);
}, 1);
m$(C$,"toUpperCase$C",
function(c){
Expand Down
68 changes: 38 additions & 30 deletions sources/net.sf.j2s.java.core/srcjs/swingjs2.js
Original file line number Diff line number Diff line change
Expand Up @@ -13462,6 +13462,7 @@ if (!J2S._version)
// TODO: CharacterSequence does not implement Java 8 default methods chars() or codePoints()
// It is possible that these might be loaded dynamically.

// BH 8/16/2018 3.2.2.04 fixes Character.toTitleCase$C, [Integer,Long,Short,Byte].toString(i,radix)
// BH 8/13/2018 3.2.2.04 $finals to $finals$ -- basically variables are $xxx, methods are xxx$, and special values are $xxx$
// BH 8/12/2018 3.2.2 adding J2S.onClazzLoaded hook for Clazz loaded
// BH 8/11/2018 3.2.2 Clazz.newLambda removed
Expand Down Expand Up @@ -13550,7 +13551,7 @@ window["j2s.clazzloaded"] = true;
_debugging: false,
_loadcore: true,
_nooutput: 0,
_VERSION: "3.2.2.03",
_VERSION_R: "3.2.2.05",
_VERSION_T: "unknown",
};

Expand Down Expand Up @@ -16929,14 +16930,15 @@ var decorateAsNumber = function (clazz, qClazzName, type, PARAMCODE) {

decorateAsNumber(Integer, "Integer", "int", "I");

Integer.toString=Integer.toString$I=Integer.prototype.toString=function(){
if(arguments.length!=0){
return "" + arguments[0];
}
if(this===Integer){
return "class java.lang.Integer";
}
return "" + this.valueOf();
Integer.toString=Integer.toString$I=Integer.toString$I$I=Integer.prototype.toString=function(i,radix){
switch(arguments.length) {
case 2:
return i.toString(radix);
case 1:
return "" +i;
case 0:
return (this===Integer ? "class java.lang.Integer" : ""+this.valueOf());
}
};

m$(Integer, ["c$", "c$$S", "c$$I"], function(v){
Expand Down Expand Up @@ -17120,13 +17122,15 @@ if (typeof arguments[0] != "object")this.c$(arguments[0]);
});

decorateAsNumber(Long, "Long", "long", "L");
Long.toString=Long.toString$J=Long.prototype.toString=function(){
if(arguments.length!=0){
return""+arguments[0];
}else if(this===Long){
return"class java.lang.Long";
}
return""+this.valueOf();
Long.toString=Long.toString$J=Long.toString$J$I = Long.prototype.toString=function(i, radix){
switch(arguments.length) {
case 2:
return i.toString(radix);
case 1:
return "" +i;
case 0:
return (this===Long ? "class java.lang.Long" : ""+this.valueOf());
}
};

m$(Long, ["c$", "c$$S", "c$$J"], function(v){
Expand Down Expand Up @@ -17194,13 +17198,15 @@ function (v,radix) {
this.valueOf = function () {return v;};
}, 1);

Short.toString = Short.prototype.toString = function () {
if (arguments.length != 0) {
return "" + arguments[0];
} else if (this === Short) {
return "class java.lang.Short"; // Short.class.toString
}
return "" + this.valueOf();
Short.toString = Short.toString$H = Short.toString$H$I = Short.prototype.toString = function (i,radix) {
switch(arguments.length) {
case 2:
return i.toString(radix);
case 1:
return "" +i;
case 0:
return (this===Short ? "class java.lang.Short" : ""+this.valueOf());
}
};

Short.MIN_VALUE = Short.prototype.MIN_VALUE = -32768;
Expand Down Expand Up @@ -17256,13 +17262,15 @@ this.valueOf=function(){return v;};
this.byteValue = function(){return v};
}, 1);

Byte.toString=Byte.toString$B=Byte.prototype.toString=function(){
if(arguments.length!=0){
return""+arguments[0];
}else if(this===Byte){
return"class java.lang.Byte";
}
return""+this.valueOf();
Byte.toString=Byte.toString$B=Byte.toString$B$I=Byte.prototype.toString=function(i,radix){
switch(arguments.length) {
case 2:
return i.toString(radix);
case 1:
return "" +i;
case 0:
return (this===Byte ? "class java.lang.Byte" : ""+this.valueOf());
}
};

Byte.serialVersionUID=Byte.prototype.serialVersionUID=-7183698231559129828;
Expand Down