package com.yahoo.abicheck.collector; import java.util.HashSet; import java.util.Set; import org.objectweb.asm.AnnotationVisitor; import org.objectweb.asm.ClassVisitor; import org.objectweb.asm.Opcodes; import org.objectweb.asm.Type; public class AnnotationCollector extends ClassVisitor { private final Set annotations = new HashSet<>(); public AnnotationCollector() { super(Opcodes.ASM7); } @Override public AnnotationVisitor visitAnnotation(String descriptor, boolean visible) { annotations.add(Type.getType(descriptor).getClassName()); return null; } public Set getAnnotations() { return annotations; } }