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.
Implementing a new RunIntoMethod action in JPDA debugger we need to do several JDI steps with no UI interference. For this purpose we created a new class org.netbeans.api.debugger.jpda.JPDAStep and add a new method JPDADebugger.createJPDAStep(int size, int depth) which is overridden in JPDADebuggerImpl to return new JPDAStepImpl instance. Typical usage is: JPDAStep step = debugger.createJPDAStep(JPDAStep.STEP_LINE, JPDAStep.STEP_INTO); step.addPropertyChangeListener(JPDAStep.PROP_STATE_EXEC, new PropertyChangeListener() { .... } PROP_STATE_EXEC is fired when the step is executed. Then it is possible to ask for an other step (via step.addStep(debugger.getCurrentThread())) with no UI interference. If no other step is needed it is possible to view the debugger counter on the current possition (via step.setHidden(false) ).
Created attachment 22936 [details] Code, manifest and apichanges diff
1. if the JPDAStep is not supposed to be subclassed by anyone else than jpda impl, you may want to add if (!getClass().getName().equals("jpdaimpl....")) throw an exception. Also add note to javadoc, if people shall not subclass this. 2. throwing UnsupportedException is pretty poor way to tell that something is not supported. In fact it requires the method to be called, exception caught and the continuing. It would be nicer to have isJPDAStep supported method. Might simplify the usages of the API 3. Please write a test to show the expected calls to the API and also your implementation successfully passes the expectations.
Thanks for comments. I am going to commit these changes (test will be incl.).
commit: Checking in ide/golden/deps.txt; /cvs/ide/golden/deps.txt,v <-- deps.txt new revision: 1.113; previous revision: 1.112 done Checking in debuggerjpda/api/apichanges.xml; /cvs/debuggerjpda/api/apichanges.xml,v <-- apichanges.xml new revision: 1.9; previous revision: 1.8 done Checking in debuggerjpda/api/manifest.mf; /cvs/debuggerjpda/api/manifest.mf,v <-- manifest.mf new revision: 1.10; previous revision: 1.9 done Checking in debuggerjpda/src/org/netbeans/modules/debugger/jpda/JPDADebuggerImpl.java; /cvs/debuggerjpda/src/org/netbeans/modules/debugger/jpda/JPDADebuggerImpl.java,v <-- JPDADebuggerImpl.java new revision: 1.78; previous revision: 1.77 done RCS file: /cvs/debuggerjpda/src/org/netbeans/modules/debugger/jpda/JPDAStepImpl.java,v done Checking in debuggerjpda/src/org/netbeans/modules/debugger/jpda/JPDAStepImpl.java; /cvs/debuggerjpda/src/org/netbeans/modules/debugger/jpda/JPDAStepImpl.java,v <-- JPDAStepImpl.java initial revision: 1.1 done Checking in debuggerjpda/api/src/org/netbeans/api/debugger/jpda/JPDADebugger.java; /cvs/debuggerjpda/api/src/org/netbeans/api/debugger/jpda/JPDADebugger.java,v <-- JPDADebugger.java new revision: 1.16; previous revision: 1.15 done RCS file: /cvs/debuggerjpda/api/src/org/netbeans/api/debugger/jpda/JPDAStep.java,v done Checking in debuggerjpda/api/src/org/netbeans/api/debugger/jpda/JPDAStep.java; /cvs/debuggerjpda/api/src/org/netbeans/api/debugger/jpda/JPDAStep.java,v <-- JPDAStep.java initial revision: 1.1 done RCS file: /cvs/debuggerjpda/test/unit/src/org/netbeans/api/debugger/jpda/JPDAStepTest.java,v done Checking in debuggerjpda/test/unit/src/org/netbeans/api/debugger/jpda/JPDAStepTest.java; /cvs/debuggerjpda/test/unit/src/org/netbeans/api/debugger/jpda/JPDAStepTest.java,v <-- JPDAStepTest.java initial revision: 1.1 done Checking in debuggerjpda/ui/src/org/netbeans/modules/debugger/jpda/ui/actions/Bundle.properties; /cvs/debuggerjpda/ui/src/org/netbeans/modules/debugger/jpda/ui/actions/Bundle.properties,v <-- Bundle.properties new revision: 1.7; previous revision: 1.6 done Checking in debuggerjpda/ui/src/org/netbeans/modules/debugger/jpda/ui/actions/RunIntoMethodActionProvider.java; /cvs/debuggerjpda/ui/src/org/netbeans/modules/debugger/jpda/ui/actions/RunIntoMethodActionProvider.java,v <-- RunIntoMethodActionProvider.java new revision: 1.10; previous revision: 1.9 done Checking in debuggerjpda/ui/src/org/netbeans/modules/debugger/jpda/resources/mf-layer.xml; /cvs/debuggerjpda/ui/src/org/netbeans/modules/debugger/jpda/resources/mf-layer.xml,v <-- mf-layer.xml new revision: 1.25; previous revision: 1.24 done Checking in debuggerjpda/nbproject/project.xml; /cvs/debuggerjpda/nbproject/project.xml,v <-- project.xml new revision: 1.12; previous revision: 1.11 done
Fixed.
Verified ... and Closing all issues resolved into NetBeans 6.7 and earlier.