Bug 4192 - Class file viewer not updated when corresponding Java file is changed (1GJXXMJ) [editor]
Summary: Class file viewer not updated when corresponding Java file is changed (1GJXXM...
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 2.0   Edit
Hardware: All Windows NT
: P3 normal (vote)
Target Milestone: 2.1 RC2   Edit
Assignee: Dani Megert CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-10-10 23:07 EDT by Dani Megert CLA
Modified: 2003-02-28 06:03 EST (History)
0 users

See Also:


Attachments
.log (7.50 KB, text/plain)
2002-08-05 05:47 EDT, Dani Megert CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dani Megert CLA 2001-10-10 23:07:35 EDT
1. Create a class Test.java
	2. Compile the class (if autobuild is off)
	3. From the Navigator open Test.class
		==> class file editor shows corresponding source
	4. Change Test.java and save it
		==> the class file viewer shows old Java source

	There are two cases here
	1) auto-build is on
		==> class file viewer should show new source
	2) auto-build is off
		==> class file viewer should be cleared and contain something like:
			"Corresponding source has changed but not compiled - the source for the class file can not be displayed"
		Once the Java file is compiled the source should be shown again



NOTES:
EG (12.09.2001 15:49:59)
	not convinced that we should show the source at all in this case. Mapping a source file for a class
	file makes sense in the binary JAR scenario but not in the generated class file scenario.
	Proposal, don't show the source for class files in the output folder.
Comment 1 Martin Aeschlimann CLA 2001-10-16 11:15:41 EDT
moved to 'active'
Comment 2 Dirk Baeumer CLA 2002-02-27 09:26:36 EST
No you get an dialog if you reactivate the class file editor telling you that 
the file has changed on disk. If you reload it you see the new source. 

Best would be if the class file editor would do this without asking since there 
is no way that a user could change the content using the editor. 

But the current implementation is consistent.
Comment 3 Dirk Baeumer CLA 2002-07-25 13:12:28 EDT
Still exists but is very unlikely in a normal usage scenario.
Comment 4 Dani Megert CLA 2002-08-05 05:45:38 EDT
Dirk, when I test it I have three cases (tested against R2.0)
1) using source folders (auto-build on or off) [ok]:
   ==> dialog says it can't be shown since it is not on the build path

2) using project as source folder and auto-build off:
   ==> nothing happens if I change the .java file however if I close the .class
file and reopen it the new content of the .java file is shown. Isn't this wrong:
the .class file is still the old one since it hasn't been built

3) using project as source folder and auto-build on:
   ==> I get an error when I say Yes to the reload dialog (see attached .log)

Giving the fact that there are errors written to the log I reopened the bug.
Comment 5 Dani Megert CLA 2002-08-05 05:47:08 EDT
Created attachment 1791 [details]
.log
Comment 6 Dani Megert CLA 2003-02-28 06:03:44 EST
Fix available in builds > N20030228