AnnotationVisitor (AnnotationVisitor base, final NotNullState state) { return new AnnotationVisitor(Opcodes.API_VERSION, base) { @Override public void visit(String methodName, Object o) { if (ANNOTATION_DEFAULT_METHOD.equals(methodName) && !((String) o).isEmpty()) { state.message = (String) o; } else if ("exception".equals(methodName) && o instanceof Type && !((Type)o).getClassName().equals(Exception.class.getName())) { state.exceptionType = ((Type)o).getInternalName(); } super.visit(methodName, o); } }; }