diff --git a/groovy/groovy.debug/src/org/netbeans/modules/groovy/debug/GroovyBreakpointAnnotationListener.java b/groovy/groovy.debug/src/org/netbeans/modules/groovy/debug/GroovyBreakpointAnnotationListener.java index d6c70601dd86..d413e9e9bc28 100644 --- a/groovy/groovy.debug/src/org/netbeans/modules/groovy/debug/GroovyBreakpointAnnotationListener.java +++ b/groovy/groovy.debug/src/org/netbeans/modules/groovy/debug/GroovyBreakpointAnnotationListener.java @@ -42,7 +42,7 @@ @DebuggerServiceRegistration(types=LazyDebuggerManagerListener.class) public class GroovyBreakpointAnnotationListener extends DebuggerManagerAdapter { - private HashMap breakpointToAnnotation = new HashMap<>(); + private final HashMap breakpointToAnnotation = new HashMap<>(); private boolean listen = true; @Override @@ -71,16 +71,22 @@ public void propertyChange (PropertyChangeEvent e) { @Override public void breakpointAdded (Breakpoint b) { if (b instanceof LineBreakpoint) { - ((LineBreakpoint) b).addPropertyChangeListener (this); - annotate ((LineBreakpoint) b); + LineBreakpoint lb = (LineBreakpoint) b; + if (GroovyBreakpointStratifier.GROOVY_STRATUM.equals(lb.getStratum())) { + lb.addPropertyChangeListener (this); + annotate(lb); + } } } @Override public void breakpointRemoved (Breakpoint b) { if (b instanceof LineBreakpoint) { - ((LineBreakpoint) b).removePropertyChangeListener (this); - removeAnnotation ((LineBreakpoint) b); + LineBreakpoint lb = (LineBreakpoint) b; + if (GroovyBreakpointStratifier.GROOVY_STRATUM.equals(lb.getStratum())) { + lb.removePropertyChangeListener (this); + removeAnnotation(lb); + } } } diff --git a/groovy/groovy.debug/src/org/netbeans/modules/groovy/debug/GroovyBreakpointStratifier.java b/groovy/groovy.debug/src/org/netbeans/modules/groovy/debug/GroovyBreakpointStratifier.java index f73b0a8110a5..232693ec5932 100644 --- a/groovy/groovy.debug/src/org/netbeans/modules/groovy/debug/GroovyBreakpointStratifier.java +++ b/groovy/groovy.debug/src/org/netbeans/modules/groovy/debug/GroovyBreakpointStratifier.java @@ -52,6 +52,7 @@ @ServiceProvider(service = BreakpointStratifier.class) public final class GroovyBreakpointStratifier implements BreakpointStratifier { + public final static String GROOVY_STRATUM = "Groovy"; //NOI18N private static final Logger LOGGER = Logger.getLogger(GroovyBreakpointStratifier.class.getName()); public GroovyBreakpointStratifier() { @@ -78,7 +79,7 @@ public void stratify(JPDABreakpoint breakpoint) { String printText = pt.replace("{groovyName}", (groovyName != null) ? groovyName : "?"); // NOI18N String groovyPath = getGroovyPath(url, fo); - lb.setStratum("Groovy"); // NOI18N + lb.setStratum(GROOVY_STRATUM); lb.setSourceName(groovyName); lb.setSourcePath(groovyPath); lb.setPreferredClassName(findGroovyClassName(groovyPath, fo, lineNumber)); diff --git a/java/debugger.jpda.truffle/src/org/netbeans/modules/debugger/jpda/truffle/actions/ToggleBreakpointsInLanguagesActionProvider.java b/java/debugger.jpda.truffle/src/org/netbeans/modules/debugger/jpda/truffle/actions/ToggleBreakpointsInLanguagesActionProvider.java index f01c7287966b..6994cd5ff424 100644 --- a/java/debugger.jpda.truffle/src/org/netbeans/modules/debugger/jpda/truffle/actions/ToggleBreakpointsInLanguagesActionProvider.java +++ b/java/debugger.jpda.truffle/src/org/netbeans/modules/debugger/jpda/truffle/actions/ToggleBreakpointsInLanguagesActionProvider.java @@ -47,7 +47,7 @@ public class ToggleBreakpointsInLanguagesActionProvider extends ActionsProviderS private static final Set IGNORED_MIME_TYPES = new HashSet<>( // We have JSLineBreakpoint in JavaScript - Arrays.asList("text/javascript", "text/x-java")); // NOI18N + Arrays.asList("text/javascript", "text/x-java", "text/x-groovy")); // NOI18N private volatile Line postedLine;