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 202242 - C++ support have lost hyperlink navigation to the exact position and only file is opened
Summary: C++ support have lost hyperlink navigation to the exact position and only fil...
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Window System (show other bugs)
Version: 7.1
Hardware: All All
: P2 normal (vote)
Assignee: Jaroslav Tulach
URL:
Keywords: REGRESSION
Depends on: 200966
Blocks:
  Show dependency tree
 
Reported: 2011-09-16 15:41 UTC by Vladimir Voskresensky
Modified: 2011-09-30 14:40 UTC (History)
7 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Patch for CsmUtilities (3.63 KB, patch)
2011-09-19 13:23 UTC, Miloslav Metelka
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Voskresensky 2011-09-16 15:41:24 UTC
In the IDE environment NbDocument.findRecentEditorPane(ec) is always null if asked from EditorCookie.Observable.PROP_OPENED_PANES listener.
As a consequence C++ support have lost hyperlink navigation to the exact position and only file is opened.

To reproduce:
create C++ Quote sample project
open ONLY cpu.cc file from Source Files
try to ctrl+click on Module identifier on line 36
=> module.cc file is opened, but not on line 46

To debug:
put breakpoint in
cnd.modelutil/src/org/netbeans/modules/cnd/modelutil/CsmUtilities.java
private static boolean openAtElement(final DataObject dob, final PointOrOffsetable element)
and inner PropertyChangeListenerImpl.propertyChange
Comment 1 Miloslav Metelka 2011-09-16 17:17:24 UTC
Jardo just in case you'd have a time could you please look at it? Otherwise I'll take a look.
Vladimir don't you know when the problem started?
Comment 2 Vladimir Voskresensky 2011-09-16 18:17:44 UTC
Mila, I think if revert 
http://hg.netbeans.org/jet-main/rev/108b9b214479
then the second event will have non null pane as it was before.
Comment 3 Vladimir Voskresensky 2011-09-16 18:23:18 UTC
At least I know for sure that a day before http://hg.netbeans.org/jet-main/rev/108b9b214479
events were correct
Comment 4 Miloslav Metelka 2011-09-19 13:23:26 UTC
Hi Vladimir,
 IMO the code in CsmUtilities is rather threading sensitive and so it's likely that it may fail (although I still don't see why my EditorRegistry patch causes failure like this since in fact it only does an extra putClientProperty() at pane opening time).
 Anyway I suggest to replace the code in CsmUtilities.openAtElement() with the attached patch which appears to work reliably and should be more threading stable.
Comment 5 Miloslav Metelka 2011-09-19 13:23:59 UTC
Created attachment 110872 [details]
Patch for CsmUtilities
Comment 6 Vladimir Voskresensky 2011-09-19 14:07:53 UTC
Hi Mila,
May be I´m wrong with changeset, but If you have a look at your test 
CloneableEditorCreationFinishedTest.testEditorPaneFinished
then you can see that
support.getRef ().getAnyComponent ();
previously was CloneableEditor, but now it is TopComponent
and I think recent pane is not set yet at time of sending PROP_OPENED_PANES
Comment 7 Vladimir Voskresensky 2011-09-19 14:14:31 UTC
Btw, if you have a look at our implementation of PROP_OPENED_PANES listener then it is the same as you have in your test testEditorPaneFinished where on the second event ed.isEditorPaneReady() have to be TRUE while now it behaves like it is false causing findRecentEditorPane to return null
Btw, previously CloneableOpenSupport.allEditors was a reference to CloneableEditors now, it´s a reference to MultiViewCloneableTopComponent instead of MultiViewCloneableEditor which I would expect
Comment 8 Vladimir Voskresensky 2011-09-19 14:27:39 UTC
Mila, Unfortunately I can not apply proposed patch, because it changes async open to sync openDocument.
But more important is that PROP_OPENED_PANES event currently become incorrect, because client does not have access to editor panes at all.
If client will try to use getOpenPanes method from change listener => he will get problem described in issue #199820

