import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
public class Annotations {
public static <T extends Annotation> T get(Method method, Class<T> annotationClass) {
T result = method.getAnnotation(annotationClass);
<BUG>if (result == null) {
Class currentClass = method.getDeclaringClass();
if (currentClass != Object.class) {
Class superClass = currentClass.getSuperclass();</BUG>
Method superClassMethod = null;

import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
public class Annotations {
public static <T extends Annotation> T get(Method method, Class<T> annotationClass) {
T result = method.getAnnotation(annotationClass);
if (result == null) {
Class superClass = getSuperClassIfNotObjectClass(method.getDeclaringClass());
if (superClass != null) {
Method superClassMethod = null;
