snreinert opened a new issue, #6682:
URL: https://github.com/apache/netbeans/issues/6682
### Apache NetBeans version
Apache NetBeans 19
### What happened
I can't start a debug session of a Java project targeting JDK 8 after
setting breakpoints in the JDK8u repo source. The exception stack trace below
is thrown when I try to start a debug session after setting a line breakpoint
in
`jdk8u/jdk/src/macosx/classes/com/apple/laf/AquaLookAndFeel.java` on line
217. The line number doesn't seem to matter, and neither does the source file
as long as it's Java source and part of the jdk8u repo.
If I remove the line breakpoint, then the exception is not thrown and the
debug session starts correctly.
```
java.lang.NullPointerException: Cannot invoke
"org.netbeans.modules.java.openjdk.project.ModuleDescription$ModuleRepository.isAnyProjectOpened()"
because "this.repository" is null
at
org.netbeans.modules.java.openjdk.project.ClassPathProviderImpl.findClassPath(ClassPathProviderImpl.java:206)
at
org.netbeans.modules.java.project.ProjectClassPathProvider.findClassPath(ProjectClassPathProvider.java:50)
at
org.netbeans.api.java.classpath.ClassPath.getClassPath(ClassPath.java:667)
at
org.netbeans.modules.debugger.jpda.projects.SourcePathProviderImpl.getSourceRoot(SourcePathProviderImpl.java:784)
at
org.netbeans.modules.debugger.jpda.SourcePath$CompoundContextProvider.getSourceRoot(SourcePath.java:413)
at
org.netbeans.modules.debugger.jpda.SourcePath$CompoundContextProvider.getSourceRoot(SourcePath.java:415)
at
org.netbeans.modules.debugger.jpda.SourcePath.getSourceRoot(SourcePath.java:114)
at
org.netbeans.modules.debugger.jpda.breakpoints.LineBreakpointImpl.<init>(LineBreakpointImpl.java:133)
at
org.netbeans.modules.debugger.jpda.breakpoints.BreakpointsEngineListener.createBreakpointImpl(BreakpointsEngineListener.java:318)
at
org.netbeans.modules.debugger.jpda.breakpoints.BreakpointsEngineListener.createBreakpointImpls(BreakpointsEngineListener.java:260)
at
org.netbeans.modules.debugger.jpda.breakpoints.BreakpointsEngineListener.propertyChange(BreakpointsEngineListener.java:119)
at
java.desktop/java.beans.PropertyChangeSupport.fire(PropertyChangeSupport.java:343)
at
java.desktop/java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:336)
at
org.netbeans.modules.debugger.jpda.JPDADebuggerImpl.firePropertyChange(JPDADebuggerImpl.java:2253)
at
org.netbeans.modules.debugger.jpda.JPDADebuggerImpl.setState(JPDADebuggerImpl.java:2237)
at
org.netbeans.modules.debugger.jpda.JPDADebuggerImpl.setRunning(JPDADebuggerImpl.java:1321)
[catch] at
org.netbeans.modules.debugger.jpda.actions.StartActionProvider.doStartDebugger(StartActionProvider.java:184)
at
org.netbeans.modules.debugger.jpda.actions.StartActionProvider.access$200(StartActionProvider.java:55)
at
org.netbeans.modules.debugger.jpda.actions.StartActionProvider$1.run(StartActionProvider.java:140)
at
org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1419)
at
org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45)
at org.openide.util.lookup.Lookups.executeWith(Lookups.java:287)
at
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2034)
```
### How to reproduce
### Steps to reproduce
1. Clone openjdk jdk8u from here: https://github.com/openjdk/jdk8u.git
2. Open Netbeans 19
3. Open any source file from this repo, such as
`jdk8u/jdk/src/macosx/classes/com/apple/laf/AquaLookAndFeel.java`
4. Toggle a line breakpoint somewhere on a reachable line of code
5. Start a debug session for a Java project that targets JDK 8 with a Java
platform defined using this path:
`/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home`
6. Debug session fails to start with the exception in "What happened" being
thrown
7. Click "Select in projects" on the source file in question (e.g.
StringBuilder.java, AquaLookAndFeel.java)
8. An auto-generated jdk8u project gets created and shows the source in the
Projects view there
9. Retry debug session
10. Same exception is thrown
11. Remove any line breakpoints set in step 4
12. Start debug session
13. Debug session starts successfully
### Did this work correctly in an earlier version?
No / Don't know
### Operating System
macOS 13.4 (22F66)
### JDK
Zulu21.30+15-CA (build 21.0.1+12-LTS)
### Apache NetBeans packaging
Apache NetBeans provided installer
### Anything else
I tried on other releases of Netbeans going back to 17 and they all had some
variation on this behavior.
### Are you willing to submit a pull request?
Yes
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists