Bug 129082

Summary: [regression] Refresh->Run action deletes all files in 'bin' directory and recompiles all classes
Product: [Eclipse Project] JDT Reporter: Navid Mehregani <nmehrega>
Component: CoreAssignee: Kent Johnson <kent_johnson>
Status: CLOSED FIXED QA Contact:
Severity: blocker    
Priority: P3 CC: amehrega, philippe_mulet
Version: 3.2Keywords: api
Target Milestone: 3.2 M6   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Navid Mehregani CLA 2006-02-22 18:25:56 EST
This bug is a regression in the M5 driver.  This behaviour is not observed in the M4 driver or any of the previous releases of Eclipse.

To reproduce, follow the instructions below:

- In the M5 driver, create a new Java project
- Create a source folder in the project
- Create a simple "Hello World" class in the source folder
- Switch to the 'Navigator' view and create a few different files in the *bin*  
  directory of your project.  Create the files by right clicking on the bin 
  directory -> new -> file.  Call them "hello1" and "hello2".
- Open the .class file generated by Eclipse in an editor and make a 
  modification in it (e.g. on the last line of the file, enter an extra space 
  and save it)
- Switch back to Eclipse -> right click on your project -> click on Refresh
- Run your Java class
- Notice that "hello1" and "hello2" have been deleted from the 'bin' directory
  of your project.
- The .class file is also recompiled.  This happens even if the "build 
  automatically" option is turned off

Note that sometimes the files are deleted and the class file is recompiled as soon as the user does a refresh.

This bug is breaking the probekit tool in TPTP, which modifies the .class files and creates a backup version of the classes in the bin directory by using the class name followed by ".bak"
Comment 1 Philipe Mulet CLA 2006-02-22 18:52:47 EST
Consequence of fix for bug 99497
Comment 2 Kent Johnson CLA 2006-03-28 14:18:48 EST
We've added an option to control when output folders will be searched during
incremental builds. Until JDT/UI adds support for it (see bug 133668), you can enable the option by setting:

org.eclipse.jdt.core.builder.makeOutputFolderConsistent=enabled

in the jdt.core.prefs of your .settings folder.

By default the option will be disabled and the builder's behaviour will be the same as it was before we released the changes for bug 99497
Comment 3 Philipe Mulet CLA 2006-03-28 14:25:02 EST
This API addition (pref) already got approved before EclipseCon by PMC.
Comment 4 Kent Johnson CLA 2006-03-28 14:55:24 EST
Renamed the option to:

org.eclipse.jdt.core.builder.recreateModifiedClassFileInOutputFolder=enabled
Comment 5 Frederic Fusier CLA 2006-03-29 05:56:19 EST
Verified for 3.2 M6 using build I20060329-0010.
Comment 6 Navid Mehregani CLA 2006-04-04 14:42:20 EDT
Verified on the M6 driver. Closing.