Bug 326994 - Classes deleted in output folder not noticed after refresh giving CNF at runtime
Summary: Classes deleted in output folder not noticed after refresh giving CNF at runtime
Status: VERIFIED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.5   Edit
Hardware: Macintosh Mac OS X - Carbon (unsup.)
: P3 major (vote)
Target Milestone: 3.7 M3   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-05 06:51 EDT by Timothy Mowlem CLA
Modified: 2010-10-26 09:30 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Timothy Mowlem CLA 2010-10-05 06:51:08 EDT
Build Identifier: 3.7.0 Build id: I20100921-1024

When I delete class files and/or directories from inside the output directory (as defined in project properties under Java Build Path->Source Tab->Default Output Folder) using the Finder then i get ClassNotFoundExceptions on running the application.

I have Project->Build Automatically checked.
I right click on the project under the Navigator and choose Refresh after deleting the files before launching the application.

The refresh combined with build automatically should see the change and autobuild the missing classes but it does not. Sometimes even restarting Eclipse, repeated use of F5, etc make no difference. Changing the project properties does seem to force a rebuild but I should not have to play these games, Eclipse should realise after a refresh is applied.

Reproducible: Always

Steps to Reproduce:
1. Ensure Project->Build Automatically is checked
2. Delete class files from the classpath via the OS
3. Refresh project in navigator
4. Run the app via a run configuration
5. Get a ClassNotFoundException
Comment 1 Jay Arthanareeswaran CLA 2010-10-05 07:08:57 EDT
This might be a duplicate of bug 325414. You could confirm this by trying refresh from Package Explorer view and see if it's working.
Comment 2 Olivier Thomann CLA 2010-10-05 08:44:56 EDT
If the project is built and you remove the .class files from the output folder, then it is expected to fail.
"Project->Build Automatically" is used only to make sure that the project is built before you run.
The builder doesn't check that the .class files for all types in the project exist before starting a build. This would be too slow. The builder has a state for each project and if no changes have been done to the project, there is nothing to build.
Why do you want to remove .class files from the output folder once the project is built ?
Comment 3 Timothy Mowlem CLA 2010-10-05 08:59:51 EDT
(In reply to comment #2)
> If the project is built and you remove the .class files from the output folder,
> then it is expected to fail.
> "Project->Build Automatically" is used only to make sure that the project is
> built before you run.
> The builder doesn't check that the .class files for all types in the project
> exist before starting a build. This would be too slow. The builder has a state
> for each project and if no changes have been done to the project, there is
> nothing to build.
> Why do you want to remove .class files from the output folder once the project
> is built ?

Hello Olivier,

Client uses multiple small projects and we import the source of those packages as a source dir. I wanted to edit one and get it to rebuild but sometimes the changes are not picked up. So I deleted the class files hoping that that would force a rebuild. I am obviously labouring under a mis-apprehension.

Sometimes Eclipse is slow to notice changes in different parts of the UI. Occasionally it stubbornly refuses to notice changes even after multiple Refreshes or even restarting the app.
Comment 4 Olivier Thomann CLA 2010-10-05 09:06:02 EDT
(In reply to comment #3)
> Client uses multiple small projects and we import the source of those packages
> as a source dir. I wanted to edit one and get it to rebuild but sometimes the
> changes are not picked up. So I deleted the class files hoping that that would
> force a rebuild. I am obviously labouring under a mis-apprehension.
How do you do the import ? Are you using the import feature or you directly unzip from the OS?
Did you try to refresh the project ?

If you want to force a rebuild, use the clean/rebuild mechanism. This will force a rebuild of the whole project.

As you entered this bug report, I will close it as INVALID as there is no way we want to support the case where .class files are removed after the project is built.
Comment 5 Olivier Thomann CLA 2010-10-15 10:28:25 EDT
Closing as INVALID.
Please reopen if you find a case where this happens without cleaning the output directory.
Comment 6 Ayushman Jain CLA 2010-10-26 09:30:15 EDT
Verified for 3.7M3