Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 202268

Summary: Rebuild workspace after changing casing of class name takes a long time
Product: [Eclipse Project] JDT Reporter: Benno Baumgartner <benno.baumgartner>
Component: CoreAssignee: Kent Johnson <kent_johnson>
Status: VERIFIED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: jerome_lanneluc
Version: 3.3   
Target Milestone: 3.4 M2   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Benno Baumgartner CLA 2007-09-05 08:53:21 EDT
I20070828-0800

1. check out JDT/UI from head
2. Open org.eclipse.jdt.internal.ui.workingsets.JavaWorkingSetPageContentProvider
4. change class name to javaWorkingSetPageContentProvider
5. Save
Is:
 Building workspace takes about a minute
Should:
 Be lightning fast, type is only used once and has default visibility
Comment 1 Kent Johnson CLA 2007-09-06 15:37:53 EDT
It works fine when the type is renamed from javaWorkingSetPageContentProvider to JavaWorkingSetPageContentProvider because then the type matches the file name.

But when its renamed so it no longer matches the filename, we must do a full build IF another type references the original type name. Otherwise we'll fail the build trying to find a missing .class file.

See IncrementalTests.testRenameMainType() for an example of a case that fails if we do not do a full build. It involves 3 types:

class A {}
class B extends A {}
class C extends B {}

when A is renamed to _A AND C is also modified, then B is found as a .class file & it expects to find the class file for its superclass A.

If we did not notice that A.java was modified & do a full build, we would abort the build because A.class no longer exists.

So the bottom line is we can only optimize one direction of the rename if the type has references.
Comment 2 Jerome Lanneluc CLA 2007-09-18 09:35:40 EDT
Verified for 3.4M2