Bug 226733 - Change to .classpath causes jar file to appear outside of "Referenced libraries"
Summary: Change to .classpath causes jar file to appear outside of "Referenced libraries"
Status: VERIFIED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4 M7   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-11 13:59 EDT by Brian Young CLA
Modified: 2008-04-29 05:53 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Brian Young CLA 2008-04-11 13:59:33 EDT
Build ID:  I20080330-1350

Steps To Reproduce:
- Start Eclipse on Windows with a new workspace
- Create a Java project called TestProject
- In Windows file explorer copy a jar file into TestProject folder.  Let us call the jar file testLib.jar
- Right mouse click TestProject in the Package Explorer and select Build Path > Configure Build Path
- Under the Libraries tab press "Add external jars..." and select testLib.jar and save
- Note that testLib.jar gets added in the Package Explorer under "Reference Libraries" area
- In Windows file explorer change the name of testLib.jar to be testLib-2.jar
- Using Windows notepad, edit the .classpath file and change the reference to testLib.jar to be testLib-2.jar and save
- In the Package Explorer press F5 to refresh and testLib-2.jar now appears outside of the "Reference Libraries" area as well as inside
- Changing things back to testLib.jar does not change the fact that testLib.jar appears outside of "Reference Libraries".

More information:
I get similar behavior in Eclipse 3.2.2 as well.
Comment 1 Jerome Lanneluc CLA 2008-04-15 11:14:16 EDT
I cannot reproduce using I20080410-1022. Following thoroughly your steps, when I press F5, testLib-2.jar is removed from the Referenced Libraries.
Do you have more details?
Comment 2 Jerome Lanneluc CLA 2008-04-16 09:28:09 EDT
In fact I missed one of the steps. I can reproduce now. But the behavior you're seeing is expected. Since the jar is added as an external jar, it is not filtered out from the project itself. This is why it appears both inside and outside the Referenced Libraries.

Instead of using Add External JAR, you should use Add JAR instead. To do so, after adding testLib.jar using Windows file explorer, you should either select the project in Eclipse and press Refresh (F5), or - better - enable Preferences > General > Workspace > Refresh automatically.

Closing as this works as designed.
Comment 3 Maxime Daniel CLA 2008-04-29 05:53:03 EDT
Agreed. Would the third step of the original test case be followed by F5, the jar file would appear immediately, which is consistent with the remainder of the story.

Verified for 3.4 M7.