Skip to content

Commit 1b6d50b

Browse files
hansonrhansonr
authored andcommitted
update for swingjs/
1 parent 2f66d4a commit 1b6d50b

File tree

10 files changed

+16
-9
lines changed

10 files changed

+16
-9
lines changed
44.4 KB
Binary file not shown.
38 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20181029090933
1+
20181030134905
44.4 KB
Binary file not shown.
38 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20181029090933
1+
20181030134905
45.2 KB
Binary file not shown.

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

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242

4343
import javax.xml.bind.annotation.XmlRootElement;
4444

45+
import swingjs.JSUtil;
46+
4547
//import sun.misc.Unsafe;
4648
//import sun.reflect.ConstantPool;
4749
//import sun.reflect.Reflection;
@@ -2288,17 +2290,19 @@ public Constructor<T> getDeclaredConstructor(Class<?>... parameterTypes)
22882290
* @since JDK1.1
22892291
*/
22902292

2293+
@SuppressWarnings("unused")
22912294
public InputStream getResourceAsStream(String name) {
22922295
// allows an optional second argument to be a base directory in JavaScript
22932296
@SuppressWarnings("unused")
22942297
String clazzName = $clazz$.__CLASS_NAME__;
2298+
Object data = null, fname = null;
22952299
/**
22962300
* @j2sNative
22972301
if (!name)
22982302
return null;
22992303
name = name.replace (/\\/g, '/');
23002304
var baseFolder = null;
2301-
var fname = name;
2305+
fname = name;
23022306
if (arguments.length == 2 && name.indexOf ('/') != 0) { // additional argument
23032307
name = "/" + name;
23042308
}
@@ -2342,10 +2346,13 @@ public InputStream getResourceAsStream(String name) {
23422346
return null;
23432347
}
23442348
var fileCache = J2S.getSetJavaFileCache(null);
2345-
var data = fileCache && fileCache.get$O(javapath);
2346-
if (!data)
2347-
data = J2S.getFileData(fname.toString(),null,1,1);
2348-
2349+
data = fileCache && fileCache.get$O(javapath);
2350+
*/
2351+
if (data == null)
2352+
data = JSUtil.J2S.getFileData(fname.toString(),null,true,true);
2353+
/**
2354+
* @j2sNative
2355+
*
23492356
if (data == null || data == "error" || data.indexOf && data.indexOf("[Exception") == 0)
23502357
return null;
23512358

sources/net.sf.j2s.java.core/src/javajs/util/OC.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ public String closeChannel() {
350350
// temp files will not be sent this way.
351351
Object data = (sb == null ? toByteArray() : sb.toString());
352352
if (_function == null) {
353-
Object info = /** @j2sNative { isBinary : (sb == null) } || */ null;
353+
Object info = /** @j2sNative { isBinary : (this.sb == null) } || */ null;
354354
J2S.doAjax(fileName, null, data, info);
355355
} else {
356356
J2S.applyFunc(_function, data);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15181,7 +15181,7 @@ Clazz._getStackTrace = function(n) {
1518115181
s += "<recursing>\n";
1518215182
break;
1518315183
}
15184-
if (showParams) {
15184+
if (showParams) {
1518515185
s += getArgs(c);
1518615186
}
1518715187
}

0 commit comments

Comments
 (0)