junichi11 commented on code in PR #6891:
URL: https://github.com/apache/netbeans/pull/6891#discussion_r1437755612
##########
php/php.dbgp/src/org/netbeans/modules/php/dbgp/breakpoints/BreakpointModel.java:
##########
@@ -179,21 +180,56 @@ private boolean foundBreakpoint(DebugSession session,
Acceptor acceptor) {
continue;
}
if (acceptor.accept(breakpoint)) {
- AbstractBreakpoint abpnt = (AbstractBreakpoint) breakpoint;
- synchronized (myCurrentBreakpoints) {
- AbstractBreakpoint bpnt =
myCurrentBreakpoints.get(session);
- myCurrentBreakpoints.put(session, abpnt);
- fireChangeEvents(new ModelEvent[]{
- new ModelEvent.NodeChanged(this, bpnt),
- new ModelEvent.NodeChanged(this, abpnt)
- });
- }
+ updateCurrentBreakpoint(session, breakpoint);
return true;
}
}
return false;
}
+ public void setCurrentBreakpoint(DebugSession session, String id) {
+ Breakpoint[] breakpoints =
DebuggerManager.getDebuggerManager().getBreakpoints();
+ for (Breakpoint breakpoint : breakpoints) {
+ if (!(breakpoint instanceof AbstractBreakpoint)) {
+ continue;
+ }
+ if (breakpoint.getValidity().equals(VALIDITY.INVALID)) {
+ continue;
+ }
+ if (!((AbstractBreakpoint) breakpoint).isSessionRelated(session)) {
+ continue;
+ }
+ if (!((AbstractBreakpoint) breakpoint).isEnabled()) {
+ continue;
+ }
+ if (((AbstractBreakpoint)
breakpoint).getBreakpointId().equals(id)) {
+ updateCurrentBreakpoint(session, breakpoint);
+ }
+ }
+ }
+
+ private void updateCurrentBreakpoint(DebugSession session, Breakpoint
breakpoint) {
+ AbstractBreakpoint abpnt = (AbstractBreakpoint) breakpoint;
+ synchronized (myCurrentBreakpoints) {
+ AbstractBreakpoint bpnt = myCurrentBreakpoints.get(session);
+ myCurrentBreakpoints.put(session, abpnt);
+ fireChangeEvents(new ModelEvent[]{
+ new ModelEvent.NodeChanged(this, bpnt),
+ new ModelEvent.NodeChanged(this, abpnt)
+ });
+ }
+ }
+
+ public void setSearchCurrentBreakpointById(Boolean flag) {
+ synchronized (this) {
+ searchCurrentBreakpointById = flag;
+ }
+ }
+
+ public Boolean isSearchCurrentBreakpointById() {
Review Comment:
I agree with Tomas. If we use `Boolean`, we have to check `null` every time.
It seems that `null` is not set. So, we can use `boolean`, I think (if I didn't
overlook anything).
--
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