| Summary: | [1.5][syntax] Poor recovery when extra semicolon in annotation | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Philipe Mulet <philippe_mulet> |
| Component: | Core | Assignee: | David Audel <david_audel> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | ||
| Version: | 3.1 | ||
| Target Milestone: | 3.1 RC2 | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
Severity Description Resource In Folder Location Creation Time
2 Syntax error on tokens, delete these tokens X.java Crap/src line 6 May 6, 2005
8:24:06 PM
2 Zork cannot be resolved to a type X.java Crap/src line 19 May 6, 2005 8:24:06 PM
2 Return type for the method is missing X.java Crap/src line 23 May 6, 2005
8:24:06 PM
2 Syntax error on token ""unchecked"", delete this token X.java Crap/src line
23 May 6, 2005 8:24:06 PM
2 Syntax error on token ")", { expected after this token X.java Crap/src line
23 May 6, 2005 8:24:06 PM
2 Syntax error on token "@", } expected X.java Crap/src line 23 May 6, 2005
8:24:06 PM
+1 for RC2 +1 for RC2 Fixed and test added
AnnotationDietRecoveryTest#test0009()
There are several problems in this bug report
a first one with
@SuppressWarnings( { "deprecation",//$NON-NLS-1$
"finally",//$NON-NLS-1$
"unchecked"//$NON-NLS-1$
})
public static void main(String[] args) {
//W.deprecated();
List<X> l = new Vector();
l.size();
try {
// do nothing
} finally {
throw new Error();
}
Zork z;
}
and a second one with
@SuppressWarnings("serial")//$NON-NLS-1$
class S implements Serializable {
String dummy;
}
Only the second one is fixed, i fill another bug report for the first problem
(bug 99150)
New errors are Severity Description Resource In Folder Location Creation Time 2 Syntax error on tokens, delete these tokens Test.java Crap line 8 June 9, 2005 4:12:38 PM 2 Syntax error, insert "EnumBody" to complete EnumDeclaration Test.java Crap line 13 June 9, 2005 4:12:38 PM 2 Syntax error, insert "enum Identifier" to complete EnumHeaderName Test.java Crap line 13 June 9, 2005 4:12:38 PM Verified that the new list of errors looks like comment 5. But I don't understand the first error: 2 Syntax error on tokens, delete these tokens Test.java Crap line 8 June 9, 2005 4:12:38 PM This is perfectly fine. If you remove the ';', this error is gone. So it looks like this is unrelated. Verified in N20050609-0010 + JDT/Core HEAD. David, please comment why the first error occurs. Verified in I20050610-0010. |
Build N20050505 On following testcase with extra semicolon after annotation, many misleading syntax errors are diagnosed. import java.io.Serializable; import java.util.List; import java.util.Vector; public class X { @SuppressWarnings( { "deprecation",//$NON-NLS-1$ "finally",//$NON-NLS-1$ "unchecked"//$NON-NLS-1$ }) public static void main(String[] args) { //W.deprecated(); List<X> l = new Vector(); l.size(); try { // do nothing } finally { throw new Error(); } Zork z; } // not ready yet: field support @SuppressWarnings("unchecked");//$NON-NLS-1$ List<X> l = new Vector(); @SuppressWarnings("serial")//$NON-NLS-1$ class S implements Serializable { String dummy; } }