program crashes javac following recent updates
Werner Dietl
wdietl at gmail.com
Thu Jul 25 15:46:02 PDT 2013
Hi Steve,
I also just experimented with such a class and see the following:
java.lang.NullPointerException
at com.sun.tools.javac.code.TypeAnnotations$TypeAnnotationPositions.separateAnnotationsKinds(TypeAnnotations.java:314)
at com.sun.tools.javac.code.TypeAnnotations$TypeAnnotationPositions.visitLambda(TypeAnnotations.java:1099)
at com.sun.tools.javac.tree.JCTree$JCLambda.accept(JCTree.java:1609)
at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
at com.sun.tools.javac.code.TypeAnnotations$TypeAnnotationPositions.scan(TypeAnnotations.java:246)
...
I will start working on a fix.
It would be great if you could add/expand the Lambda tests to cover this case.
Thanks,
cu, WMD.
On Thu, Jul 25, 2013 at 3:40 PM, Steve Sides <steve.sides at oracle.com> wrote:
> On 7/25/2013 7:45 AM, Werner Dietl wrote:
>>
>> Jon, Steve,
>>
>> my change definitely fixes the reported crash, but it might now put
>> type annotations on a ClassSymbol instead (or in addition?) of on the
>> correct MethodSymbol.
>> I think this might be happening because that code is probably visited
>> twice, once before and once after becoming its own top-level class.
>>
>> Steve, we previously discussed having additional tests that ensure
>> that the Lambda conversion puts type annotations on the right Symbols.
>
> That test checks for the correct type annotation attributes,ie.,
> Runtime(In)visible(Type)Annotation_attribute.
> There are various usages of TA's on lambda expressions. I see there are type
> annotations in inner class of lambda expressison, but not the other way
> around, lambda expressions in local classes. :/
> I have this:
> void test() {
> cs = c -> {
> class innerClass {
> @A @B Class<?> icc = null;
>
> but not this:
> void test() {
> class localClass {
> cs = c-> {
> @A @B Class<?> icc = null;
>
> which (modified a little) I can see crashes.
>
>
> -steve
>
>
>
>> None of the existing tests failed additionally after my change, so I'm
>> not sure whether I broke this or not.
>> Could you point us to test cases that ensure that type annotations
>> on/within Lambdas are converted correctly?
>>
>> Thanks,
>> cu, WMD.
>>
>> On Wed, Jul 24, 2013 at 11:53 PM, Werner Dietl<wdietl at gmail.com> wrote:
>>>
>>> Jon,
>>>
>>> I pushed a fix:
>>>
>>>
>>> http://hg.openjdk.java.net/type-annotations/type-annotations/langtools/rev/01303809577e
>>>
>>> Please let me know whether this looks good.
>>>
>>> Cheers,
>>> cu, WMD.
>>>
>>> On Wed, Jul 24, 2013 at 6:32 PM, Jonathan Gibbons
>>> <jonathan.gibbons at oracle.com> wrote:
>>>>
>>>> Werner,
>>>>
>>>> Maurizio has reported that a test program has started crashing as a
>>>> result
>>>> of a recent push from the type-annotations forest. Do you have time to
>>>> take
>>>> a look? You can find details here:
>>>>
>>>> http://bugs.sun.com/view_bug.do?bug_id=8020715
>>>>
>>>> -- Jon
>>>
>>>
>>>
>>> --
>>> http://www.google.com/profiles/wdietl
>>
>>
>>
>
--
http://www.google.com/profiles/wdietl
More information about the type-annotations-dev
mailing list