| Summary: | The 2000th (0-based) enum constant is null | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Cliff <zhaotq> | ||||||||
| Component: | Core | Assignee: | Olivier Thomann <Olivier_Thomann> | ||||||||
| Status: | VERIFIED FIXED | QA Contact: | |||||||||
| Severity: | critical | ||||||||||
| Priority: | P3 | CC: | daniel_megert, deepakazad, flood, jarthana, Olivier_Thomann, zhaotq | ||||||||
| Version: | 3.7 | Flags: | daniel_megert:
pmc_approved+
jarthana: review+ |
||||||||
| Target Milestone: | 3.7.1 | ||||||||||
| Hardware: | All | ||||||||||
| OS: | All | ||||||||||
| Whiteboard: | |||||||||||
| Attachments: |
|
||||||||||
|
Description
Cliff
Created attachment 198432 [details]
The test case shows the null enum constant.
I'll fix it. Created attachment 198483 [details]
Proposed fix + updated regression test
In fact an existing regression test was bogus. It clearly shows null for one of the constants.
Released in BETA_JAVA7 branch. Since this branch will be our 3.7.1 contents, this is fine. Verified with v20110714-1300. Bug is still there for exactly 2001 values, tested with "Eclipse Compiler for Java(TM) 0.B75_R37x, 3.7.1", just shorten the test case TestEnum to end after "E2000". I'll take a look. Created attachment 202315 [details]
Proposed fix + regression tests
When the number of enum constants is exactly the limit + 1, the last constant was not properly initialized.
Good catch.
Daniel, I think this needs to be fixed as one constant is not initialized and there is no workaround. Jay, please review. Daniel, Srikanth is in vacations this week. So it will be difficult to get his +1. +1 for 3.7.1 RC3 (In reply to comment #9) > Daniel, I think this needs to be fixed as one constant is not initialized and > there is no workaround. > Jay, please review. +1 for the patch. One question is, do we even need the statement 'count = 1'? (In reply to comment #11) > +1 for the patch. One question is, do we even need the statement 'count = 1'? Yes, this is to make sure we generate the last constant (here only the last one) when we check if count != 0 after the loop. Released for 3.7.1 and 3.8M2. Verified for 3.7.1 with build M20110831-1030. Verified for 3.8M2 with build I20110912-2126. |