Handle null mimepath in DAPBreakpointActionProvider#8333
Merged
jtulach merged 1 commit intoapache:masterfrom Mar 16, 2025
Merged
Handle null mimepath in DAPBreakpointActionProvider#8333jtulach merged 1 commit intoapache:masterfrom
jtulach merged 1 commit intoapache:masterfrom
Conversation
It was observed, that there can be situation where
DAPBreakpointActionProvider is invoked on a document without mime path
in that case an assertion is hit.
Improve handling of that case by indicating, that break points are not
supported in that case.
java.lang.AssertionError: path cannot be null
at org.netbeans.api.editor.mimelookup.MimePath.parse(MimePath.java:201)
at org.netbeans.api.editor.mimelookup.MimeLookup.getLookup(MimeLookup.java:111)
at org.netbeans.modules.lsp.client.debugger.breakpoints.DAPBreakpointActionProvider.lambda$hasMimeTypeDAPBreakpoints$1(DAPBreakpointActionProvider.java:58)
at java.base/java.util.HashMap.computeIfAbsent(HashMap.java:1228)
at org.netbeans.modules.lsp.client.debugger.breakpoints.DAPBreakpointActionProvider.hasMimeTypeDAPBreakpoints(DAPBreakpointActionProvider.java:57)
at org.netbeans.modules.lsp.client.debugger.breakpoints.DAPBreakpointActionProvider.isRelevantFile(DAPBreakpointActionProvider.java:133)
at org.netbeans.modules.lsp.client.debugger.breakpoints.DAPBreakpointActionProvider.getCurrentLine(DAPBreakpointActionProvider.java:123)
at org.netbeans.modules.lsp.client.debugger.breakpoints.DAPBreakpointActionProvider.propertyChange(DAPBreakpointActionProvider.java:140)
at org.openide.util.WeakListenerImpl$PropertyChange.propertyChange(WeakListenerImpl.java:189)
at java.desktop/java.beans.PropertyChangeSupport.fire(PropertyChangeSupport.java:343)
at java.desktop/java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:335)
at org.netbeans.spi.debugger.ui.EditorContextDispatcher.firePropertyChange(EditorContextDispatcher.java:521)
at org.netbeans.spi.debugger.ui.EditorContextDispatcher.access$2000(EditorContextDispatcher.java:101)
at org.netbeans.spi.debugger.ui.EditorContextDispatcher$EventFirer.run(EditorContextDispatcher.java:990)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1403)
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:2018)
Caused: org.openide.util.RequestProcessor$SlowItem
at org.openide.util.RequestProcessor.post(RequestProcessor.java:395)
at org.netbeans.spi.debugger.ui.EditorContextDispatcher$EditorLookupListener.lookupChanged(EditorContextDispatcher.java:700)
at org.netbeans.spi.debugger.ui.EditorContextDispatcher$EditorLookupListener.coalescedLookupChanged(EditorContextDispatcher.java:659)
at org.netbeans.spi.debugger.ui.EditorContextDispatcher$EditorLookupListener.resultChanged(EditorContextDispatcher.java:622)
at org.openide.util.lookup.SimpleProxyLookup.checkLookup(SimpleProxyLookup.java:89)
at org.openide.util.lookup.SimpleProxyLookup.lookup(SimpleProxyLookup.java:134)
at org.netbeans.modules.openide.windows.GlobalActionContextImpl.propertyChange(GlobalActionContextImpl.java:169)
at java.desktop/java.beans.PropertyChangeSupport.fire(PropertyChangeSupport.java:343)
at java.desktop/java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:335)
at java.desktop/java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:268)
at org.netbeans.core.windows.RegistryImpl.doFirePropertyChange(RegistryImpl.java:304)
at org.netbeans.core.windows.RegistryImpl.access$100(RegistryImpl.java:44)
at org.netbeans.core.windows.RegistryImpl$1.run(RegistryImpl.java:145)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:773)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:720)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:714)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:136)
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)
[catch] at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It was observed, that there can be situation where DAPBreakpointActionProvider is invoked on a document without mime path in that case an assertion is hit.
Improve handling of that case by indicating, that break points are not supported in that case.