test case related to AssertionError (8009360)

Werner Dietl wdietl at gmail.com
Sun Apr 14 17:21:05 PDT 2013


Hi Steve,

thanks for that test case. This changeset should fix it:

http://hg.openjdk.java.net/type-annotations/type-annotations/langtools/rev/3e6b55fce59a

The parser was actually building the wrong AST in this location.
I also expanded another test case to make sure the generated bytecode
is correct.

Do let me know if you find this problem somewhere else!
cu, WMD.

On Mon, Apr 8, 2013 at 3:33 PM, Steve Sides <steve.sides at oracle.com> wrote:
> On 4/8/2013 3:05 PM, Werner Dietl wrote:
>>
>> Steve,
>>
>> thanks for the bug report - I'll look at it.
>> It would be great if you could send me test cases that I can add to
>> the type-annotations repository - then we can be sure when the bug is
>> fixed and that it doesn't come back.
>
> right. sorry 'bout that,
> http://cr.openjdk.java.net/~ssides/8011722/
>
>> I don't think I can mark anything as fixed - I don't think I have an
>> account for the bug tracker.
>
> <sigh> I forget that sometimes. I can wait 'til the changes make their way
> into tl, then mark things fixed.
>
> -steve
>
>
>> cu, WMD.
>>
>> On Mon, Apr 8, 2013 at 11:32 AM, Steve Sides<steve.sides at oracle.com>
>> wrote:
>>>
>>> Hi Werner,
>>> If you want to mark 8009360 as fixed(the AssertionError for duplicate
>>> annotation) - I see it compiles and runs with the anon/inner class test I
>>> have - you can, but it looks like another duplicate visit scenario for
>>> this
>>> test case. There's a separate bug for it (8011722) but it may not be
>>> visible
>>> yet.
>>>
>>> -steve
>>>
>>>
>>> On 4/8/2013 11:12 AM, Steve Sides wrote:
>>>>
>>>> This came in as a webbug, seems like chasing the AssertionError
>>>> around...
>>>>
>>>> public class AnnotatedQualifiedThrows {
>>>>      class InnerException extends Exception { }
>>>>      void foo() throws @C AnnotatedQualifiedThrows. at C InnerException {
>>>> }
>>>> }
>>>>
>>>> @Target(ElementType.TYPE_USE) @interface C { }
>>>>
>>>>
>>>> When compiled with jdk8 builds, it results in a NullPointerException,
>>>> but
>>>> when compiled with latest type-annotations build it results in an
>>>> AssertionError:
>>>>
>>>> ---------- javac ----------
>>>> An exception has occurred in the compiler (1.8.0-ea). Please file a bug
>>>> at
>>>> the Java Developer Connection (http://java.sun.com/webapps/bugreport)
>>>> after
>>>> checking the Bug Parade for duplicates. Include your program and the
>>>> following diagnostic in your report.  Thank you.
>>>> java.lang.AssertionError: Can't annotate already annotated type: ({} ::
>>>> AnnotatedQualifiedThrows.InnerException)
>>>>      at com.sun.tools.javac.util.Assert.error(Assert.java:133)
>>>>      at com.sun.tools.javac.util.Assert.check(Assert.java:94)
>>>>      at
>>>> com.sun.tools.javac.code.Type$AnnotatedType.<init>(Type.java:1582)
>>>>      at com.sun.tools.javac.comp.Attr.visitAnnotatedType(Attr.java:3936)
>>>>      at
>>>> com.sun.tools.javac.tree.JCTree$JCAnnotatedType.accept(JCTree.java:2353)
>>>>      at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:601)
>>>>      at com.sun.tools.javac.comp.Attr.attribType(Attr.java:639)
>>>>      at com.sun.tools.javac.comp.Attr.attribType(Attr.java:632)
>>>>      at
>>>> com.sun.tools.javac.comp.MemberEnter.signature(MemberEnter.java:389)
>>>>      at
>>>>
>>>> com.sun.tools.javac.comp.MemberEnter.visitMethodDef(MemberEnter.java:555)
>>>>      at
>>>> com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:770)
>>>>      at
>>>> com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:418)
>>>>      at
>>>> com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:430)
>>>>      at
>>>> com.sun.tools.javac.comp.MemberEnter.finishClass(MemberEnter.java:440)
>>>>      at
>>>> com.sun.tools.javac.comp.MemberEnter.finish(MemberEnter.java:1216)
>>>>      at
>>>> com.sun.tools.javac.comp.MemberEnter.complete(MemberEnter.java:1036)
>>>>      at com.sun.tools.javac.code.Symbol.complete(Symbol.java:434)
>>>>      at
>>>> com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:883)
>>>>      at com.sun.tools.javac.comp.Enter.complete(Enter.java:495)
>>>>      at com.sun.tools.javac.comp.Enter.main(Enter.java:473)
>>>>      at
>>>> com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:990)
>>>>      at
>>>> com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:865)
>>>>      at com.sun.tools.javac.main.Main.compile(Main.java:519)
>>>>      at com.sun.tools.javac.main.Main.compile(Main.java:376)
>>>>      at com.sun.tools.javac.main.Main.compile(Main.java:365)
>>>>      at com.sun.tools.javac.main.Main.compile(Main.java:356)
>>>>      at com.sun.tools.javac.Main.compile(Main.java:77)
>>>>      at com.sun.tools.javac.Main.main(Main.java:62)
>>>>
>>>> Output completed (1 sec consumed)
>>>
>>>
>>
>>
>



-- 
http://www.google.com/profiles/wdietl


More information about the type-annotations-dev mailing list