Index: test/unit/src/org/netbeans/api/debugger/jpda/JspLineBreakpointTest.java =================================================================== RCS file: /cvs/debuggerjpda/test/unit/src/org/netbeans/api/debugger/jpda/JspLineBreakpointTest.java,v retrieving revision 1.5 diff -u -r1.5 JspLineBreakpointTest.java --- test/unit/src/org/netbeans/api/debugger/jpda/JspLineBreakpointTest.java 30 Jun 2006 19:05:00 -0000 1.5 +++ test/unit/src/org/netbeans/api/debugger/jpda/JspLineBreakpointTest.java 22 Aug 2006 15:17:41 -0000 @@ -49,7 +49,7 @@ private static final String SOURCE_NAME = "included.jsp"; private static final String SOURCE_PATH_FIRST = "d/" + SOURCE_NAME; private static final String SOURCE_PATH_SECOND = SOURCE_NAME; - private static final String URL = "org.netbeans.api.debugger.jpda.testapps.*"; + private static final String CLASS_NAME = "org.netbeans.api.debugger.jpda.testapps.*"; private static final int LINE_NUMBER = 2; private static final String STRATUM = "JSP"; @@ -87,10 +87,12 @@ //install SDE extension to class file runSDEInstaller(testAppCLAZ, testAppSMAP); + String URL = getClass().getResource("testapps/resources/included.jsp").toString(); LineBreakpoint lb = LineBreakpoint.create(URL, LINE_NUMBER); lb.setStratum(STRATUM); // NOI18N lb.setSourceName(SOURCE_NAME); lb.setSourcePath(SOURCE_PATH_SECOND); + lb.setPreferedClassName(CLASS_NAME); DebuggerManager dm = DebuggerManager.getDebuggerManager (); dm.addBreakpoint (lb); @@ -131,10 +133,12 @@ //install SDE extension to class file runSDEInstaller(testAppCLAZ, testAppSMAP); + String URL = getClass().getResource("testapps/resources/included.jsp").toString(); LineBreakpoint lb = LineBreakpoint.create(URL, LINE_NUMBER); lb.setStratum(STRATUM); // NOI18N lb.setSourceName(SOURCE_NAME); lb.setSourcePath(SOURCE_PATH_SECOND); + lb.setPreferedClassName(CLASS_NAME); DebuggerManager dm = DebuggerManager.getDebuggerManager (); dm.addBreakpoint (lb); Index: src/org/netbeans/modules/debugger/jpda/breakpoints/LineBreakpointImpl.java =================================================================== RCS file: /cvs/debuggerjpda/src/org/netbeans/modules/debugger/jpda/breakpoints/LineBreakpointImpl.java,v retrieving revision 1.30 diff -u -r1.30 LineBreakpointImpl.java --- src/org/netbeans/modules/debugger/jpda/breakpoints/LineBreakpointImpl.java 14 Aug 2006 14:27:23 -0000 1.30 +++ src/org/netbeans/modules/debugger/jpda/breakpoints/LineBreakpointImpl.java 22 Aug 2006 15:17:41 -0000 @@ -90,14 +90,17 @@ protected void setRequests () { lineNumber = breakpoint.getLineNumber (); - String className = reader.findCachedClassName(breakpoint); + String className = breakpoint.getPreferedClassName(); if (className == null) { - className = EditorContextBridge.getClassName ( - breakpoint.getURL (), - lineNumber - ); - if (className != null) { - reader.storeCachedClassName(breakpoint, className); + className = reader.findCachedClassName(breakpoint); + if (className == null) { + className = EditorContextBridge.getClassName ( + breakpoint.getURL (), + lineNumber + ); + if (className != null) { + reader.storeCachedClassName(breakpoint, className); + } } } if (className == null) { Index: api/src/org/netbeans/api/debugger/jpda/LineBreakpoint.java =================================================================== RCS file: /cvs/debuggerjpda/api/src/org/netbeans/api/debugger/jpda/LineBreakpoint.java,v retrieving revision 1.15 diff -u -r1.15 LineBreakpoint.java --- api/src/org/netbeans/api/debugger/jpda/LineBreakpoint.java 30 Jun 2006 19:04:47 -0000 1.15 +++ api/src/org/netbeans/api/debugger/jpda/LineBreakpoint.java 22 Aug 2006 15:17:41 -0000 @@ -48,13 +48,16 @@ public static final String PROP_SOURCE_PATH = "sourcePath"; // NOI18N /** Property name constant. */ public static final String PROP_STRATUM = "stratum"; // NOI18N + /** Property name constant. */ + public static final String PROP_PREFERED_CLASS_NAME = "classNamePrefered"; // NOI18N - private String url = ""; + private String url = ""; // NOI18N private int lineNumber; private String condition = ""; // NOI18N - private String sourceName = null; // NOI18N - private String sourcePath = null; // NOI18N + private String sourceName = null; + private String sourcePath = null; private String stratum = "Java"; // NOI18N + private String className = null; private LineBreakpoint () { @@ -246,6 +249,35 @@ sourcePath = sp; } firePropertyChange (PROP_SOURCE_PATH, old, sp); + } + + /** + * Sets the binary class name that is used to submit the breakpoint. + * @param className The binary class name, or null if the class + * name should be retrieved automatically from the URL and line number. + * @since 2.8 + */ + public void setPreferedClassName(String className) { + String old; + synchronized (this) { + if (this.className == className || (className != null && className.equals(this.className))) { + return ; + } + old = className; + this.className = className; + } + firePropertyChange (PROP_PREFERED_CLASS_NAME, old, className); + } + + /** + * Gets the binary class name that is used to submit the breakpoint. + * @return The binary class name, if previously set by {@link setPreferedClassName} + * method, or null if the class name should be retrieved + * automatically from the URL and line number. + * @since 2.8 + */ + public String getPreferedClassName() { + return className; } /** Index: api/manifest.mf =================================================================== RCS file: /cvs/debuggerjpda/api/manifest.mf,v retrieving revision 1.18 diff -u -r1.18 manifest.mf --- api/manifest.mf 21 Jul 2006 10:14:31 -0000 1.18 +++ api/manifest.mf 22 Aug 2006 15:17:41 -0000 @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.api.debugger.jpda/2 OpenIDE-Module-Localizing-Bundle: org/netbeans/api/debugger/jpda/Bundle.properties -OpenIDE-Module-Specification-Version: 2.7 +OpenIDE-Module-Specification-Version: 2.8 OpenIDE-Module-Package-Dependencies: com.sun.jdi[VirtualMachineManager] Index: api/apichanges.xml =================================================================== RCS file: /cvs/debuggerjpda/api/apichanges.xml,v retrieving revision 1.15 diff -u -r1.15 apichanges.xml --- api/apichanges.xml 21 Jul 2006 10:14:31 -0000 1.15 +++ api/apichanges.xml 22 Aug 2006 15:17:41 -0000 @@ -406,6 +406,22 @@ + + + Added setPreferedClassName and getPreferedClassName methods to LineBreakpoint + + + + + +

+ In order to be able to provide the class name for which the + breakpoint should be submitted. This is necessary for JSP. +

+
+ + +