diff --git a/sootup.java.core/src/main/java/sootup/java/core/JavaSootMethod.java b/sootup.java.core/src/main/java/sootup/java/core/JavaSootMethod.java index 91adf47e72b..b9e84dc6b71 100644 --- a/sootup.java.core/src/main/java/sootup/java/core/JavaSootMethod.java +++ b/sootup.java.core/src/main/java/sootup/java/core/JavaSootMethod.java @@ -68,10 +68,7 @@ public boolean isStaticInitializer() { @Nonnull public Iterable getAnnotations(@Nonnull Optional view) { - annotations.forEach(e -> e.getAnnotation().getDefaultValues(view)); - resolveDefaultsForAnnotationTypes(view, annotations); - return annotations; } diff --git a/sootup.java.core/src/main/java/sootup/java/core/types/AnnotationType.java b/sootup.java.core/src/main/java/sootup/java/core/types/AnnotationType.java index 632bfb2390f..5ead654fe9c 100644 --- a/sootup.java.core/src/main/java/sootup/java/core/types/AnnotationType.java +++ b/sootup.java.core/src/main/java/sootup/java/core/types/AnnotationType.java @@ -22,16 +22,12 @@ * #L% */ -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import java.util.Set; +import java.util.*; import java.util.stream.StreamSupport; import javax.annotation.Nonnull; import javax.annotation.Nullable; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import sootup.core.IdentifierFactory; import sootup.core.model.SootMethod; import sootup.core.signatures.PackageName; @@ -48,6 +44,8 @@ */ public class AnnotationType extends JavaClassType { + private static final Logger log = LoggerFactory.getLogger(AnnotationType.class); + public void setInherited(boolean inherited) { isInherited = inherited; } @@ -70,12 +68,9 @@ public Map getDefaultValues(@Nonnull Optional viewOpti JavaView jv = viewOptional.get(); // meta annotations are not in the view - if (this.isMetaAnnotation()) { - return defaultValues; - } - if (!jv.getClass(this).isPresent()) { - throw new RuntimeException("Class of annotation not in view"); + log.error("Class of annotation " + this + "is not in current view."); + return defaultValues; } JavaSootClass jsc = jv.getClass(this).get();