Skip to content

Commit 6c4086f

Browse files
hansonrhansonr
authored andcommitted
SwingJS-site update
1 parent 745a443 commit 6c4086f

File tree

10 files changed

+24
-3
lines changed

10 files changed

+24
-3
lines changed
2.34 KB
Binary file not shown.
25 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20200801171531
1+
20200807063741
2.34 KB
Binary file not shown.
25 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20200801171531
1+
20200807063741
2.34 KB
Binary file not shown.

sources/net.sf.j2s.java.core/src/test/Test_Class.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import java.net.MalformedURLException;
1717
import java.net.URL;
1818
import java.net.URLConnection;
19+
import java.util.Date;
1920
import java.util.Hashtable;
2021
import java.util.List;
2122
import java.util.Map;
@@ -323,6 +324,8 @@ public static String localtest() {
323324

324325
public static void main(String[] args) {
325326

327+
// System.out.println(new Date() + " " + Date.parse("3/4/2020"));
328+
326329
System.out.println(Number.class.isAssignableFrom(Double.class));
327330
System.out.println(System.getProperty("user.dir"));
328331
System.out.println(System.getProperty("user.home"));

sources/net.sf.j2s.java.core/src/test/Test_Ints.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,17 @@ private static int builtInExtFunction(int i, int j, int k) {
5959
}
6060

6161
public static void main(String[] args) {
62+
63+
64+
assert(1 == new Integer(1));
65+
assert(new Integer(1) == 1);
66+
assert(Integer.valueOf(1) == 1);
67+
assert(1 == Integer.valueOf(1));
68+
assert(new Integer(1) != Integer.valueOf(1));
69+
70+
71+
72+
6273
int[] stack = new int[] { 0, 1, 2, 3, 4, 5 };
6374
int stack_pointer = 3;
6475

sources/net.sf.j2s.java.core/srcjs/swingjs2.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17657,11 +17657,15 @@ Integer.SIZE=Integer.prototype.SIZE=32;
1765717657
var ints = [];
1765817658
var longs = [];
1765917659
var shorts = [];
17660+
var chars = {};
1766017661

1766117662
var minValueOf = -128;
1766217663
var maxValueOf = 127;
1766317664

1766417665
var getCachedNumber = function(i, a, cl, c$) {
17666+
if (a == chars) {
17667+
return a[i] ? a[i] : (a[i] = Clazz.new_(cl[c$], [i]));
17668+
}
1766517669
if (i >= minValueOf && i <= maxValueOf) {
1766617670
var v = a[i - minValueOf];
1766717671
return (v ? v : a[i - minValueOf] = Clazz.new_(cl[c$], [i]));
@@ -19173,7 +19177,10 @@ function(codePoint){
1917319177
return (pt1 < 0 ? "??" : unicode_txt.substring(pt + 6, pt1));
1917419178
}, 1);
1917519179

19176-
m$(C$,"valueOf$C",function(c){return Clazz.new_(Character.c$, [c]);},1);
19180+
m$(C$,"valueOf$C",function(c){
19181+
return (c <= '\u007F' ? getCachedNumber(c, chars, Character, "c$$C")
19182+
: Clazz.new_(Character.c$$C, [c]));
19183+
},1);
1917719184

1917819185
C$.prototype.$c = function(){return this.value.charCodeAt(0)};
1917919186

0 commit comments

Comments
 (0)