Skip to content

Commit 4bdcdb6

Browse files
committed
adds Integer.getString(String, int); allows for null applet stub
stub needs to throw the correct exception
1 parent 48a7898 commit 4bdcdb6

File tree

8 files changed

+21
-2
lines changed

8 files changed

+21
-2
lines changed
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20240613090629
1+
20240623080202
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20240613090629
1+
20240623080202
149 Bytes
Binary file not shown.

sources/net.sf.j2s.java.core/src/java/applet/JSApplet.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,9 @@ public boolean isActive() {
204204
* @see java.applet.Applet#getCodeBase()
205205
*/
206206
public URL getDocumentBase() {
207+
if (stub == null)
208+
throw new NullPointerException();
209+
207210
return stub.getDocumentBase();
208211
}
209212

@@ -244,6 +247,8 @@ public URL getCodeBase() {
244247
* or <code>null</code> if not set.
245248
*/
246249
public String getParameter(String name) {
250+
if (stub == null)
251+
throw new NullPointerException();
247252
return stub.getParameter(name);
248253
}
249254

@@ -257,6 +262,8 @@ public String getParameter(String name) {
257262
* @return the applet's context.
258263
*/
259264
public AppletContext getAppletContext() {
265+
if (stub == null)
266+
throw new NullPointerException();
260267
return stub.getAppletContext();
261268
}
262269

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

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

88
// Google closure compiler cannot handle Clazz.new or Clazz.super
99

10+
// BH 2024.06.22 adds Integer.getIngeger(String, int) (returning null)
1011
// BH 2024.03.03 removes unnecessary loadClass("xxxx") on exceptionOf(e,"xxxx") call
1112
// BH 2024.02.23 fixes missing Long.signum
1213
// BH 2023.04.30 fixes issues when Info.console == window.console
@@ -3955,6 +3956,11 @@ function(s,radix){
39553956
return parseIntLimit(s, radix, minInt, maxInt);
39563957
}, 1);
39573958

3959+
m$(Integer,"getInteger$S$I",
3960+
function(ms,i){
3961+
return Integer.valueOf$I(i);
3962+
}, 1);
3963+
39583964
m$(Integer,"highestOneBit$I",
39593965
function(i) {
39603966
i |= (i >> 1);

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14121,6 +14121,7 @@ if (ev.keyCode == 9 && ev.target["data-focuscomponent"]) {
1412114121

1412214122
// Google closure compiler cannot handle Clazz.new or Clazz.super
1412314123

14124+
// BH 2024.06.22 adds Integer.getIngeger(String, int) (returning null)
1412414125
// BH 2024.03.03 removes unnecessary loadClass("xxxx") on exceptionOf(e,"xxxx") call
1412514126
// BH 2024.02.23 fixes missing Long.signum
1412614127
// BH 2023.04.30 fixes issues when Info.console == window.console
@@ -18069,6 +18070,11 @@ function(s,radix){
1806918070
return parseIntLimit(s, radix, minInt, maxInt);
1807018071
}, 1);
1807118072

18073+
m$(Integer,"getInteger$S$I",
18074+
function(ms,i){
18075+
return Integer.valueOf$I(i);
18076+
}, 1);
18077+
1807218078
m$(Integer,"highestOneBit$I",
1807318079
function(i) {
1807418080
i |= (i >> 1);

0 commit comments

Comments
 (0)