File tree Expand file tree Collapse file tree
src/de/inetsoftware/jwebassembly/api/java/lang Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -31,4 +31,12 @@ class ReplacementForClassLoader {
3131 private static void registerNatives () {
3232 // nothing
3333 }
34+
35+ /**
36+ * Replacement for getSystemClassLoader();
37+ */
38+ @ Replace ( "java/lang/ClassLoader.getSystemClassLoader()Ljava/lang/ClassLoader;" )
39+ public static ClassLoader getSystemClassLoader () {
40+ return null ;
41+ }
3442}
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ class ReplacementForThread {
3232 @ Replace ( "java/lang/Thread.currentThread()Ljava/lang/Thread;" )
3333 static Thread currentThread () {
3434 if ( current == null ) {
35- new Thread ( "main" );
35+ current = new Thread ( "main" );
3636 }
3737 return current ;
3838 }
@@ -44,6 +44,14 @@ static Thread currentThread() {
4444 static void registerNatives () {
4545 }
4646
47+ /**
48+ * Replacement for holdsLock().
49+ */
50+ @ Replace ( "java/lang/Thread.holdsLock(Ljava/lang/Object;)Z" )
51+ public static boolean holdsLock (Object obj ) {
52+ return true ;
53+ }
54+
4755 /**
4856 * Replacement for setPriority0().
4957 */
Original file line number Diff line number Diff line change @@ -39,4 +39,20 @@ class ReplacementForThrowable {
3939 private static Throwable fillInStackTrace ( Throwable this_ ) {
4040 return this_ ;
4141 }
42+
43+ /**
44+ * Replacement for getStackTraceDepth()
45+ */
46+ @ Replace ( "java/lang/Throwable.getStackTraceDepth()I" )
47+ private int getStackTraceDepth () {
48+ return 0 ;
49+ }
50+
51+ /**
52+ * Replacement for getStackTraceElement(int)
53+ */
54+ @ Replace ( "java/lang/Throwable.getStackTraceElement(I)Ljava/lang/StackTraceElement;" )
55+ StackTraceElement getStackTraceElement (int index ) {
56+ return null ;
57+ }
4258}
You can’t perform that action at this time.
0 commit comments