Index: debuggerjpda/ant/src/org/netbeans/modules/debugger/projects/ContextProviderImpl.java =================================================================== RCS file: /cvs/debuggerjpda/ant/src/org/netbeans/modules/debugger/projects/ContextProviderImpl.java,v retrieving revision 1.10 diff -u -r1.10 ContextProviderImpl.java --- debuggerjpda/ant/src/org/netbeans/modules/debugger/projects/ContextProviderImpl.java 18 May 2004 10:45:31 -0000 1.10 +++ debuggerjpda/ant/src/org/netbeans/modules/debugger/projects/ContextProviderImpl.java 19 May 2004 23:26:50 -0000 @@ -42,7 +42,6 @@ import java.net.URL; import java.net.MalformedURLException; -import java.util.List; import javax.swing.text.Document; import javax.swing.text.StyledDocument; import org.openide.filesystems.FileStateInvalidException; @@ -127,14 +126,7 @@ LineCookie lineCookie = getCurrentLineCookie (); Line.Set lineSet = lineCookie.getLineSet (); try { - //ln = 2 * ln - lineSet.getOriginal (ln).getLineNumber (); - List l = lineSet.getLines (); - int i, k = l.size (); - for (i = 0; i < k; i++) { - if (((Line) l.get (i)).getLineNumber () >= ln) { - return i + 1; - } - } + ln = 2 * ln - lineSet.getOriginal (ln).getLineNumber (); return ln + 1; } catch (IndexOutOfBoundsException ex) { ex.printStackTrace (); @@ -237,16 +229,16 @@ */ public String getSelectedMethodName () { EditorCookie e = getCurrentEditorCookie (); - if (e == null) return ""; + if (e == null) return null; JEditorPane ep = getCurrentEditor (); - if (ep == null) return ""; + if (ep == null) return null; StyledDocument doc = e.getDocument (); int offset = ep.getCaret ().getDot (); String t = null; // if ( (ep.getSelectionStart () <= offset) && // (offset <= ep.getSelectionEnd ()) // ) t = ep.getSelectedText (); -// if (t != null) return t; +// if (t != null) return t; int line = NbDocument.findLineNumber ( doc, @@ -261,7 +253,7 @@ org.openide.text.NbDocument.findLineRootElement (doc). getElement (line); - if (lineElem == null) return ""; + if (lineElem == null) return null; int lineStartOffset = lineElem.getStartOffset (); int lineLen = lineElem.getEndOffset () - lineStartOffset; // t contains current line in editor @@ -281,13 +273,14 @@ identEnd++; } int i = t.indexOf ('(', identEnd); - if (i < 0) return ""; - if (t.substring (identEnd, i).trim ().length () > 0) return ""; + if (i < 0) return null; + if (t.substring (identEnd, i).trim ().length () > 0) return null; - if (identStart == identEnd) return ""; + if (identStart == identEnd) return null; +System.out.println("suc: " + t.substring (identStart, identEnd)); return t.substring (identStart, identEnd); } catch (javax.swing.text.BadLocationException ex) { - return ""; + return null; } }