Skip to content

Commit 5479b7f

Browse files
committed
URL issues, Gemfile update
1 parent 764b732 commit 5479b7f

File tree

8 files changed

+19
-11
lines changed

8 files changed

+19
-11
lines changed

docs/Gemfile.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ GEM
66
minitest (~> 5.1)
77
thread_safe (~> 0.3, >= 0.3.4)
88
tzinfo (~> 1.1)
9-
addressable (2.5.2)
9+
addressable (>= 2.8.0)
1010
public_suffix (>= 2.0.2, < 4.0)
1111
coffee-script (2.4.1)
1212
coffee-script-source
@@ -74,7 +74,7 @@ GEM
7474
rouge (= 2.2.1)
7575
terminal-table (~> 1.4)
7676
github-pages-health-check (1.4.0)
77-
addressable (~> 2.3)
77+
addressable (>= 2.8.0)
7878
net-dns (~> 0.8)
7979
octokit (~> 4.0)
8080
public_suffix (~> 2.0)
@@ -86,7 +86,7 @@ GEM
8686
i18n (0.9.5)
8787
concurrent-ruby (~> 1.0)
8888
jekyll (~> 3.7.4)
89-
addressable (~> 2.4)
89+
addressable (>= 2.8.0)
9090
colorator (~> 1.0)
9191
em-websocket (~> 0.5)
9292
i18n (~> 0.7)
@@ -229,7 +229,7 @@ GEM
229229
rb-fsevent (~> 0.9, >= 0.9.4)
230230
rb-inotify (~> 0.9, >= 0.9.7)
231231
sawyer (0.8.1)
232-
addressable (>= 2.3.5, < 2.6)
232+
addressable (>= 2.8.0)
233233
faraday (~> 0.8, < 1.0)
234234
terminal-table (1.8.0)
235235
unicode-display_width (~> 1.1, >= 1.1.1)
-102 KB
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20220915081800
1+
20221112121850
-102 KB
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20220915081800
1+
20221112121850

sources/net.sf.j2s.java.core/src/java/io/File.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,7 @@ else if ((p = uri.getPath()).equals(""))
391391
this.path = //fs.normalize
392392
(p);
393393
this.prefixLength = fs.prefixLength(this.path);
394+
秘bytes = uri.秘bytes;
394395
return;
395396
}
396397
throw new IllegalArgumentException(err);

sources/net.sf.j2s.java.core/src/swingjs/JSUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1045,7 +1045,7 @@ public void setAppletInfo(String infoKey, Object val) {
10451045
public URL getDocumentBase() {
10461046
JSFrameViewer ap = (JSFrameViewer) this.getAppletAttribute("_appletPanel");
10471047
try {
1048-
return new URL(ap.appletDocumentBase);
1048+
return (ap == null ? new URL("file://./"): new URL(ap.appletDocumentBase));
10491049
} catch (MalformedURLException e) {
10501050
return null;
10511051
}

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

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import java.io.BufferedReader;
55
import java.io.DataOutputStream;
66
import java.io.File;
7+
import java.io.FileReader;
78
import java.io.IOException;
89
import java.io.InputStream;
910
import java.io.InputStreamReader;
@@ -49,6 +50,12 @@ protected static String getResponseMimeType() {
4950
public static void main(String[] args) {
5051

5152
try {
53+
URL u = Test_URL.class.getResource("ctx_test.js");
54+
System.out.println(u);
55+
System.out.println(u.toURI());
56+
File file = new File(u.toURI());
57+
BufferedReader fr = new BufferedReader(new FileReader(file));
58+
fr.close();
5259
String value = "this is a test+this";
5360
String s = URLEncoder.encode(value.replace(' ', '\0'), "UTF-8").replaceAll("%00", "%20");
5461
System.out.println(s);
@@ -62,7 +69,7 @@ public static void main(String[] args) {
6269
URL url;
6370
URL jarURL;
6471

65-
String jarpath = /** @j2sNative "./test/test.xlsx" || */
72+
String jarpath = /** @j2sNative "/test/test.xlsx" || */
6673
"src/test/test.xlsx";
6774
url = new URL("file", null, "C:/temp/car.trz");
6875
jarURL = new URL("jar", null, url + "!/Car in a loop with friction.trk");// "!/xl/worksheets/sheet1.xml");
@@ -117,7 +124,7 @@ public static void main(String[] args) {
117124

118125
} catch (Exception e2) {
119126
// This error thrown in Java only
120-
e2.printStackTrace();
127+
assert(/** @j2sNative false && */true);
121128
}
122129

123130
dumpHeaders("http://www.opensourcephysics.org");
@@ -136,7 +143,7 @@ public static void main(String[] args) {
136143
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
137144
assert (connection.getResponseCode() == HttpURLConnection.HTTP_NOT_FOUND);
138145
} catch (Exception e1) {
139-
e1.printStackTrace();
146+
System.out.println(e1 + " OK");
140147
}
141148

142149
try {
@@ -160,7 +167,7 @@ public static void main(String[] args) {
160167
String s = Rdr.streamToString(is);
161168
is.close();
162169
System.out.println(s);
163-
assert (s.equals("{\"ping\":1}\n"));
170+
assert (s.trim().equals("{\"ping\":1}"));
164171

165172
assert checkEnsembl();
166173

0 commit comments

Comments
 (0)