Community
Participate
Working Groups
I20080827-0935 + fix for bug 245348 With the fix for bug 245348, if you call ICompilation.createType("public @interface Annot {}") on a cu in a 1.3 project, you get a NoSuchElementException: java.util.NoSuchElementException at java.util.AbstractList$Itr.next(AbstractList.java:426) at org.eclipse.jdt.internal.core.CreateTypeMemberOperation.generateElementAST(CreateTypeMemberOperation.java:92) at org.eclipse.jdt.internal.core.CreateTypeOperation.generateElementAST(CreateTypeOperation.java:43) at org.eclipse.jdt.internal.core.CreateTypeMemberOperation.verify(CreateTypeMemberOperation.java:200) at org.eclipse.jdt.internal.core.CreateTypeOperation.verify(CreateTypeOperation.java:106) at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:763) at org.eclipse.jdt.internal.core.CompilationUnit.createType(CompilationUnit.java:449) This exception is not specified. Instead a JavaModelException with INVALID_CONTENTS should be thrown.
Released for 3.5M2. Updated existing test.
-1 on updating the test. The intent of the test (as explained in its Javadoc) is to ensure that a type can be created using createType(). The problem is that the cu's project has a 1.3 source level. The test should have been updated to ensure that the source level is 1.5 when testing the creation of an annotation type. And a new test should be written to ensure that this bug is fixed.
The old test was boggus. So updating it to reflect the right behavior was not wrong. I can add a new test to make sure that the 1.5 case is working.
(In reply to comment #3) > The old test was boggus. So updating it to reflect the right behavior was not > wrong. Then you should have updated the test's Javadoc as well. > I can add a new test to make sure that the 1.5 case is working. Please do so.
Done.
Verified for 3.5M2 using I20080914-2000