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.

Bug 50110

Summary: Need to add one method to fix one bug!
Product: debugger Reporter: Jan Jancura <jjancura>
Component: JavaAssignee: apireviews <apireviews>
Status: VERIFIED FIXED    
Severity: blocker Keywords: API_REVIEW_FAST
Priority: P2    
Version: 4.x   
Hardware: PC   
OS: Windows ME/2000   
Issue Type: DEFECT Exception Reporter:

Description Jan Jancura 2004-10-07 16:38:13 UTC
method to be added:
org.netbeans.spi.debugger.jpda.EditorContext.getClassName
(URL, lineNumber)

bug to be fixed: 49031 - Breakpoints in
'secondary' classes are never reached

In order to fix breakpoints in secondary classes I
need to distinguish class for given url&line number.
Comment 1 Jaroslav Tulach 2004-10-08 07:33:23 UTC
I am missing diff, test, api changes entry. Take that as request.
Comment 2 Jan Jancura 2004-10-08 08:28:48 UTC
Diff:
cvs diff -r 1.4 -r 1.5 EditorContext.java (in directory
C:\Hanz\Dev\trunk\debuggerjpda\api\src\org\netbeans\spi\debugger\jpda\)
Index: EditorContext.java
===================================================================
RCS file:
/cvs/debuggerjpda/api/src/org/netbeans/spi/debugger/jpda/EditorContext.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -r1.4 -r1.5
178a179,191
>      * Returns class name for given url and line number or null.
>      *
>      * @param url a url
>      * @param lineNumber a line number
>      *
>      * @return class name for given url and line number or null
>      */
>     public abstract String getClassName (
>         String url, 
>         int lineNumber
>     );
>     
>     /**
cvs diff -r 1.14 -r 1.15 LineBreakpointImpl.java (in directory
C:\Hanz\Dev\trunk\debuggerjpda\src\org\netbeans\modules\debugger\jpda\breakpoints\)
Index: LineBreakpointImpl.java
===================================================================
RCS file:
/cvs/debuggerjpda/src/org/netbeans/modules/debugger/jpda/breakpoints/LineBreakpointImpl.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -r1.14 -r1.15
33a34
> import org.netbeans.modules.debugger.jpda.EditorContextBridge;
52c53
<     private SourcePath          engineContext;
---
>     private SourcePath          sourcePath;
59c60
<         SourcePath engineContext
---
>         SourcePath sourcePath
63c64
<         this.engineContext = engineContext;
---
>         this.sourcePath = sourcePath;
76c77
<         String className = engineContext.getRelativePath (
---
>         String className = EditorContextBridge.getClassName (
78c79
<             '.', false
---
>             lineNumber
92a94,103
>             
>             //HACK
>             // annonymous innerclasses are generated to outerclass
>             // class.inner.annonym -> class$1
>             // thats why we should not add class filter for class.inner,
>             // but for class!
>             int i = className.indexOf ('$');
>             if (i > 0) 
>                 className = className.substring (0, i);
> 

I will update api changes today.
Test is not redy yet.
Comment 3 Jan Jancura 2004-10-29 14:30:23 UTC
I have not found a way how to write regular Unit test for this stuff. 
EditorContext & SourcePathProvider implements bridge to Java module,
src hierarchy, and projects modules. I have not find a way how to
setup environment for all these modules, how to open project there and
setup source hierarchy. Thats why I have created separate issue to
track this problem, and I will work with this teams to fix it - 50969.

Comment 4 Jiri Kovalsky 2006-08-01 13:24:21 UTC
Closing this issue then.