Bug 134110 - [regression] Does not pick-up interface changes from classes in the build path
Summary: [regression] Does not pick-up interface changes from classes in the build path
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.2 RC2   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-30 12:07 EST by Javier Kohen CLA
Modified: 2006-04-28 15:14 EDT (History)
0 users

See Also:


Attachments
Proposed patch and regression test (5.13 KB, patch)
2006-04-14 11:37 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 Javier Kohen CLA 2006-03-30 12:07:52 EST
While working on a Java project, sometimes I need to upgrade one of the JARs in the build path. This may bring change to some of the exposed interfaces, for instance, a new member in a class, or change of signature in an interface method.

Eclipse 3.1.2 would pick up these changes after having Eclipse re-read the JAR, either by re-compiling a class that referred it or by refreshing the file-system information in the project (the Refresh action in the context menu). Now enters the regression: Eclipse 3.2M5a does not seem to pick up these changes properly. Neither plainly re-compiling or forcing it to re-read the JAR help.

Even browsing the JAR from Eclipse does not show the newly introduced method, whereas running javap on the same JAR show the method, as expected. Not even Build Path -> Replace JAR seems to trigger an update.

Finally, restarting the workspace causes the changes to be picked up.
Comment 1 Philipe Mulet CLA 2006-03-31 07:01:14 EST
Javier - this is still supposed to work, and we do have some regression tests for this which look ok. You may have uncovered some bug, can you pls provide exact steps to reproduce ?
Comment 2 Javier Kohen CLA 2006-04-03 13:24:24 EDT
Philippe, I've found a way to reproduce this bug. See the following instructions:

$ eclipse -data wsa
New Java Project "A" with default settings
New Java Class "B" in package jkohen.
Add method "void m1()" to class B.
Export Project A to "lib.jar" JAR File with default settings.
Put this workbench aside for now.

$ eclipse -data wsb
New Java Project "B" with default settings
Add lib.jar to Project B's Build Path.
New Java Class "C" in package jkohen.impl extending class B.
Create method "f" and add an invocation to B.m1.
Put this workbench aside for now and go back to wsa.

Modify method's m1 signature to take a String.
Re-export Project A to "lib.jar" JAR File with default settings.
This workspace can be closed now.

Refresh Project A from the Package Explorer.
The call to method m1 will be marked with an error, because the caller is not pasing a String argument.
Add a String argument to m1 in order to fix the error.
Once class C is re-compiled, no more errors will be shown in the Problems view, but the error mark in the file buffer will be kept. The mark persists after closing and opening C.java again.

Note that the code seems to be compiled properly, but having the error marks around is misleading and annoying.
Comment 3 Kent Johnson CLA 2006-04-12 14:13:13 EDT
Reproduced.

This is not a build problem as the errors are correctly created/removed.

It appears to be a problem with the Reconciler's cached view of the jar file.

Jerome can you have a look at this please.
Comment 4 Jerome Lanneluc CLA 2006-04-13 17:05:24 EDT
I cannot reproduce with 3.2 RC1. (Kent reproduced it only if not refreshing project B).

2 points to clarify:
- when you say: "Refresh Project A from the Package Explorer." you meant "Refresh Project B from the Package Explorer.", right ?
- when you export lib.jar, where exactly do you export it ? inside project A ? or to another location ?

Please reopen once requested information is available.
Comment 5 Javier Kohen CLA 2006-04-13 17:25:27 EDT
(In reply to comment #4)
> I cannot reproduce with 3.2 RC1. (Kent reproduced it only if not refreshing
> project B).
> 
> 2 points to clarify:
> - when you say: "Refresh Project A from the Package Explorer." you meant
> "Refresh Project B from the Package Explorer.", right ?

Yes, I believe you are right.

> - when you export lib.jar, where exactly do you export it ? inside project A ?
> or to another location ?

To another location such as /tmp/lib.jar. When added to Project B's classpath, it should be added as an external JAR, and not imported into the project.
Comment 6 Jerome Lanneluc CLA 2006-04-14 10:50:31 EDT
Thanks for the clarification. I was able to reproduce and I'm investigating.
Comment 7 Jerome Lanneluc CLA 2006-04-14 11:37:28 EDT
Created attachment 38599 [details]
Proposed patch and regression test
Comment 8 Philipe Mulet CLA 2006-04-14 11:41:30 EDT
+1 for 3.2RC2
Comment 9 Jerome Lanneluc CLA 2006-04-14 11:51:29 EDT
Released fix and regression test
Comment 10 Olivier Thomann CLA 2006-04-28 15:14:43 EDT
Verified with I20060427-1600 for 3.2RC2.
Could not reproduce original problem, but open bug 139279.