Community
Participate
Working Groups
Consider the following code: --------------------------------------------------- public enum Element { BEGIN ("body.jsp"), END ("body.jsp"); private String file; Element(String file) { this.file = file; } } --------------------------------------------------- I experienced that accidentally replacing the ";", after the second element "END", with a dot/period (.), causes eclipse to crash. I really just wanted to add an additional element, so i meant to replace it with a comma instead. Nothing interesting showed up in the .log file. This was what it read during next startup: --------------------------------------------------- !ENTRY org.eclipse.core.resources 2 10035 2005-08-22 10:50:21.264 !MESSAGE A workspace crash was detected. The previous session did not exit normally. ---------------------------------------------------
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. ***