Skip to content

Commit 6d04801

Browse files
author
zhourenjian
committed
1. Fix bug that "too much recursion" on AbstractList
2. StringBuilder does not require Arrays and java.util.*
1 parent 9e160f8 commit 6d04801

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

sources/net.sf.j2s.java.core/src/java/lang/AbstractStringBuilder.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
package java.lang;
1919

2020
import java.io.InvalidObjectException;
21-
import java.util.Arrays;
21+
//import java.util.Arrays;
2222

2323
import org.apache.harmony.luni.util.Msg;
2424

@@ -507,7 +507,10 @@ public void setLength(int length) {
507507
value = newData;
508508
shared = false;
509509
} else {
510-
Arrays.fill(value, count, length, (char) 0);
510+
//Arrays.fill(value, count, length, (char) 0);
511+
for (int i = count; i < length; i++) {
512+
value[i] = 0;
513+
}
511514
}
512515
}
513516
}

sources/net.sf.j2s.java.core/src/java/lang/ClassExt.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,12 @@ Clazz.innerTypeInstance = function (clazzInner, objThis, finalVars) {
125125
} else */if (arguments.length == 3) {
126126
obj = new clazzInner (objThis);
127127
} else if (arguments.length == 4) {
128-
obj = new clazzInner (objThis, arguments[3]);
128+
if (objThis.__CLASS_NAME__ == clazzInner.__CLASS_NAME__
129+
&& arguments[3] == Clazz.inheritArgs) {
130+
obj = objThis;
131+
} else {
132+
obj = new clazzInner (objThis, arguments[3]);
133+
}
129134
} else if (arguments.length == 5) {
130135
obj = new clazzInner (objThis, arguments[3], arguments[4]);
131136
} else if (arguments.length == 6) {

sources/net.sf.j2s.java.core/src/java/lang/ClassLoader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2680,7 +2680,7 @@ window.setTimeout (function () {
26802680
}
26812681
}
26822682
/* start ClazzLoader hotspot monitoring after 1 second */
2683-
if (window["j2s.script.debugging"] == true) {
2683+
if (window["j2s.script.debugging"] == true && window["j2s.disable.hotspot"] != true) {
26842684
window.setTimeout (ClazzLoader.hotspotMonitoring, 1000);
26852685
}
26862686
}, 324); // 0.324 seconds is considered as enough before refresh action

0 commit comments

Comments
 (0)