I need to perform a static analysis of the program (use SootUp library, v.:1.2.0). I can’t retrieve the annotations of the class fields.
My custom annotation (Kotlin):
package annotation
@Target(AnnotationTarget.FIELD)
@Retention(AnnotationRetention.RUNTIME)
annotation class StateVar(val value: String = "")
My class with annotated field:
class TrafficLight {
@field:StateVar("mode")
private var mode: Int = 0
...
}
I need to retrieve this annotation:
...
val sootClass = view.getClass(classType).get()
sootClass.fields // <-- empty annotation list (pic below)
pic
Could you explain to me how to access such annotations using the SootUp? What is my mistake?
New contributor
Student is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.