File tree Expand file tree Collapse file tree 4 files changed +55
-11
lines changed
src/de/inetsoftware/jwebassembly/api/java Expand file tree Collapse file tree 4 files changed +55
-11
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2020 Volker Berlin (i-net software)
2
+ * Copyright 2020 - 2022 Volker Berlin (i-net software)
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -47,4 +47,28 @@ static int hashCode(Object x) {
47
47
@ Import ( js ="(val)=>Object.assign({},val)" )
48
48
@ Replace ( "java/lang/Object.clone()Ljava/lang/Object;" )
49
49
private static native Object clone0 ();
50
+
51
+ /**
52
+ * Replacement for {@link Object#notify()}
53
+ */
54
+ @ Replace ( "java/lang/Object.notify()V" )
55
+ public final void notify0 () {
56
+ // nothing
57
+ }
58
+
59
+ /**
60
+ * Replacement for {@link Object#notifyAll()}
61
+ */
62
+ @ Replace ( "java/lang/Object.notifyAll()V" )
63
+ public final void notifyAll0 () {
64
+ // nothing
65
+ }
66
+
67
+ /**
68
+ * Replacement for {@link Object#wait(long)}
69
+ */
70
+ @ Replace ( "java/lang/Object.wait(J)V" )
71
+ public final void wait0 (long timeout ) {
72
+ // nothing
73
+ }
50
74
}
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2021 Volker Berlin (i-net software)
2
+ * Copyright 2021 - 2022 Volker Berlin (i-net software)
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
22
22
/**
23
23
* Replacement methods for the class java.lang.SecurityManager.
24
24
*
25
+ * We does not want use a SecurityManager and we does not want compile all the classes that the SecurityManager need that we override it with a stub.
26
+ *
25
27
* @author Volker Berlin
26
28
*/
27
29
class ReplacementForSecurityManager {
@@ -57,4 +59,20 @@ public void checkPermission(Permission perm) {
57
59
protected Class [] getClassContext () {
58
60
return null ;
59
61
}
62
+
63
+ /**
64
+ * Replacement for {@link SecurityManager#checkAccess(Thread)}
65
+ */
66
+ @ Replace ( "java/lang/SecurityManager.checkAccess(Ljava/lang/Thread;)V" )
67
+ public void checkAccess (Thread t ) {
68
+ // nothing
69
+ }
70
+
71
+ /**
72
+ * Replacement for {@link SecurityManager#checkAccess(ThreadGroup)}
73
+ */
74
+ @ Replace ( "java/lang/SecurityManager.checkAccess(Ljava/lang/ThreadGroup;)V" )
75
+ public void checkAccess (ThreadGroup g ) {
76
+ // nothing
77
+ }
60
78
}
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2021 Volker Berlin (i-net software)
2
+ * Copyright 2021 - 2022 Volker Berlin (i-net software)
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
22
22
*
23
23
* @author Volker Berlin
24
24
*/
25
+ @ Replace ( "java/security/AccessControlContext" )
25
26
class ReplacementForAccessControlContext {
26
27
27
- /**
28
- * Replacement for getDebug().
29
- */
30
- @ Replace ( "java/security/AccessControlContext.getDebug()Lsun/security/util/Debug;" )
31
- static Object getDebug () {
32
- return null ;
33
- }
34
28
}
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2020 Volker Berlin (i-net software)
2
+ * Copyright 2020 - 2022 Volker Berlin (i-net software)
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -91,4 +91,12 @@ private static AccessControlContext getInheritedAccessControlContext() {
91
91
public static void checkPermission (Permission perm ) {
92
92
// nothing, there is no security check in WASM
93
93
}
94
+
95
+ /**
96
+ * Replacement for getContext().
97
+ */
98
+ @ Replace ( "java/security/AccessController.getContext()Ljava/security/AccessControlContext;" )
99
+ public static ReplacementForAccessControlContext getContext () {
100
+ return new ReplacementForAccessControlContext ();
101
+ }
94
102
}
You can’t perform that action at this time.
0 commit comments