Bug 277120 - [CommonNavigator] Project explorer does not reveal elements when linked to editor
Summary: [CommonNavigator] Project explorer does not reveal elements when linked to ed...
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.4.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.5.1   Edit
Assignee: Dani Megert CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 267986 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-05-20 08:06 EDT by Krzysztof Daniel CLA
Modified: 2009-08-27 06:13 EDT (History)
8 users (show)

See Also:
francisu: review+


Attachments
Fix (4.65 KB, patch)
2009-06-11 08:08 EDT, Dani Megert CLA
no flags Details | Diff
Fix for 3.4.2 (3.33 KB, patch)
2009-06-11 09:43 EDT, Dani Megert CLA
no flags Details | Diff
TestFix 3.4.x (105.40 KB, application/java-archive)
2009-07-03 06:35 EDT, Krzysztof Daniel CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Krzysztof Daniel CLA 2009-05-20 08:06:12 EDT
1. Create working set and make it top element in the project explorer
2. Link Project Explorer with Editor
3. Create Java projects A, B, where A depends on B, and add them to working set
4. Create interface in B, and a class implementing that interface in A. Close editors, collaps B project.
5. Open the class, select the interface and press F3. Project B is not expanded.
Comment 1 Krzysztof Daniel CLA 2009-05-20 08:07:08 EDT
This has been fixed in 3.5RC7, but the fix has to be backported to 3.4.2.

Comment 2 Francis Upton IV CLA 2009-05-20 09:55:44 EDT
(In reply to comment #1)
> This has been fixed in 3.5RC7, but the fix has to be backported to 3.4.2.
> 

As far as I know there are no further releases in the 3.4 line, so there is really nothing that can be done about this.  Please reopen if I'm wrong.
Comment 3 Krzysztof Daniel CLA 2009-05-20 10:13:32 EDT
You are right. But adopters still use that branch, and they can build on their own (look f.e. at http://www.eclipse.org/jdt/core/r3.2/index.php#UPDATES).

I do understand that you may not work on this, just give me some clues and will figure out sooner or later how to fix this :-)

Comment 4 Francis Upton IV CLA 2009-05-20 15:06:48 EDT
(In reply to comment #3)
> You are right. But adopters still use that branch, and they can build on their
> own (look f.e. at http://www.eclipse.org/jdt/core/r3.2/index.php#UPDATES).
> 
> I do understand that you may not work on this, just give me some clues and will
> figure out sooner or later how to fix this :-)
> 

I remember this problem and just spent the last 20 mins or so looking through the fixed bug reports and can't seem to find it.  This actually might have been a JDT UI configuration problem (with the CNF) now that I think about it.  If you look at the history of plugin.xml in the JDT UI for maybe 3.5M5-M7 you might see a change in the CNF configuration that I think might have been the thing that fixed this.  I looked through the JDT UI bugs though and also could not find it.  I'm sorry I can't be more helpful, but that's all I can remember for the moment.  Let me know if this does not work out and perhaps I can do some more digging.

If you find the bug, please dup this against it.
Comment 5 Boris Bokowski CLA 2009-05-20 16:03:18 EDT
Moving to Common Navigator so that you can continue the conversation there ;-)
Comment 6 Anton Leherbauer CLA 2009-05-22 04:12:44 EDT
(In reply to comment #4)
> If you find the bug, please dup this against it.

Looks like bug 215729.
Note that this bug has probably been fixed by the fix for bug 275847.
Comment 7 Krzysztof Daniel CLA 2009-05-22 07:57:29 EDT
The bug is quite similar, but 3.4.2 stream already contains patch attached to 275847. The issue was fixed somewhere in 3.5M7
Comment 8 Francis Upton IV CLA 2009-05-22 10:44:56 EDT
> Looks like bug 215729.
> Note that this bug has probably been fixed by the fix for bug 275847.
This is exactly the bug I was thinking about when I made the above comments.  I'm not sure both patches are the same (if they are it would surprise me that bug 215729 is still open).  

Dani, do you know anything about this?
Comment 9 Dani Megert CLA 2009-05-25 06:15:24 EDT
>The bug is quite similar, but 3.4.2 stream already contains patch attached to
>275847. The issue was fixed somewhere in 3.5M7
No it does not.


*** This bug has been marked as a duplicate of bug 275847 ***
Comment 10 Dani Megert CLA 2009-05-25 06:17:43 EDT
>>The bug is quite similar, but 3.4.2 stream already contains patch attached to
>>275847. The issue was fixed somewhere in 3.5M7
>No it does not.
To clarify in case it is not clear: 3.4.2 or R3_4_maintenance does not contain that fix.
Comment 11 Dani Megert CLA 2009-05-25 06:18:06 EDT

*** This bug has been marked as a duplicate of bug 275847 ***
Comment 12 Krzysztof Daniel CLA 2009-05-25 08:32:18 EDT
Right, the patch was not there. So I have applied the patch to 3_4_maintenance, tested a little bit more carefully, and even with that patch I am able to reproduce the issue. 

It looks like CN is not able to look into the JavaProject to show any element that was not shown before. So as long as your projects are not expanded when Eclipse starts, link with editor will not work. 
Comment 13 Dani Megert CLA 2009-05-25 08:46:02 EDT
Obviously some cases (see bug 275847 comment 2) are fixed. Can you provide step-by-step test case(s) where it does not work? Also, are those really fixed in  3.5RC7?
Comment 14 Krzysztof Daniel CLA 2009-05-26 07:02:03 EDT
So far reproduction steps from bug description are still valid.

I know you are quite busy with RCs you may not find time to play with 3.4.2. I have enough input to try to solve this on myself :-). If I'll stuck or need help,  I'll ping you.
Comment 15 Krzysztof Daniel CLA 2009-05-29 08:05:59 EDT
Project Explorer ignores "link editor" as long as target project remains collapsed.
If the project is expanded (it shows the src folder), files will be revealed correctly. If the files were previously visible, everything works correctly.

I have found that NavigatorContentServiceContentProvider#getParents returned different paths according to whether the src folder is visible (Java Project is expanded) or not.

(I) Java Project Expanded
R/ | P/JavaP2 | src [in JavaP2]
  <default> (...)
  com (...)
  com.ibm (...) | com.ibm [in src [in JavaP2]]
  [Working copy] IFoo.java
    package com.ibm
    interface IFoo
---------
R/ | P/JavaP2 | src [in JavaP2]
  <default> (...)
  com (...)
  com.ibm (...)

(II) Java Project Collapsed

---------
R/ | P/JavaP2 | src [in JavaP2]
  <default> (...)
  com (...)
  com.ibm (...) | com.ibm [in src [in JavaP2]]
  [Working copy] IFoo.java
    package com.ibm
    interface IFoo | 
---------
R/ | P/JavaP2 | src [in JavaP2]
  <default> (...)
  com (...)
  com.ibm (...) | 
---------
R/ | P/JavaP2 | 
---------
R/ | 
---------
(empty path)

Assuming that R/ means workspace root, are those paths correct? I mean Root/Project/CU while Navigator displays something like Root/WorkingSet/Project/CU?
Comment 16 Dani Megert CLA 2009-05-29 08:29:10 EDT
Francis, can you answer this?
Comment 17 Francis Upton IV CLA 2009-06-02 02:03:03 EDT
(In reply to comment #16)
> Francis, can you answer this?
> 

Yes, give me a couple more days, I'm pretty busy right now.
Comment 18 Krzysztof Daniel CLA 2009-06-09 11:44:02 EDT
Reopening (see comments 12 & 15), because some work still needs to be done here.
Comment 19 Dani Megert CLA 2009-06-11 06:16:39 EDT
>So far reproduction steps from bug description are still valid.
Not really, because the key is that the project must have never been expanded before. I can reproduce if I restart after step 4.
Comment 20 Dani Megert CLA 2009-06-11 08:04:13 EDT
The bug is that in case of Java working sets, the Project Explorer renders Java projects instead of resource projects which it does in all other cases. This of courses causes troubles because the JavaNavigatorContentProvider returns an IProject when asked for the parent of a (Java) project's child.

If we put the Java projects into a resource working set then it works just fine.
Comment 21 Dani Megert CLA 2009-06-11 08:08:11 EDT
Created attachment 138920 [details]
Fix
Comment 22 Dani Megert CLA 2009-06-11 08:10:04 EDT
Francis, can you please double-check my findings and review my patch.
Comment 23 Dani Megert CLA 2009-06-11 09:43:43 EDT
Created attachment 138927 [details]
Fix for 3.4.2
Comment 24 Dani Megert CLA 2009-06-11 09:44:19 EDT
Krzysztof, can you verify that this fixes your issue?
Comment 25 Krzysztof Daniel CLA 2009-06-15 05:16:48 EDT
Patches solve the issue. Thanks Dani.
Comment 26 Dani Megert CLA 2009-06-18 07:53:49 EDT
*** Bug 267986 has been marked as a duplicate of this bug. ***
Comment 27 Francis Upton IV CLA 2009-06-18 10:00:03 EDT
Thanks Dani for working on this, I will review it next week.  I"m still swamped with my day job this week.  And nice that it fixes the CVS hostname issue as well.
Comment 28 Francis Upton IV CLA 2009-06-25 02:21:04 EDT
Looks good Dani, thanks for doing this.  Unless you object, I will go ahead and check release this to HEAD and 3.5.1 (I think 3.5.1 is open for us now).
Comment 29 Dani Megert CLA 2009-06-25 04:26:20 EDT
Don't worry, given the bug is assigned to me I'll take care of this.
Comment 30 Francis Upton IV CLA 2009-06-25 04:28:23 EDT
That's great, then you will do my version bumping for me as well?
Comment 31 Dani Megert CLA 2009-06-25 04:29:30 EDT
Yep.
Comment 32 Dani Megert CLA 2009-06-25 04:40:59 EDT
Fixed in HEAD for 3.6 and updated the bundle version and filed bug 281462 to look into the required bundle versions: I doubt it will ever compile or run with those.
Comment 33 Dani Megert CLA 2009-06-25 07:30:31 EDT
Fixed in R3_5_maintenance.
Comment 34 Krzysztof Daniel CLA 2009-07-03 06:35:56 EDT
Created attachment 140764 [details]
TestFix 3.4.x
Comment 35 Dani Megert CLA 2009-08-27 06:13:43 EDT
Verified in I20090826-1100.