Jarda, can you help with the current changes CloneableEditor->MultiViewCloneableTopComponent (instead of MultiViewCloneableEditor)?
Comment 9 Vladimir Voskresensky 2011-09-19 14:29:43 UTC
(In reply to comment #6)
> support.getRef ().getAnyComponent ();
> previously was CloneableEditor, but now it is TopComponent
MultiViewCloneableTopComponent (instead of MultiViewCloneableEditor?)
Comment 10 Miloslav Metelka 2011-09-20 12:47:55 UTC
Hi Vladimir, I have made a test build with my
http://hg.netbeans.org/jet-main/rev/108b9b214479
rolled back and it has no influence on the problem.

Since this is likely about changes in multi-view reassigning to platform/WS.
Comment 11 Vladimir Voskresensky 2011-09-20 13:01:51 UTC
Hi Mila,
Probably I was wrong with exact changeset which caused the problem, but at day when I was fixing issue #199820 (2011-09-09 10:07) events were correct and same as in 7.0.1 code base
Comment 12 Vladimir Voskresensky 2011-09-20 13:41:18 UTC
I'm sorry, but this regression breaks a lot of our tests, so it is no go for Beta. 
What I can help with - I will use bisect to find problematic commit. Then I expect your help in fixing introduced regression.
Comment 13 Vladimir Voskresensky 2011-09-20 16:06:25 UTC
What I've got so far:
#hg bisect -g
The first bad revision is:
changeset:   201592:e85bbfccf799
parent:      201590:7edef4591f69
parent:      201591:b31edd9ddcb9
user:        Jesse Glick <jglick@netbeans.org>
date:        Fri Sep 09 13:47:56 2011 -0400
summary:     merge backout

Not all ancestors of this changeset have been checked.
To check the other ancestors, start from the common ancestor, 5906c9488e61.
Comment 14 Vladimir Voskresensky 2011-09-20 16:37:13 UTC
updating to parent 1
hg up -r 7edef4591f69
=> IDE works

updating to parent 2
hg up -r b31edd9ddcb9
=> IDE works

hg up -r e85bbfccf799
=> broken IDE
Comment 15 Jesse Glick 2011-09-20 17:34:08 UTC
I am not involved with this code at all. I merely backed out jtulach's 5906c9488e61 as a convenience since he was not at work.
Comment 16 Jaroslav Tulach 2011-09-21 12:49:12 UTC
Workaround exists. Return back to the original editor and click on the element once again. Then the caret will be possition correctly. Making P2.
Comment 17 Vladimir Voskresensky 2011-09-21 14:02:06 UTC
Jarda, as I said - it breaks all QA hyperlink tests. And we consider it as Beta stopper.
Comment 18 Vladimir Voskresensky 2011-09-22 11:19:29 UTC
I have tried proposed patch.

Shift from async EditorCookie.open (using event to track when pane was opened) to sync EditorCookie.openDocument is be problem of proposed patch.
As result we don't have hyperlinks into any file which is opened with UserQuestionException => impossible to jump into big files. impossible to jump into non utf-8 files.
Comment 19 Vladimir Voskresensky 2011-09-22 12:34:44 UTC
hack to workaround problem
http://hg.netbeans.org/cnd-main/rev/33a70aed4c1c
Comment 20 Miloslav Metelka 2011-09-22 15:02:56 UTC
Transplanted into release71_beta:
33a70aed4c1c transplanted to e3893e193f15
Comment 21 Marian Mirilovic 2011-09-23 05:14:23 UTC
So, what is the status of this issue ? Is it fixed ?
Comment 22 Vladimir Voskresensky 2011-09-23 09:44:07 UTC
(In reply to comment #21)
> So, what is the status of this issue ? 
Regression in platform
> Is it fixed ?
No, but I was pushed to add hack on our side with promise to have fix in Platform in FCS
Comment 23 Jaroslav Tulach 2011-09-23 10:47:56 UTC
ergonomics#bb3c22be8a00

> (In reply to comment #21)
> > So, what is the status of this issue ? 
> Regression in platform

Do you mean regression against 7.0.x version? I am sure there is no regression. The MultiViewCloneableEditor class was not even present in 7.0.x version!

In 7.0.x cnd was not using core.multiview at all. During 7.1 you changed your code to use core.multiview. Should there be subtle changes in the behavior, please attribute them to your "switch".
Comment 24 Vladimir Voskresensky 2011-09-23 11:03:57 UTC
(In reply to comment #23)
> ergonomics#bb3c22be8a00
> 
> > (In reply to comment #21)
> > > So, what is the status of this issue ? 
> > Regression in platform
> 
> Do you mean regression against 7.0.x version? 
I meant regression against 7.0.1 and regression against trunk 
in both cases on the second fire editor pane was ready and non-null. 
Currently it was regressed to always have null.

hg up -r e85bbfccf799
=> broken IDE

updating to parent 1
hg up -r 7edef4591f69
=> IDE works

updating to parent 2
hg up -r b31edd9ddcb9
=> IDE works
Comment 25 Vladimir Voskresensky 2011-09-23 11:07:33 UTC
Yarda, if you can write test same as CloneableEditorCreationFinishedTest.testEditorPaneFinished

but with used multi-view it would allow us to prevent such regression in future
Comment 26 Quality Engineering 2011-09-23 13:22:51 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/33a70aed4c1c
User: Vladimir Voskresensky <vv159170@netbeans.org>
Log: workaround for #202242  -  C++ support have lost hyperlink navigation to the exact position and only file is opened
Comment 27 Jaroslav Tulach 2011-09-23 13:33:17 UTC
(In reply to comment #24)
> > Do you mean regression against 7.0.x version? 
> I meant regression against 7.0.1 

None of the following change sets comes from 7.0.1: e85bbfccf799, 7edef4591f69, b31edd9ddcb9. This is not regression against 7.0.x.

Test is nice idea: 133dd50e8c25
Comment 28 Vladimir Voskresensky 2011-09-23 13:49:52 UTC
(In reply to comment #27)
> (In reply to comment #24)
> > > Do you mean regression against 7.0.x version? 
> > I meant regression against 7.0.1 
> 
> None of the following change sets comes from 7.0.1: e85bbfccf799, 7edef4591f69,
> b31edd9ddcb9. This is not regression against 7.0.x.
Or, sorry, now I see. CloneableEditorCreationFinishedTest.testEditorPaneFinished
is used as safe guard that there is no regression against 7.0.x

> 
> Test is nice idea: 133dd50e8c25
Thanks!
Vladimir.
Comment 29 Vladimir Voskresensky 2011-09-26 09:37:34 UTC
fix http://hg.netbeans.org/cnd-main/rev/bb3c22be8a00
re-introduces issue #201823
Comment 30 David Strupl 2011-09-26 14:01:30 UTC
After Mila's workaround in C++ code this is at most P2, if not P3.
Comment 31 Antonin Nebuzelsky 2011-09-26 14:12:02 UTC
> fix http://hg.netbeans.org/cnd-main/rev/bb3c22be8a00
> re-introduces issue #201823

applies only to trunk, not to Beta (where the workaround fixed this issue without the side-effect of reintroducing #201823)
Comment 32 Jaroslav Tulach 2011-09-28 13:00:17 UTC
ergonomics#e8647c17eecc
Comment 33 Quality Engineering 2011-09-30 14:40:25 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/133dd50e8c25
User: Jaroslav Tulach <jtulach@netbeans.org>
Log: Per Vladimir's request using the CloneableEditorCreationFinishedTest to test the multiview editor impl for #202242. Works now, Fails on release71_beta_base.