Summary: | Putting a period after an enum element with a constructor causes a crash | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Stefan Uldum Grinsted <sug> | ||||||
Component: | Core | Assignee: | David Audel <david_audel> | ||||||
Status: | VERIFIED FIXED | QA Contact: | |||||||
Severity: | blocker | ||||||||
Priority: | P3 | CC: | admin, philippe_mulet, ray.case, ssgranado | ||||||
Version: | 3.1 | ||||||||
Target Milestone: | 3.2 M2 | ||||||||
Hardware: | PC | ||||||||
OS: | Windows XP | ||||||||
Whiteboard: | |||||||||
Attachments: |
|
Description
Stefan Uldum Grinsted
2005-08-22 05:32:32 EDT
This is severe. Putting a dot is causing an OutOfMemoryError. This means that the workspace needs to be exited. I will investigate. You need the parenthesis before the dot. public enum X { BEGIN ("body.jsp"), END ("body.jsp"). private String file; X(String file) { this.file = file; } } if you remove the ("body.jsp") it works fine and you get: ---------- 1. WARNING in d:\tests_sources\X.java (at line 2) BEGIN ("body.jsp"), ^^^^^^^^^^ Non-externalized string literal; it should be followed by //$NON-NLS-<n>$ ---------- 2. ERROR in d:\tests_sources\X.java (at line 3) END . ^ Syntax error on token ".", ; expected ---------- 2 problems (1 error, 1 warning) Created attachment 26400 [details]
patch proposal
The problem is inside Parser#consumeEnumConstantheader(). There is a special
recovery when a dot is after an enum constant header but now this recovery not
useful any more and cause the bug.
Fix released in head and test added. EnumDietRecoveryTest#test0016() This bug could be a candidate for 3.1.1. Created attachment 26401 [details]
Proposed patch for 3.1.1
Verified in I20050920-0010 for 3.2M2 *** Bug 114314 has been marked as a duplicate of this bug. *** *** Bug 120138 has been marked as a duplicate of this bug. *** *** Bug 137484 has been marked as a duplicate of this bug. *** |