Skip to content

Fix #10133: don't parse RuntimeInvisibleAnnotationATTR #10134

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -699,14 +699,13 @@ class ClassfileParser(
sym.addAnnotation(Annotation(defn.AnnotationDefaultAnnot, Nil))

// Java annotations on classes / methods / fields with RetentionPolicy.RUNTIME
case tpnme.RuntimeVisibleAnnotationATTR
| tpnme.RuntimeInvisibleAnnotationATTR =>
case tpnme.RuntimeVisibleAnnotationATTR =>
parseAnnotations(attrLen)

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

// TODO 2: also parse RuntimeInvisibleParamAnnotation
// TODO 2: also parse RuntimeInvisibleAnnotationATTR / RuntimeInvisibleParamAnnotation
// i.e. java annotations with RetentionPolicy.CLASS?

case tpnme.ExceptionsATTR =>
Expand Down Expand Up @@ -938,7 +937,7 @@ class ClassfileParser(
// attribute isn't, this classfile is a compilation artifact.
return Some(NoEmbedded)

if (scan(tpnme.RuntimeVisibleAnnotationATTR) || scan(tpnme.RuntimeInvisibleAnnotationATTR)) {
if (scan(tpnme.RuntimeVisibleAnnotationATTR)) {
val attrLen = in.nextInt
val nAnnots = in.nextChar
var i = 0
Expand Down