Bug 516395 - Adding source attachment to external jar doesn't work anymore
Summary: Adding source attachment to external jar doesn't work anymore
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.7   Edit
Hardware: PC Mac OS X
: P3 major (vote)
Target Milestone: 4.7 M7   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2017-05-10 03:57 EDT by Lakshmi P Shanmugam CLA
Modified: 2017-05-12 03:07 EDT (History)
6 users (show)

See Also:


Attachments
screenshot (233.47 KB, image/png)
2017-05-10 08:33 EDT, Lakshmi P Shanmugam CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lakshmi P Shanmugam CLA 2017-05-10 03:57:09 EDT
Build ID: I20170509-2000
Fails starting from Build I20170501-2000 
Works on Build I20170426-2000

Steps to Reproduce:
1. Right click on a Java Project and open Properties dialog.
2. Open the Build Path page > Libraries Tab
3. Click on Add External JARs... and add any external JAR > Apply.
4. Expand the added JAR, select source attachment, Click on Edit.
5. Add source jar > Apply
Source jar doesn't get added.
Comment 1 Andrey Loskutov CLA 2017-05-10 04:04:38 EDT
(In reply to Lakshmi Shanmugam from comment #0)
> 5. Add source jar > Apply
> Source jar doesn't get added.

Do you use external or workspace path? I can't reproduce in both cases with I20170508-2000 on Linux.
Comment 2 Noopur Gupta CLA 2017-05-10 04:12:47 EDT
Not reproducible on Windows also. Looks like a Mac specific bug.
Comment 3 Lakshmi P Shanmugam CLA 2017-05-10 04:28:55 EDT
(In reply to Andrey Loskutov from comment #1)
> (In reply to Lakshmi Shanmugam from comment #0)
> > 5. Add source jar > Apply
> > Source jar doesn't get added.
> 
> Do you use external or workspace path? I can't reproduce in both cases with
> I20170508-2000 on Linux.

It fails with external location, but works with workspace location.

To narrow down the build, I just tried with other builds. This last worked in I20170428-0830 and started failing after that.
Comment 4 Noopur Gupta CLA 2017-05-10 05:11:59 EDT
It is not reproducible in a runtime workspace on Mac. Also, launching Eclipse without launcher does not reproduce it. 

So, moving to Equinox for investigation.
Comment 5 Dani Megert CLA 2017-05-10 05:40:41 EDT
(In reply to Lakshmi Shanmugam from comment #0)
> Build ID: I20170509-2000
> Fails starting from Build I20170501-2000 
> Works on Build I20170426-2000
> 
> Steps to Reproduce:
> 1. Right click on a Java Project and open Properties dialog.
> 2. Open the Build Path page > Libraries Tab
> 3. Click on Add External JARs... and add any external JAR > Apply.
> 4. Expand the added JAR, select source attachment, Click on Edit.
> 5. Add source jar > Apply
> Source jar doesn't get added.

These steps allow tons of different scenarios. Please provide an exact test case.
Comment 6 Lakshmi P Shanmugam CLA 2017-05-10 08:33:57 EDT
Created attachment 268266 [details]
screenshot

(In reply to Dani Megert from comment #5) 
> Please provide an exact test case.

Steps to Reproduce:
1. Right click on a Java Project and open Properties dialog.
2. Open the Java Build Path page > click on Libraries Tab
3. Click on Add External JARs... > select a jar (for eg: com.ibm.icu_4.0.1.v20090822) > Click on Open.
4. Expand the added JAR > select Source Attachment > Click on Edit...
5. In the Source Attachment Configuration Dialog > Select External Location radio button > Click on External File... > Select the source jar (eg: com.ibm.icu.source_4.0.1.v20090822.jar) > Click on Open > Click on OK

Source jar doesn't get added and Source Attachment shows (None). Pls see attached screenshot.
Comment 7 Thomas Watson CLA 2017-05-10 09:00:51 EDT
(In reply to Noopur Gupta from comment #4)
> It is not reproducible in a runtime workspace on Mac. Also, launching
> Eclipse without launcher does not reproduce it. 
> 
> So, moving to Equinox for investigation.

Any ideas what in Equinox would cause issues with source attachment in JDT?  Are you thinking the recent changes to the launcher for Java 9?
Comment 8 Noopur Gupta CLA 2017-05-10 09:06:16 EDT
(In reply to Thomas Watson from comment #7)
> (In reply to Noopur Gupta from comment #4)
> > It is not reproducible in a runtime workspace on Mac. Also, launching
> > Eclipse without launcher does not reproduce it. 
> > 
> > So, moving to Equinox for investigation.
> 
> Any ideas what in Equinox would cause issues with source attachment in JDT? 
> Are you thinking the recent changes to the launcher for Java 9?

Probably http://git.eclipse.org/c/equinox/rt.equinox.framework.git/commit/?id=1b80d8422c51d02e751e11360baae404b5b27a2a. 

Arun is looking into it and can provide more details.
Comment 9 Arun Thondapu CLA 2017-05-10 10:30:07 EDT
(In reply to Noopur Gupta from comment #8)
> Probably
> http://git.eclipse.org/c/equinox/rt.equinox.framework.git/commit/?id=1b80d8422c51d02e751e11360baae404b5b27a2a.

The above commit does seem to have caused this regression.

As Lakshmi mentioned in comment 3, this was working in build I20170428-0830 and is broken since I20170429-2000. There are 3 commits in rt.equinox.framework in between these two builds, of which 2 are related to the Java 9 patches and the above commit is the third one.

To confirm, I actually reverted all my Java 9 related changes and built the binaries and tested them locally. Once I reverted my commits and tested locally, I could see that another fallout bug 516349 got fixed but this particular issue was still showing up.

Tom, is there a way to revert just https://git.eclipse.org/c/equinox/rt.equinox.framework.git/commit/?id=1b80d8422c51d02e751e11360baae404b5b27a2a and test in eclipse to double check?
Comment 10 Dani Megert CLA 2017-05-10 10:41:44 EDT
(In reply to Lakshmi Shanmugam from comment #6)
> Created attachment 268266 [details]
> screenshot
> 
> (In reply to Dani Megert from comment #5) 
> > Please provide an exact test case.
> 
> Steps to Reproduce:
> 1. Right click on a Java Project and open Properties dialog.
> 2. Open the Java Build Path page > click on Libraries Tab
> 3. Click on Add External JARs... > select a jar (for eg:
> com.ibm.icu_4.0.1.v20090822) > Click on Open.
> 4. Expand the added JAR > select Source Attachment > Click on Edit...
> 5. In the Source Attachment Configuration Dialog > Select External Location
> radio button > Click on External File... > Select the source jar (eg:
> com.ibm.icu.source_4.0.1.v20090822.jar) > Click on Open > Click on OK
> 
> Source jar doesn't get added and Source Attachment shows (None). Pls see
> attached screenshot.

I can't reproduce this using I20170509-2000 on Windows 7. I uses the ICU bundle that comes with I20170509-2000.

Is there anything in the .log?

Tom, is the mentioned change somehow depending in OS paths? I doubt that this change is the culprit, but did not look into it deeper.


> Tom, is there a way to revert just https://git.eclipse.org/c/equinox
> /rt.equinox.framework.git/commit/?id=1b80d8422c51d02e751e11360baae404b5b27a2a > and test in eclipse to double check?

Simply revert it in your workspace and then test.
Comment 11 Thomas Watson CLA 2017-05-10 14:20:50 EDT
I can reproduce on my Mac machine.  But I never even see the line of code changed by the following code get run:

http://git.eclipse.org/c/equinox/rt.equinox.framework.git/commit/?id=1b80d8422c51d02e751e11360baae404b5b27a2a

In fact the method org.eclipse.osgi.internal.resolver.StateObjectFactoryImpl.createGenericRequires(GenericSpecification[]) is never called using the steps to reproduce in a fresh workspace.

I have to move this back to JDT->UI for more debugging on that end.
Comment 12 Arun Thondapu CLA 2017-05-10 14:36:12 EDT
(In reply to Dani Megert from comment #10)
> Tom, is the mentioned change somehow depending in OS paths? I doubt that
> this change is the culprit, but did not look into it deeper.
> 
> 
> > Tom, is there a way to revert just https://git.eclipse.org/c/equinox
> > /rt.equinox.framework.git/commit/?id=1b80d8422c51d02e751e11360baae404b5b27a2a > and test in eclipse to double check?
> 
> Simply revert it in your workspace and then test.

The bug is not reproducible in a runtime eclipse launch, so that wouldn't really help to verify the revert.

However, the mentioned change does not seem to be the culprit as Dani suggested. We did a local test build with the particular commit reverted (thanks to Sravan for help!) and the bug still exists. I have no clue what is causing it though.
Comment 13 Arun Thondapu CLA 2017-05-10 14:36:28 EDT
(In reply to Dani Megert from comment #10)
> Tom, is the mentioned change somehow depending in OS paths? I doubt that
> this change is the culprit, but did not look into it deeper.
> 
> 
> > Tom, is there a way to revert just https://git.eclipse.org/c/equinox
> > /rt.equinox.framework.git/commit/?id=1b80d8422c51d02e751e11360baae404b5b27a2a > and test in eclipse to double check?
> 
> Simply revert it in your workspace and then test.

The bug is not reproducible in a runtime eclipse launch, so that wouldn't really help to verify the revert.

However, the mentioned change does not seem to be the culprit as Dani suggested. We did a local test build with the particular commit reverted (thanks to Sravan for help!) and the bug still exists. I have no clue what is causing it though.
Comment 14 Till Brychcy CLA 2017-05-11 03:45:02 EDT
Andrey Loskutov suggested this might be related to Bug 516452 (as radio buttons are involved)
Comment 15 Lakshmi P Shanmugam CLA 2017-05-12 02:23:21 EDT
The fix for Bug 516452 fixes this issue as well. Verified in Build I20170511-1200.