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 175016 - Can not set breakpoint in "other" window
Summary: Can not set breakpoint in "other" window
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Text (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: mslama
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-20 15:23 UTC by err
Modified: 2009-11-03 10:18 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description err 2009-10-20 15:23:39 UTC
There are two editor modes, each has a view of the JUinit test under debug. Did a run and sitting at a breakpoint, can
only set breakpoint by clicking in the gutter in one of the views.

    Not able to submit breakpoint LineBreakpoint InGeneralTest.java : -1, reason: The breakpoint is set outside of any
class.
    Invalid LineBreakpoint InGeneralTest.java : -1

and in the log

    WARNING [org.netbeans.modules.debugger.jpda.breakpoints]: Class name not defined for breakpoint LineBreakpoint
InGeneralTest.java : -1

These messages only show up once. Repeated attempts to set a breakpoint produce no output (or breakpoint). Going to the
other window can set/clear breakpoints at will.

Closed the view that was doing breakpoints OK, and then could do breakpoints in the other view. Cloned that view and the
clone was unable to set breakpoints.

There are no exceptions in the log, there is the following occasionally

    WARNING [org.netbeans.modules.parsing.impl.TaskProcessor]: ParserManager.parse called in AWT event thread by:
org.netbeans.modules.debugger.jpda.projects.EditorContextImpl.getClassName(EditorContextImpl.java:1102)

Note there have been around 6 upates download in last two days.

Product Version: NetBeans IDE Dev (Build 200910160201)
Java: 1.6.0_12; Java HotSpot(TM) Client VM 11.2-b01
System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb)
Userdir: C:\Documents and Settings\erra\.netbeans\dev
Comment 1 err 2009-10-20 15:24:20 UTC
Changing subcomponent from UI to code.
Comment 2 Vojtech Sigler 2009-10-20 17:34:13 UTC
Product Version: NetBeans IDE 6.8 Beta (Build 200910171337)
Java: 1.6.0_16; Java HotSpot(TM) 64-Bit Server VM 14.2-b01
System: Linux version 2.6.31-14-generic running on amd64; UTF-8; en_US (nb)

Hmm, I am not able to reproduce the warning in the log, but if I clone a document I cannot add breakpoints in it by
clicking into the gutter and the "toggle breakpoint" in popup menu is disabled. The only way that works is by invoking
Debug-> New breakpoint, but it takes the line number where the cursor last was in the original document no matter where
you are in the cloned document. However at a few occasions using this method crashed the IDE
(http://www.netbeans.org/issues/show_bug.cgi?id=175036).
Comment 3 Vojtech Sigler 2009-10-20 17:41:25 UTC
Ok, now I got also the following warnings in the log:

WARNING: No enclosing class for /home/sigi/NetBeansProjects/MemoryView/src/examples/advanced/MemoryView.java, offset = 587
WARNING [org.netbeans.modules.debugger.jpda.breakpoints]: Class name not defined for breakpoint LineBreakpoint
MemoryView.java : 19
Comment 4 Martin Entlicher 2009-10-21 15:46:37 UTC
I do not get the warning in the log, but can reproduce this issue.
It seems to be a regression, I guess it worked several weeks ago...
Comment 5 Martin Entlicher 2009-10-21 16:03:06 UTC
Looks like a defect of NbDocument.findRecentEditorPane() again! It returns null for the cloned document. Investigating...
Comment 6 Martin Entlicher 2009-10-21 16:28:10 UTC
Works fine after this change:

diff -r c97ee7f5d8da openide.text/src/org/openide/text/CloneableEditorSupport.java
--- a/openide.text/src/org/openide/text/CloneableEditorSupport.java     Wed Oct 21 16:42:39 2009 +0200
+++ b/openide.text/src/org/openide/text/CloneableEditorSupport.java     Wed Oct 21 17:26:53 2009 +0200
@@ -1154,7 +1154,9 @@
                         p = ed.getEditorPane();
                     }
                 }
-                return p;
+                if (p != null) {
+                    return p;
+                }
             } else {
                 throw new IllegalStateException("No reference to Pane. Please file a bug against openide/text");
             }


Please evaluate if this is the right way to fix it.
Comment 7 mslama 2009-11-02 11:26:20 UTC
Martin how to reproduce this? Is it enough just to clone editor with Java source? Or is it more specific?
Comment 8 mslama 2009-11-02 11:46:21 UTC
I can reproduce on cloned editor. I am investigating what happens and if patch is correct. Thanks.
Comment 9 mslama 2009-11-02 14:22:44 UTC
Patch was correct. I also added test.

core-main #84dc47b76100
Comment 10 Martin Entlicher 2009-11-02 17:26:40 UTC
Thanks. Yes, I've reproduced it just by cloning the editor document.
Comment 11 Quality Engineering 2009-11-03 10:18:57 UTC
Integrated into 'main-golden', will be available in build *200911030222* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/84dc47b76100
User: Marek Slama <mslama@netbeans.org>
Log: #175016: Fix CloneableEditorSupport.getRecentPane for cloned editors.