Bug 16091

Summary: Need way to refresh JAR files
Product: [Eclipse Project] JDT Reporter: Peter Burka <peter_burka>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: eclipse, erich_gamma, paulacox
Version: 2.0   
Target Milestone: 2.0 F2   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Peter Burka CLA 2002-05-15 18:18:15 EDT
Build M5

If an external JAR file changes, those changes are not reflected in the 
Packages view.

I exported two classes into a jar, and added that jar to my class path (using 
a variable). I examined the contents of the jar in the Packages view to verify 
that it did, indeed, contain those two classes.

I then overwrote the jar with another jar which contained a different class. I 
could not find any way to get the Packages view to update the contents of the 
jar. I Refreshed the Project, Rebuilt the project, collapsed and expanded the 
jar, all to no effect.

The only way that I could refresh it was to exit and restart.

This is a real problem, because I receive updates of external jars once or 
twice a day from another team using a different VCM system. Everytime they 
send me changes I need to shutdown Eclipse to have the changes reflected in 
the UI and in tools like Content Assist.
Comment 1 Erich Gamma CLA 2002-05-16 04:03:33 EDT
I don't see how this can be done transparently. So I'd suggest a manual 
solution. UI offers an action on a JARs to "refresh contents". This would 
require support from core to flush the corresponding element info from the JAR 
cache.

Moving to JDT CORE for comment.
Comment 2 Philipe Mulet CLA 2002-05-16 11:34:12 EDT
A manual solution would be to close the offending JAR pkg root using 
IOpenable#close(), then refresh UI for it.

Alternatively when building, we can detect this situation and cause a change 
notification in the next post-change event. This doesn't prevent from 
introducing a manual refresh.
Comment 3 Erich Gamma CLA 2002-05-16 11:47:25 EDT
Detecting the change on rebuild ensures that the users builds against an up to 
date JAR. This is good enough to me. 
Comment 4 Erich Gamma CLA 2002-05-16 19:32:27 EDT
*** Bug 11572 has been marked as a duplicate of this bug. ***
Comment 5 Philipe Mulet CLA 2002-05-21 11:13:38 EDT
Fixed, added IJavaModel#refreshExternalJARs
Comment 6 Philipe Mulet CLA 2002-06-03 07:08:35 EDT
Refresh action works fine
Comment 7 Philipe Mulet CLA 2002-06-03 07:08:46 EDT
Verified