Bug 133802

Summary: Error for duplicate type has wrong source range
Product: [Eclipse Project] JDT Reporter: Markus Keller <markus.kell.r>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: VERIFIED WORKSFORME QA Contact:
Severity: minor    
Priority: P3    
Version: 3.2   
Target Milestone: 3.8 M2   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Markus Keller CLA 2006-03-29 04:58:48 EST
HEAD

Error for a duplicate type declaration sometimes has a wrong source range.

Steps:

- copy this cu text and paste to a source folder:
package xy;
public class Try {}
class Bug {}

- copy this cu text and paste to the same source folder:
package xy;
class Bug {
    int field;
    int field2;
    int field3;
}

=> source range is somewhere between field and field2 in Bug.java
=> expected: source range on one of the class declaration names
Comment 1 Olivier Thomann CLA 2006-03-31 12:49:46 EST
Cannot reproduce with I20060330-0010.
Would you ming trying to reproduce with this build and let me know if you can do it.
Closign as WORKSFORME. Reopen if you get it again.
Comment 2 Olivier Thomann CLA 2006-03-31 12:49:57 EST
Closing.
Comment 3 Markus Keller CLA 2006-04-03 06:44:43 EDT
Can still reproduce with I20060331-2000, though steps are somewhat timing-dependent...:

- new workspace
- create new Java project "P" (all defaults)
- in Package Explorer, paste first CU text into project P
- wait for autobuild to finish
- paste second CU text into project P

It only seems to be happening if class Bug already exists as secondary type and then Bug.java is added and incrementally compiled.
Comment 4 Olivier Thomann CLA 2006-04-04 15:16:41 EDT
I tried again and I cannot reproduce.
I'll try to see how this could be related to a timing issue.
Comment 5 Olivier Thomann CLA 2011-09-08 15:09:13 EDT
I tried to reproduce. Unsuccessfully.
Comment 6 Markus Keller CLA 2011-09-09 06:04:19 EDT
Also can't reproduce any more. Worksforme.