What does a slash mean in a Java stack trace?

Luc :

In the following stack trace:

java.lang.NullPointerException
    at burp.ConfigMenu.run(Config.java:38)
    at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
    at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

What do the slashes mean? I know what e.g. "burp.ConfigMenu.run(Config.java:38)" means, but not the lines with "java.base" or "java.desktop" in front of it.

It looks like some sort of alias, superclass, namespace... but I can't figure it out. Google/DDG are not very helpful with queries like "slash in java stack trace". I found a few other examples by looking for the classes mentioned, but not what they mean.

Brian Agnew :

The Javadoc for StackTraceElement toString() (Java 9, note) explains the format:

The first example shows a stack trace element consisting of three elements, each separated by "/" followed with the source file name and the line number of the source line containing the execution point. The first element "com.foo.loader" is the name of the class loader. The second element "[email protected]" is the module name and version. The third element is the method containing the execution point; "com.foo.Main"" is the fully-qualified class name and "run" is the name of the method. "Main.java" is the source file name and "101" is the line number.

Note how some elements of the above are omitted.

If the class loader is a built-in class loader or is not named then the first element and its following "/" are omitted as shown in "[email protected]/org.acme.Lib.test(Lib.java:80)". If the first element is omitted and the module is an unnamed module, the second element and its following "/" are also omitted as shown in "MyClass.mash(MyClass.java:9)".

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=89710&siteId=1