Bug 174833 - Changed Jars on Java Build Path Libraries tab are not recognized fully
Summary: Changed Jars on Java Build Path Libraries tab are not recognized fully
Status: VERIFIED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.3 M7   Edit
Assignee: Maxime Daniel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-20 13:58 EST by C. Lamont Gilbert CLA
Modified: 2007-04-27 21:05 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 C. Lamont Gilbert CLA 2007-02-20 13:58:11 EST
I have a project that adds a jar file to its Libraries tab which adds the jar to the build path.  When I recompile this jar elsewhere, and copying it overtop the file being referenced by the project, the path is not properly updated.  Nothing I can do will get this path to update short of removing and readding the jar in the libraries page.

Some things are recognized, but some things are not.  That is, some aspects of the change of the jar are noticed.  I think maybe the code completions are not, and some other thigns because I get red dots that I can not get rid of.  Refresh does not fix it.  I will try to be more specific when I change my library again.
Comment 1 Maxime Daniel CLA 2007-02-21 00:48:02 EST
Could you please:
- be more specific about the problems you get;
- single out one scenario that leads to those problems.
Another thing of interest is the nature of the changes in a) the jar file b) your workspace (no change?).
Comment 2 C. Lamont Gilbert CLA 2007-02-22 13:43:50 EST
I knew I needed to provide more info.  I just wanted to enter it before I started digging in case it was a dupe.   So here we go...

This happens on plugin projects.  It does not happen on standard Java projects.

1.  Have a plugin project that has a jar file on its libraries tab.
2.  Go to the creator of that jar file's project, and add a new method to one of its classes.
3.  Export the jar file ontop of the one in the plugin project's libraries tab.
4.  Attempt to refence the new method, or simply open the jar listed in the package explorer and notice the new method is not listed.

Again, this does not happen on a standard java project.  The new method is instantly available.  on a plugin project it does not appear until the jar file is removed as a library and readded.
Comment 3 Kent Johnson CLA 2007-03-12 16:18:54 EDT
Did you try to 'refresh' the project or the jar file explicitly ?
Comment 4 C. Lamont Gilbert CLA 2007-03-12 17:57:29 EDT
yes.
Comment 5 Maxime Daniel CLA 2007-03-27 11:01:43 EDT
I could reproduce a behavior that looks like what is described here with M20060921-0945, provided that I leave autobuild off.
What is your setting for Project/Build Automatically?
Comment 6 C. Lamont Gilbert CLA 2007-03-27 17:05:12 EDT
Sometimes I use autobuild, sometimes I do not.  Mostly it is on though.  And it would have been on during these incidents.  Note that even a manual build will not fix this.  Only a remove and readd of the jar to the project.
Comment 7 Maxime Daniel CLA 2007-03-28 05:13:18 EDT
Reproduced:
- build M20060921-0945, autobuild off;
- created Java project P1, separated src and bin dir;
- created class p.Main in P1 with method public void foo(); saved and built;
- created plugin project P2 with activator and Java project, no template;
- exported P1 as p1.jar at the root of P2;
- edited P2/META-INF/MANIFEST.MF;
- navigated to Runtime tab; added p1.jar to the Classpath entries;
- saved everything and built;
- opened P2/p2/Activator.java; placed the cursor into the constructor; typed new p.Main().f and hit Ctrl-Space; got foo() proposed; accepted, saved, built;
- added method bar() into Main; saved and built; exported P1 over P2/p1.jar;
- placed the cursor behind p.Main(). in the activator constructor and hit Ctrl-Space, no bar proposed;
- refreshed P2, pressed the build button;
- placed the cursor behind p.Main(). in the activator constructor and hit Ctrl-Space again, no bar proposed.
Deploying p1.jar node under P2 only shows one method (foo) and one constructor (the default one) within Main.class.
Comment 8 Maxime Daniel CLA 2007-03-28 05:14:55 EDT
Restarting Eclipse makes bar show up in the class.
Comment 9 C. Lamont Gilbert CLA 2007-03-28 08:09:49 EDT
Interesting.  Ill have to see if its more convenient a workaround to restart eclipse or remove/add the jar file.

Could you not reproduce this with autobuild on?
Comment 10 Maxime Daniel CLA 2007-03-28 08:31:09 EDT
Not tried yet. Will see what 3.2.2 and 3.3 M6 do first.
Comment 11 Maxime Daniel CLA 2007-03-28 09:01:09 EDT
3.2.2 (build M20070212-1330) and 3.3 (build I20070323-1616) behave OK on the test case above.

I hence searched for a dup. Bug 162621 has a lots of duplicates, some of which having the very same symptoms as this one.

Closing as duplicate.

