Bug 200357 - JDT too often rebuilding workspace
Summary: JDT too often rebuilding workspace
Status: VERIFIED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.5 M2   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2007-08-17 09:40 EDT by Juergen Weber CLA
Modified: 2008-09-15 09:11 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Juergen Weber CLA 2007-08-17 09:40:19 EDT
Build ID:  I20070809-1105

Eclipse is way too often rebuilding the workspace.

I saw this happen e.g.

- typed ctrl-S in a build.xml editor
- added a public static final String in a Java editor and typed ctrl-S
- changed the name of an installed JRE 

As I am working on a very large project Eclipse each time is dead for about ten minutes.

See also bug 195506.
Comment 1 Jerome Lanneluc CLA 2007-08-17 09:53:50 EDT
We don't see this problem. Please provide detailed steps to reproduce.
Comment 2 Alex Blewitt CLA 2007-08-17 11:02:40 EDT
JDT recompile the minimal set of changes necessary when you make a change and have automatically build on.

If you have build.xml, and that build.xml is set as the target builder and is set to run whenever you modify a resource, you'll see that.

If you have a public static final constant that you're changing, then that class must be recompiled. Any classes that depend on that file are also recompiled. If that file is used in every class (e.g. something like a Debug object) then you can potentially end up recompiling every class in the workspace when you change that file.

If you change the JRE of the project, it does a full recompile.

Some of these recompilations are necessary, and for ant-based build.xml who only have a concept of 'do everything' it's not possible to use a smaller set of changes.

Why do you think that it doing recompilations is bad? It's used to do a lot of the 'nice' stuff e.g. code completion etc.

If on the other hand you're coming from a different editor which had separate edit and build cycles, turn of automatic build. Project -> Build Automatically can be unselected. However, you'll need to build the project manually yourself when you want to.
Comment 3 Juergen Weber CLA 2007-08-20 04:00:26 EDT
The build.xml was not set as the target builder, there is only the java builder set.
As I wrote, I _added_ a public static final String, as it is new there should be no need to recompile.
Comment 4 Jerome Lanneluc CLA 2007-08-20 06:16:01 EDT
Still need detail steps to reproduce.
Comment 5 Juergen Weber CLA 2008-02-04 04:32:50 EST
I added another JDK to Preferences - Java - Installed JREs. The new one is not checked as default.

Clicked OK and Eclipse was rebuilding the Workspace. But no project can have a dependency to this new JRE.

Comment 6 Jerome Lanneluc CLA 2008-02-04 05:34:36 EST
I still cannot reproduce. Here are the steps I followed:
1. Created a new Eclipse Application launch config (Runtime JRE is 1.5.0)
2. Enabled Tracing > org.eclipse.jdt.core > debug/builder
3. Run
4. Created a new Java Project
Observed: Full build of the Java project
5. Window > Preferences > Java > Installed JREs > Add
6. Added a 1.4.2 JRE
7. OK
Observed: An incremental build of the Java Project that was instantaneous

Please provide more details on your steps.
Comment 7 Jerome Lanneluc CLA 2008-08-26 07:35:33 EDT
Could not reproduce. Closing as WORKSFORME
Comment 8 Frederic Fusier CLA 2008-09-15 09:11:25 EDT
Verified for 3.5M2 using I20080914-2000.