Bug 133802 - Error for duplicate type has wrong source range
Summary: Error for duplicate type has wrong source range
Status: VERIFIED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 minor (vote)
Target Milestone: 3.8 M2   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-29 04:58 EST by Markus Keller CLA
Modified: 2011-09-09 06:41 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.