Bug 146324 - Batch builds produce "The type X is already defined" errors
Summary: Batch builds produce "The type X is already defined" errors
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 3.2.1   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-06-09 15:18 EDT by Kent Johnson CLA
Modified: 2007-08-28 10:05 EDT (History)
3 users (show)

See Also:


Attachments
Proposed patch (4.02 KB, patch)
2006-06-09 15:23 EDT, Kent Johnson CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kent Johnson CLA 2006-06-09 15:18:20 EDT
When a project contains over 2000 source files (current value of MAX_AT_ONCE constant that controls how many files are compiled together) and some source files define secondary types... its possible that a full/batch build will end with errors of the form "The type X is already defined".

The fix for bug 106446 is not sufficient to handle this case.

To reproduce, change the MAX_AT_ONCE constant to 1 and compile these 2 files:

A. java

class A {}
class C extends A {}

=================

B.java

class B {
	C z = new A(); // reference to secondary type C MUST come before A
}
Comment 1 Kent Johnson CLA 2006-06-09 15:23:42 EDT
Created attachment 44039 [details]
Proposed patch
Comment 2 Kent Johnson CLA 2006-06-14 11:06:26 EDT
Released for 3.3M1 in HEAD.
Released for 3.2.1 in TARGET_321 branch.
Comment 3 Frederic Fusier CLA 2006-08-07 11:32:10 EDT
Verified for 3.3 M1 using build I20060807-0010.
Comment 4 Maxime Daniel CLA 2006-09-12 01:15:41 EDT
Verified for 3.2.1 using build M20060908-1655.
Comment 5 Berend Mulder CLA 2007-08-28 05:45:24 EDT
This bug, or something similar still occurs with 3.2.2
I have a project where, after upgrading to 3.2.2 using internal update, This problem re-surfaces.
Comment 6 Kent Johnson CLA 2007-08-28 10:02:51 EDT
Please enter a new bug with a reproduceable testcase.
Comment 7 Berend Mulder CLA 2007-08-28 10:05:28 EDT
Additional research in to our case has resolved the problem which had a big similarity to  this bug: suffice it to say the problem ultimately didn't have anything to do with Eclipse.
Lesson learned: be thorough in analysis before barking.