Skip to content

Commit 4f3929c

Browse files
hansonrhansonr
authored andcommitted
allows JSUtil.getStackTrace() to work in Java
1 parent 0ddc1b8 commit 4f3929c

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,18 @@ public static String getStackTrace(int n) {
324324
}
325325

326326
public static String getStackTrace() {
327-
return /** @j2sNative Clazz._getStackTrace() || */null;
327+
/**
328+
* @j2sNative return Clazz._getStackTrace();
329+
*
330+
*/
331+
{
332+
try {
333+
throw new NullPointerException();
334+
} catch (Exception e) {
335+
e.printStackTrace();
336+
return e.getStackTrace().toString();
337+
}
338+
}
328339
}
329340

330341
/**

0 commit comments

Comments
 (0)