-
Notifications
You must be signed in to change notification settings - Fork 875
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
Links in output window stacktraces do not work (when they point to JDK code) #4516
Comments
Thanks for the detailed report. Could reproduce it on latest master too (basically NB 15). |
btw as workaround you could paste the stack trace into the windows -> debugging -> analyze stack trace window. It works from there. |
So looks like this code and the regex it uses need updating to be module aware - https://github.com/apache/netbeans/blob/master/java/maven/src/org/netbeans/modules/maven/api/output/OutputUtils.java#L172 See also regex in StackAnalyzer https://github.com/apache/netbeans/blob/master/java/java.navigation/src/org/netbeans/modules/java/stackanalyzer/StackLineAnalyser.java#L57 Would be good to have this in one place, but if not at least kept in sync? Anywhere else analyzing stack traces? |
@neilcsmith-net there are multiple issues here I believe. If you set a breakpoint at
This seems to be the case no matter if the project has a module info or not. 'packageName' a few lines above the breakpoint is incorrect too if a module is in the trace line (but this isn't the main issue). edit: i renamed the title here to only track the issue of stack trace not being able to open jdk files, since I believe it will be easier to approach this incrementally. |
@mbien yes, certainly didn't mean that the regex is the only issue that needs addressing in that code! It searches for the wrong package name with JDK missing from the classpath. Both are equally important, surely? Won't work with either broken. Project module info shouldn't be relevant to JDK classes being in a module. But module aware stack elements would also fix more than just the JDK links. |
opening JDK links already didn't work on NB 8 + JDK 8 which indicates that it was most likely never implemented for maven projects. Going to take a look how to get the active jdk of a project and see how to proceed from there. I already couldn't figure out how to get the project JDK info when I wrote #4802, lets give it another try. |
@mbien yes, both are broken. I would guess lack of The stack trace analyzer doesn't work correctly here either, obviously, as it's just using the global classpath info, so always going to give the running JDK. |
Reminds me of what's going on sorting out gradle projects and which jdk... with #5052 |
forgot to post here that #5091 is pending and should fix the issue encountered here. dev build is linked from the PR. Would be good if someone could confirm that this issue is fixed. |
Michael,
I downloaded and ran the dev build in the link for #5091 and it appears to work for me on OSX 12.5.1. Both stack trace links links into the JDK and my own code seem to be working when I click them in the output window.
Thank you for making this work! I look forward to seeing this in NB17.
mark
… On Dec 14, 2022, at 8:05 AM, Michael Bien ***@***.***> wrote:
forgot to post here that #5091 <#5091> is pending and should fix the issue encountered here. dev build is linked from the PR. Would be good if someone could confirm that this issue is fixed.
—
Reply to this email directly, view it on GitHub <#4516 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABTT4KBHHO6F3YAVPYJOEATWNHV6PANCNFSM565XUTUA>.
You are receiving this because you are subscribed to this thread.
|
@maehem awesome, thanks a lot for verifying! |
Apache NetBeans version
Apache NetBeans 14
What happened
The links in stacktraces to JDK code do not work with JDK 9+.
How to reproduce
Run any code causing an exception in JDK code in a Maven project, for example:
Output:
Clicking on a link starting with
java.base/
(or any other Java module) does not open the file and a messageSource file not found for "FileReader"
/Source file not found for "FileInputStream"
appears in the status bar.Did this work correctly in an earlier version?
No / Don't know
Operating System
Windows 10 64-bit
JDK
OpenJDK 18.0.2 Windows x64
Apache NetBeans packaging
Apache NetBeans binary zip
Anything else
Always happens with JDK 9+.
NetBeans is running on OpenJDK 18.0.2 and the project uses an OpenJDK 18.0.2 Maven toolchain. (Maven istself is running on Java 8, but that shouldn’t matter.)
NetBeans found the sources when adding the JDK 18.0.2 platform and these files can be opened in the Debugging tab when using the debugger. The links do not work even when the matching JDK file is opened.
I believe the links worked earlier when using Java 8 or older (without the module system).
The links work with own code and Maven dependencies (if the source JAR is present).
Are you willing to submit a pull request?
No
Code of Conduct
Yes
The text was updated successfully, but these errors were encountered: