Bug 183413 - PDE can't find the source for plug-ins in the target
Summary: PDE can't find the source for plug-ins in the target
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.3 M7   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-20 12:29 EDT by Michael Valenta CLA
Modified: 2007-04-27 04:17 EDT (History)
3 users (show)

See Also:


Attachments
Proposed fix and regression test (3.75 KB, patch)
2007-04-25 09:47 EDT, Jerome Lanneluc CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Valenta CLA 2007-04-20 12:29:31 EDT
I tried to view the source for IOConsole (from org.eclipse.ui.console) but Eclipse couldn't find the source. The source plug-in appears in the Source Code Locations tab of the target platforms page so I'm not sure why the source couldn't be found. This is with build I20070418-1012.
Comment 1 Michael Valenta CLA 2007-04-20 12:31:31 EDT
I should also add that I tried to add the Source location manually to see if that would help. This resulted in the same entry appearing in the two sections of the tree. I then removed it from the bottom section (i.e. clicked on the second entry and clicked Remove) but this removed the top entry. The addition of duplicate entries should probably be prevented.
Comment 2 Wassim Melhem CLA 2007-04-20 13:35:32 EDT
I can view the source for IOConsole just fine using that build.

Is this an out-of-the-box I-20070418-1012?  The only way the source would not be found is if there is a mismatch in version number between the binary org.eclipse.ui.console and its corresponding source plug-in.
Comment 3 Michael Valenta CLA 2007-04-20 13:45:31 EDT
The binary and the source plug-in both come from the same build. I've done some playing around and I can see various Equinox/OSGi related source but I can;t see the source from org.eclipse.core.runtime, for instance. Is there any tracing I can turn on to see why that source isn't being found? I have several plug-ins loaded as source, could it be a version mismatch between a plug-in I have in my workspace and the source plug-in that is causing the problem?
Comment 4 Wassim Melhem CLA 2007-04-20 14:02:58 EDT
>Is there any tracing I can turn on to see why that source isn't being found?
No, we don't have tracing available for source attachments.

>could it be a version mismatch between a plug-in I
>have in my workspace and the source plug-in that is causing the problem?

No, because we only use source code location lookup when attaching source to JARs from the target.

Side (and unrelated) note:  With the recent versioning scheme (ie. the long qualifier in the fourth segment of the version), you are always going to have a mismatch between workspace and source plug-ins, since the workspace version has a '.qualifier' while the source plug-in has the expanded version.

Do you have anything stale in your workspace that may be causing this?  ie. some binary linked plug-in or the project that houses the 'Add to Java Search' function.  There is a problem with this project in the latest build.
Comment 5 Michael Valenta CLA 2007-04-20 14:13:45 EDT
I don't have any binary plug-ins as I just get the source from the repository when I want to load a project's source. I did have a Java Search project but I deleted it a few days ago.
Comment 6 Wassim Melhem CLA 2007-04-20 14:26:44 EDT
If you import org.eclipse.ui.console as binary project into your workspace via the plug-in import wizard, do you find source attached to it?
Comment 7 Michael Valenta CLA 2007-04-20 14:38:53 EDT
I couldn't try that project but I tried org.eclipse.core.jobs which had the same problem. The import worked (i.e. the source was included).
Comment 8 Wassim Melhem CLA 2007-04-20 14:40:08 EDT
why couldn't try that project?
Comment 9 Michael Valenta CLA 2007-04-20 14:43:45 EDT
I had already loaded the source from the repository.
Comment 10 Wassim Melhem CLA 2007-04-23 22:24:32 EDT
I was able to reproduce.  This looks like a source attachment issue, not a problem with locating the source.

This one is indeed troubling.  It happens on some JARs, but not all.  The source attachment properties of the JARs look OK on the Java Build Path property page of the project referencing the JAR.

Here is a scenario to reproduce:
1. Fresh workspace
2. Create a Hello World plug-in
3. In the Package Explorer, double-click on any class in the org.eclipse.core.runtime.xxx JAE ==> No source
4. Try any class in the org.eclipse.core.jobs.xxx JAR ==> No Source
5. Try any class in org.eclipse.ui.workbench.xxx JAR ==> You will see source

If you inspect the source attachment properties of all these JARs in the Java build path properties page, you will see that they are all there.

If you import org.eclipse.core.runtime and org.eclipse.core.jobs into your workspace via the plug-in import wizard, you will see source.  This proves that source is being correctly located by PDE.  Yet for some reason, it is not showing up.

Comment 11 Wassim Melhem CLA 2007-04-24 03:19:43 EDT
cc Dani as he may know something.
Comment 12 Dani Megert CLA 2007-04-24 03:31:34 EDT
Anything in the .log? Could it be the same old problem with incomplete class path and JDT Core giving up in the middle of getting the attached source?
Comment 13 Michael Valenta CLA 2007-04-24 08:07:34 EDT
There was nothing from JDT in the log for me.
Comment 14 Jerome Lanneluc CLA 2007-04-24 08:56:12 EDT
(In reply to comment #12)
> Could it be the same old problem with incomplete class
> path and JDT Core giving up in the middle of getting the attached source?
> 
Dani, what "same old problem" are you referring to ?
Comment 15 Dani Megert CLA 2007-04-24 09:18:52 EDT
The one where we get into trouble when the build path is not complete (bug 73957).
Comment 16 Jerome Lanneluc CLA 2007-04-24 09:30:19 EDT
(In reply to comment #15)
> The one where we get into trouble when the build path is not complete (bug
> 73957).
But bug 73957 is about incomplete classpath not about attached source. The attached source is not used during name resolution.

Comment 17 Dani Megert CLA 2007-04-24 09:36:31 EDT
I did not say it IS that issue. Not knowing all the JDT Core I just made a guess.
Comment 18 Jerome Lanneluc CLA 2007-04-24 09:43:02 EDT
(In reply to comment #17)
> I did not say it IS that issue. Not knowing all the JDT Core I just made a
> guess.
> 
I did not say YOU said it is that issue. I just confirmed that it was not that issue after I understood what "old same problem" you were talking about.
Comment 19 Jerome Lanneluc CLA 2007-04-24 10:15:35 EDT
(In reply to comment #10)
> Here is a scenario to reproduce:
> 1. Fresh workspace
> 2. Create a Hello World plug-in
> 3. In the Package Explorer, double-click on any class in the
> org.eclipse.core.runtime.xxx JAE ==> No source
> 4. Try any class in the org.eclipse.core.jobs.xxx JAR ==> No Source

This works for me. Any more details on how to reproduce ?
Comment 20 Jerome Lanneluc CLA 2007-04-24 11:59:38 EDT
I think I found the scenario. You need to:
1. create the workspace with I20070404
2. open a type in core.runtime.
3. shutdown
4. upgrade to I20070418
5. restart the workspace. 
Then you will see that no source is available for any core.runtime types.
Comment 21 Jerome Lanneluc CLA 2007-04-25 09:46:07 EDT
This is a consequence of the fix for bug 145329
Comment 22 Jerome Lanneluc CLA 2007-04-25 09:47:02 EDT
Created attachment 64865 [details]
Proposed fix and regression test
Comment 23 Dani Megert CLA 2007-04-25 10:00:59 EDT
Note that there is also unrelated bug 183958.
Comment 24 Jerome Lanneluc CLA 2007-04-26 05:08:01 EDT
Fix and test released for 3.3M7 in HEAD.
Comment 25 Eric Jodet CLA 2007-04-27 03:59:49 EDT
Verified for 3.3 M7 using build I20070427-0010