*** This bug has been marked as a duplicate of bug 162621 ***
Comment 12 C. Lamont Gilbert CLA 2007-03-28 09:55:02 EDT
This is not a duplicate.  It could turn out to be related, but that has not been determined yet.

Bug 162621
 Autobuild off
 Java project

Bug 174833
 Autobuild on
 Plugin project

Not the same.  Bug 174833 does not even occur on Java projects.  The test case you created is designed to reproduce bug 162621.  It does not follow the guidelines I laid out for this bug which is 'autobuild on' and 'plugin project.'
Comment 13 Kent Johnson CLA 2007-03-28 12:22:27 EDT
Bug 162621 is a JavaModel cache issue which affects code assist, etc. It does not affect the Java builder/compiler.

Please be more specific about the problems you are seeing.

Do the red X's have corresponding problems in the Problems view or do the problems just appear in the editor margin?

Does code assist show the newly added methods?
Comment 14 C. Lamont Gilbert CLA 2007-03-28 14:40:47 EDT
code assist does not show the new or changed method.  Opening the jar in the project view will not list the new method.
Comment 15 C. Lamont Gilbert CLA 2007-03-28 14:43:22 EDT
IIRC, it was more of a code assist issue than a build issue.  They certainly both could be fixed by that patch. When that is available I will be happy to test.
Comment 16 Kent Johnson CLA 2007-03-28 15:00:38 EDT
3.2.2 has been available for a couple months. You can download 3.2.2 or the latest 3.3M6 build right now and try it.

So you're not experiencing any build/compile problems?

You can compile a reference to a newly added method & run the code, but it appears missing in the editor?

If so then your problem is likely fixed by bug 162621
Comment 17 C. Lamont Gilbert CLA 2007-03-28 15:04:20 EDT
downloading.  When I looked at the list of bugs fixed in 3.2.2 I did not see any that I thought woudld impact me.  I guess I miseed that one.
Comment 18 Maxime Daniel CLA 2007-03-29 01:01:14 EDT
(In reply to comment #12)
> This is not a duplicate.
I believe it is, because the symptoms look very much the same as other bugs that have been declared as duplicates of 162621.
>  It could turn out to be related, but that has not
> been determined yet.
> 
> Bug 162621
>  Autobuild off
>  Java project
> 
> Bug 174833
>  Autobuild on
>  Plugin project
> 
> Not the same.  Bug 174833 does not even occur on Java projects.  The test case
> you created is designed to reproduce bug 162621.
In earnest, no. I created a test case to attempt to reproduce this bug. I reproduced it on 3.2.1, then I tested on 3.2.2 and 3.3, which both worked, hence I digged into bugzilla to find out which (set of) bug(s) could have motivated the fix.
However, if you prefer so and unless you find out that 3.2.2 still causes you grief in the same manner, I'll close this as WORKSFORME.
Comment 19 C. Lamont Gilbert CLA 2007-03-29 07:50:36 EDT
I understand what you attempted to do.  But look at what you actually did.  You created a scenario that perfectly matches how to reproduce bug 162621.  What you created violates the the reproduction I gave for this bug in 2 ways.  You know thats not fair.  I consider these very different in the sense that I was not able to get my bug to occur on Java projects, and that other bug specifically occurs on Java projects.

Anyway, I will test this by Monday and if its fixed in 3.2.2 I will close it as a duplicate if that is fine with everyone.  If not I will state my results here.
Comment 20 Kent Johnson CLA 2007-04-13 15:07:39 EDT
So what did you find?
Comment 21 Maxime Daniel CLA 2007-04-17 04:38:57 EDT
Adding needinfo keyword. Please note that we cannot proceed without further input. 
Comment 22 C. Lamont Gilbert CLA 2007-04-17 08:26:55 EDT
Yes of course.  I am still here.  Just busy.  Will test ASAP.
Comment 23 Maxime Daniel CLA 2007-04-17 08:41:25 EDT
Great, thx.
Comment 24 C. Lamont Gilbert CLA 2007-04-18 09:32:34 EDT
After retesting I realized that my plugin project references two jars

hibServerCore-5.1-0.jar
hibServerCoreSrc-5.1-0.jar

With the source in the 2nd jar.  I was updating the first jar, but not the 2nd jar.  This caused the code assist feature to not see the method.  The method does show when the jar file is expanded under the project that is importing it.  I recall that not happening before.  I am probably missing something, but in any event I do think the source of this was my mistake.
Comment 25 Maxime Daniel CLA 2007-04-18 10:05:53 EDT
Thanks for the update.
Comment 26 Olivier Thomann CLA 2007-04-27 21:05:32 EDT
Verified for 3.3M7.