Skip to content

Add Support of Parsing Runtime Invisible Annotations to Classfile Parser #6731

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 29, 2019

Conversation

noti0na1
Copy link
Member

This PR adds support of parsing runtime invisible annotations to ClassfileParser.

For the explicit-nulls project, we want to read NotNull annotations of Java methods to generate better types. Originally, dotc was only able to parse RuntimeVisibleAnnotations in Classfile. However, some NotNull annotations are runtime invisible (RuntimeInvisibleAnnotations).

Since both annotations have the same structure, this PR only changes two parts:

  • Rename Classfile Attributes in StdNames.scala

  • Add RuntimeInvisibleAnnotations attribute to ClassfileParser.scala

Copy link
Member

@dottybot dottybot left a comment

Choose a reason for hiding this comment

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

Hello, and thank you for opening this PR! 🎉

All contributors have signed the CLA, thank you! ❤️

Have an awesome day! ☀️

parseAnnotations(attrLen)

// TODO 1: parse runtime visible annotations on parameters
// case tpnme.RuntimeParamAnnotationATTR

// TODO 2: also parse RuntimeInvisibleAnnotation / RuntimeInvisibleParamAnnotation,
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

No good reason that I'm aware of. I agree we should parse these and give then StaticAnnotation parent.

@smarter
Copy link
Member

smarter commented Jun 24, 2019

test performance please

@smarter
Copy link
Member

smarter commented Jun 24, 2019

@liufengyun looks like the benchmarking bot isn't responding ? ^

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.

4 participants