Skip to content

Commit 232dffc

Browse files
committed
URL, zip file reading
1 parent 3d73757 commit 232dffc

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

sources/net.sf.j2s.core/src/net/sf/j2s/core/astvisitors/ASTScriptVisitor.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@
7474
// DONE: array handling in instanceof and reflection
7575

7676
// TODO: String + double should be new Double(x).toString()
77-
// TODO: Formatter
7877
// TODO: Q: Good assumption that generic parameterization can be ignored? put<K,V> vs put<K>?
7978

8079
/**

sources/net.sf.j2s.core/test/dev/js/j2sApplet.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@ J2S._getDefaultLanguage = function(isAll) { return (isAll ? J2S.featureDetection
680680
isBinary = false;
681681
}
682682
isBinary && (isBinary = J2S._canSyncBinary(true));
683-
return (isBinary ? J2S._strToBytes(data) : JU.SB.newS(data));
683+
return (isBinary ? J2S._strToBytes(data) : (self.JU || javajs.util).SB.newS(data));
684684
}
685685

686686
J2S._xhrReturn = function(xhr){
@@ -779,7 +779,7 @@ J2S._getDefaultLanguage = function(isAll) { return (isAll ? J2S.featureDetection
779779
return data.getBytes();
780780
// ArrayBuffer assumed here
781781
data = new Uint8Array(data);
782-
var b = (Clazz.newArray$ ? Clazz.newArray$('BA', 1, [data.length]) : Clazz.newByteArray(data.length, 0));
782+
var b = (Clazz.newArray$ ? Clazz.newArray$(Byte.TYPE, data.length) : Clazz.newByteArray(data.length, 0));
783783
for (var i = data.length; --i >= 0;)
784784
b[i] = data[i];
785785
return b;
@@ -894,7 +894,7 @@ J2S._getDefaultLanguage = function(isAll) { return (isAll ? J2S.featureDetection
894894
if (s.indexOf(";base64,") == 0)
895895
return (self.JU || javajs.util).Base64.decodeBase64$S(s.substring(8));
896896
// not UTF-8
897-
var b = (Clazz.newArray$ ? Clazz.newArray$('BA', 1, [s.length]) : Clazz.newByteArray(s.length, 0));
897+
var b = (Clazz.newArray$ ? Clazz.newArray$(Byte.TYPE, s.length) : Clazz.newByteArray(s.length, 0));
898898
for (var i = s.length; --i >= 0;)
899899
b[i] = s.charCodeAt(i) & 0xFF;
900900
return b;

sources/net.sf.j2s.core/test/dev/js/j2sSwingJS.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
// TODO: Check String.contentEquals -- CharSequence? StringBuffer.shareValue??
1515

16+
// BH 8/26/2017 9:45:55 AM fix for URL.getContent()
1617
// BH 8/24/2017 1:54:01 AM fix for static Character.toUpperCase, .toLowerCase
1718
// BH 8/20/2017 5:04:32 AM lets String implement CharSequence using .length$() for all .length() for ALL classes
1819
// BH 8/18/2017 10:14:09 PM Test_7.class.getConstructor(new Class[]{int[].class}) requires a minimal java.lang.Class
@@ -112,9 +113,6 @@
112113

113114
LoadClazz = function() {
114115

115-
var debugNoSwingJS = true;
116-
if (debugNoSwingJS)alert("Note! debugNoSwingJS in j2sSwingJS.js")
117-
118116

119117
// BH c$ is the ONLY global used in SwingJS now. I do not think it is necessary,
120118
// but it is created by the compiler, and I have not found a post-compile work-around.
@@ -4041,6 +4039,10 @@ Sys.out.printf = Sys.out.format = function (f, args) {
40414039
}
40424040

40434041
Sys.out.println = Sys.out.println$O = Sys.out.println$Z = Sys.out.println$I = Sys.out.println$S = Sys.out.println = function(s) {
4042+
4043+
if (s.indexOf("TypeError") >= 0) {
4044+
debugger;
4045+
}
40444046
if (Clazz._nooutput) return;
40454047
if (Clazz._traceOutput && s && ("" + s).indexOf(Clazz._traceOutput) >= 0)
40464048
alert(s + "\n\n" + Clazz.getStackTrace());
@@ -5209,7 +5211,7 @@ var regExp=new RegExp(exp,"gm");
52095211
var m=this.match(regExp);
52105212
return m!=null&&m.length!=0;
52115213
};
5212-
sp.regionMatches$b$I$S$I$I=function(ignoreCase,toffset,
5214+
sp.regionMatches$Z$I$S$I$I=function(ignoreCase,toffset,
52135215
other,ooffset,len){
52145216

52155217
if(typeof ignoreCase=="number"
@@ -6782,8 +6784,7 @@ return null;
67826784
});
67836785

67846786

6785-
if (!debugNoSwingJS)
6786-
Clazz._Loader.loadZJar(Clazz._Loader.getJ2SLibBase() + "core/coreswingjs.z.js", "swingjs.JSToolkit");
6787+
Clazz._Loader.loadZJar(Clazz._Loader.getJ2SLibBase() + "core/coreswingjs.z.js", "swingjs.JSToolkit");
67876788

67886789

67896790
})(Clazz, J2S); // requires JSmolCore.js

sources/net.sf.j2s.java.core/src/javajs/api/JmolObjectInterface.java renamed to sources/net.sf.j2s.java.core/src/javajs/api/js/J2SObjectInterface.java

File renamed without changes.

sources/net.sf.j2s.java.core/src/javajs/api/JSInterface.java renamed to sources/net.sf.j2s.java.core/src/javajs/api/js/JSInterface.java

File renamed without changes.

0 commit comments

Comments
 (0)