Skip to content

Conversation

lrytz
Copy link
Contributor

@lrytz lrytz commented Aug 11, 2021

Before 2.13, isStatic is implemented by
isNonBottomSubClass(StaticAnnotationClass)
which forces the annotation symbol's type.

In 2.13, Java annotations are identified by flags. This check doesn't
force the info, and the flags are missing if the info is still a
ClassfileLoader.

This leads to spurious API changes (annotation goes missing) if the
depending if the info is already forced or not.

A fix for this will be in 2.13.7, but we should still work around it
in Zinc to make sure it works correctly on 2.13.0-6.

Fixes #998

Before 2.13, `isStatic` is implemented by
`isNonBottomSubClass(StaticAnnotationClass)`
which forces the annotation symbol's type.

In 2.13, Java annotations are identified by flags. This check doesn't
force the info, and the flags are missing if the info is still a
`ClassfileLoader`.

This leads to spurious API changes (annotation goes missing) if the
depending if the info is already forced or not.

A fix for this will be in 2.13.7, but we should still work around it
in Zinc to make sure zinc works correctly on 2.13.0-6.
Copy link
Member

@eed3si9n eed3si9n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@lrytz lrytz requested a review from retronym August 12, 2021 06:31
@lrytz lrytz merged commit 600ffe0 into sbt:develop Aug 12, 2021
@SethTisue SethTisue changed the title Force the type of an annotation's typeSymbol beofre checking isStatic Force the type of an annotation's typeSymbol before checking isStatic Aug 12, 2021
@eed3si9n eed3si9n added this to the 1.6.0 milestone Sep 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

False invalidation by inheritance on JDK 11
3 participants