| Summary: | [compiler] ArrayIndexOutOfBoundsException when Switched from C/C++ Perspective to Java Perspective | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Thomas . <spam-receiver> | ||||||
| Component: | Core | Assignee: | Olivier Thomann <Olivier_Thomann> | ||||||
| Status: | VERIFIED FIXED | QA Contact: | |||||||
| Severity: | major | ||||||||
| Priority: | P3 | CC: | daniel_megert, jarthana, Olivier_Thomann, satyam.kandula | ||||||
| Version: | 3.7 | Flags: | daniel_megert:
pmc_approved+
|
||||||
| Target Milestone: | 3.6.2 | ||||||||
| Hardware: | All | ||||||||
| OS: | All | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
Thomas .
What is selected before you switch (element type, full name)? We need more details about what was done when the perspectives were switched. I could reproduce this problem by trying to create a package with the name elnu. Code around internalScanIdentifierOrKeyword(Scanner.java:2984) doesn't look good. The preceding if is incrementing the index! (In reply to comment #3) > I could reproduce this problem by trying to create a package with the name > elnu. > Code around internalScanIdentifierOrKeyword(Scanner.java:2984) doesn't look > good. The preceding if is incrementing the index! Thanks. Reproduced as well. Investigating. Created attachment 183127 [details]
Proposed fix + regression test
The decoding of "else" and "enum" was wrong. If "el" matches, then if should not check "num". Daniel, I think we should backport to 3.6.2 as there is no workaround for this issue and the fix is safe. I'll run all tests to make sure it works as expected. Created attachment 183129 [details]
Proposed fix + regression tests
Also updated the PublicScanner.
Released for 3.7M4. Daniel, I am requesting PMC approval for 3.6.2 backport. Closing as FIXED. Will reopen if backported to 3.6.2 I agree, that this needs to be backported to 3.6.2. Reopen for release in 3.6.2. Released for 3.6.2. Verified for 3.7M4 using build I20101206-1800 Verified for 3.6.2 using build M20110119-0834 |