public <A extends Annotation> A getAnnotation(Class<A> annoType) {

        boolean inherited = annoType.isAnnotationPresent(Inherited.class);
        for (Type t = sym.type;
             t.tsym != env.symtab.objectType.tsym && !t.isErroneous();
             t = env.jctypes.supertype(t)) {

            A result = getAnnotation(annoType, t.tsym);
            if (result != null || !inherited) {
                return result;
            }
        }
        return null;
    }