-
Notifications
You must be signed in to change notification settings - Fork 738
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve formatting of threadInfo #4998
Conversation
Tested manually:
|
Note the missing module version should also be fixed. |
That's a bug in StackTraceElement. Will update. |
11e13fa
to
c9315c3
Compare
jenkins test sanity plinux jdk11 |
jenkins test extended plinux jdk11 |
@@ -260,6 +260,8 @@ void appendTo(Appendable buf) { | |||
/*[IF Sidecar19-SE]*/ | |||
if (null != moduleName) { | |||
appendTo(buf, moduleName); | |||
appendTo(buf, "@"); //$NON-NLS-1$ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is correct. Seems that printStackTrace() doesn't include the version, while the ThreadInfo printing does.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the reference implementation StackTraceElement.toString()
does not print the version or monitor information, nor do Thread.dumpStack()
or Exception.printStackTrace(). It appears that only
ThreadInfo.toString()` prints this extra information.
Please also check the output for non-modularied class. |
I got something similar from OpenJDK on my test case compiled with Java 8:
OpenJ9 matches that, though the version information is formatted differently:
The formatting code in |
d5c7e3f
to
b11d1e4
Compare
Updated and designer tested. Ready for review. |
jcl/src/java.management/share/classes/java/lang/management/ThreadInfo.java
Outdated
Show resolved
Hide resolved
Note the following
gives the following output for the main thread. The
|
If I change the test case to a different package (test), then the output changes to
|
jcl/src/java.management/share/classes/java/lang/management/ThreadInfo.java
Outdated
Show resolved
Hide resolved
Odd. I did the same test (except with package |
2e866a3
to
c8a2233
Compare
Please squash. |
Move StackTraceElement toString implementation to a utility method to allow more latitude in formatting. Make stack trace format match reference implementation. Add module version to StackTraceElement's toString(). Add locking information. Refactor utility methods. Fixes eclipse-openj9#4965 Fixes eclipse-openj9#5012 [ci skip] Signed-off-by: Peter Bain <peter_bain@ca.ibm.com>
Squashed. |
jenkins test sanity zlinux jdk8 |
jenkins test sanity zlinux jdk11 |
jenkins test extended plinux jdk8,jdk11 |
Improve formatting of ThreadInfo and StackTraceElement
Move StackTraceElement toString implementation to a utility method to allow
more latitude in formatting. Make stack trace format match reference
implementation. Add module version to StackTraceElement's toString(). Add
locking information.
Fixes #4965
Fixes #5012
Signed-off-by: Peter Bain peter_bain@ca.ibm.com