This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | [DEBUGGER] Unable to set breakpoint in java if ruby debugger session is running | ||
---|---|---|---|
Product: | ruby | Reporter: | Tomas Danek <musilt2> |
Component: | Code | Assignee: | Martin Krauskopf <mkrauskopf> |
Status: | VERIFIED FIXED | ||
Severity: | blocker | CC: | mentlicher |
Priority: | P3 | ||
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: |
Description
Tomas Danek
2007-03-29 16:51:51 UTC
Might be that Java debugger is checking whether the active session is Java debugger session. When you switch back to the Java session you can set breakpoints in Java files. Actually I'm not sure what behavior is better. But it's probably by design in Java debugger? Ruby debugger allow you to set breakpoints only in Ruby source. Reassigning for evaluation. Probably to be closed? Feel free to reassign back if you think it is oddity in the Ruby debugger. Thanks. This is not by design, it should work. E.g. you can add Java breakpoints while ANT debugger session is running and vice-versa. I'll check what can be wrong... It's a bug of the ruby debugger. Specifically org.netbeans.modules.ruby.debugger.breakpoints.RubyBreakpointActionProvider returns isEnabed() true even when a Java file is selected. Therefore we call doAction() on it. But it does nothing. This is why the breakpoint is not added in Java files. It should return isEnabled() false when it can not submit the breakpoint. Thanks for the help Martine. Martine, what is the right way to fix this. Obviously I would override ActionsProviderSupport.isEnabled(Object action). But I've took a look into AntBreakpointActionProvider for an inspiration and it uses quite unintuitive approach. Listening on TopComponents: TopComponent.getRegistry().addPropertyChangeListener( WeakListeners.propertyChange(this, TopComponent.getRegistry())); and then doing enable/disable work in propertyChange(). Strange "Debugger API". I know, probably you just inherited it ;) But anyway, what is the right way. I would go rather overriding the isEnabled() But there might be some reason why I should not (performance?)? I know that this looks strange. This approach is necessary if the action is e.g. in a toolbar or in some other visible place and should actively enable/disable it's state. The query for isEnabled() is fast then. But if you do not need the enable/disable events, you can just overrid isEnabled(). In this case it should be sufficient. I would like to review the JPDA and ANT debugger actions at some point and adjust the behavior so that it would not clutter the IDE with too many listeners. Went with the Ant debugger way. RubyBreakpointActionProvider.java; new revision: 1.6; previous revision: 1.5 Reassigning this issue to newly created 'ruby' component. Changing target milestone of all resolved Ruby issues from TBD to 6.0 Beta 1 build. verified in 20070914 |