Bug 23890 - Changing Package Declarations triggers full project rebuild
Summary: Changing Package Declarations triggers full project rebuild
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.1 M2   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-09-20 05:37 EDT by Dani Megert CLA
Modified: 2003-03-23 12:21 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dani Megert CLA 2002-09-20 05:37:50 EDT
Build 20020919

I'm not sure if it can be made more efficient maybe it is ok to scrub the whole
project if the package declaration changes.
Comment 1 Philipe Mulet CLA 2002-09-23 05:02:53 EDT
Do you have exact steps to reproduce ? A namespace change is quite severe, but 
it should not recompile the entire project. Now, depending on the scenario, it 
could simply be a mode which we don't optimize since it doesn't happen very 
often (how many times have you made such a change for the past year ?).
Comment 2 Dani Megert CLA 2002-09-23 05:19:43 EDT
1. Open a CU
2. Change its package declaration

Note:
1) I had auto-build on
2) I copied the CU from another project/package via Navigator (==> error) and
then fixed the bug by adapting the package declarartion in the Java Editor
Comment 3 Kent Johnson CLA 2002-09-23 13:15:46 EDT
Here's the builder trace from the testcase... I don't see a problem. Can you 
reproduce?

Moved file in Navigator:

Starting build of Copy Test @ Mon Sep 23 13:34:30 EDT 2002
Found source delta for: Copy Test
Clearing last state : State for Copy Test (#5 @ Mon Sep 23 13:32:02 EDT 2002)
INCREMENTAL build
Compile this added source file D:/aR2.0/workspace.test/Copy Test/p1/X.java
Add dependents of added source file p1/X
  adding dependents of X in p1
Add dependents of removed type p2/X
Deleting class file of removed type p2/X
About to compile D:/aR2.0/workspace.test/Copy Test/p1/X.java
  adding dependents of X in p1
Writing new class file X.class
Recording new state : State for Copy Test (#6 @ Mon Sep 23 13:34:35 EDT 2002)
Finished build of Copy Test @ Mon Sep 23 13:34:35 EDT 2002


Fixed package declaration error:

Starting build of Copy Test @ Mon Sep 23 13:35:01 EDT 2002
Found source delta for: Copy Test
Clearing last state : State for Copy Test (#6 @ Mon Sep 23 13:34:35 EDT 2002)
INCREMENTAL build
Compile this changed source file D:/aR2.0/workspace.test/Copy Test/p1/X.java
About to compile D:/aR2.0/workspace.test/Copy Test/p1/X.java
Writing changed class file X.class
Recording new state : State for Copy Test (#7 @ Mon Sep 23 13:34:35 EDT 2002)
Finished build of Copy Test @ Mon Sep 23 13:35:01 EDT 2002
Comment 4 Dani Megert CLA 2002-09-23 13:58:59 EDT
Maybe its because I have a large workspace? I'm currently testing how to split
org.eclipse.ui. I.e. I created new projects A and B (both being included an
re-exported by org.eclipse.ui) and then moved (or copied) stuff to A and B.
Changing the package declaration triggered a scrub output location.
Comment 5 Kent Johnson CLA 2002-09-23 14:11:28 EDT
Sorry are you copying the files between packages or projects?

If it is projects... do they have major build failures such as a cycle?

If the projects are not building correctly, then they will do full builds on 
every change.

Can you enable the trace so we can see what is happening?
Comment 6 Dani Megert CLA 2002-09-26 11:07:25 EDT
I was busy with splitting org.eclipse.ui. Will now try to reproduce.

Comment 7 Dani Megert CLA 2002-09-26 11:33:17 EDT
I used the patch you attached to the PR and then tested the File Search dialog page:
1. Enter *.txt as file name pattern
2. Press "Browse..."
==> "*.txt" appears in the others field instead of selecting "*.txt" in the list
Comment 8 Dani Megert CLA 2002-09-26 11:34:57 EDT
Oops! message posted to wrong PR - please ignore.
Comment 9 Dani Megert CLA 2002-09-27 05:33:05 EDT
I currently can't reproduce the full build behavior either. Maybe this is due to
this bug I found:
24172 Strange behavior with wrong package declaration
Comment 10 Kent Johnson CLA 2002-09-30 14:38:59 EDT
Closing until we have repeatable steps.

24172 is not a bug... the R2.0 Java builder just handles 'incorrect' package 
declarations differently than the R1.0 builder.