Summary: | [compiler] Compiler accepts spurious semicolon in array initialiser | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Mike Spivey <mike> |
Component: | Core | Assignee: | David Audel <david_audel> |
Status: | VERIFIED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | ||
Version: | 3.1 | ||
Target Milestone: | 3.2 M6 | ||
Hardware: | PC | ||
OS: | Linux | ||
Whiteboard: |
Description
Mike Spivey
2006-03-26 06:15:20 EST
I'll investigate. Reduce test case: public class X { java.lang.Object o[] = { new String("SUCCESS") ; }; } If the type of the field is not qualified, the compiler reports an error. The array initializer is wrongly seen as an initializer. I'll check the grammar. We might have a bug there. David, The syntax error is detected, but we eat it silently in the recovery. The problem is inside RecoveredField#updateOnOpeningBrace() This method check if the type of the field is an ArrayTypeReference but doesn't check if the type is ArrayQualifiedTypeReference. There is the same problem if RecoveredLocalVariable. Fixed and tests added SyntaxErrorTest#test07() -> test10() Verified using I20060328-0010 for 3.2M6 |