public final <A extends Annotation> A getMethodAnnotation(Class<A> annotation, M getter, M setter, Locatable srcPos) { A a1 = getter==null?null:getMethodAnnotation(annotation,getter,srcPos); A a2 = setter==null?null:getMethodAnnotation(annotation,setter,srcPos); if(a1==null) { if(a2==null) return null; else return a2; } else { if(a2==null) return a1; else { // both are present getErrorHandler().error(new IllegalAnnotationException( Messages.DUPLICATE_ANNOTATIONS.format( annotation.getName(), fullName(getter),fullName(setter)), a1, a2 )); // recover by ignoring one of them return a1; } } }
public final <A extends Annotation> A getMethodAnnotation(Class<A> annotation, M getter, M setter, Locatable srcPos) { A a1 = getter==null?null:getMethodAnnotation(annotation,getter,srcPos); A a2 = setter==null?null:getMethodAnnotation(annotation,setter,srcPos); if(a1==null) { if(a2==null) return null; else return a2; } else { if(a2==null) return a1; else { // both are present getErrorHandler().error(new IllegalAnnotationException( Messages.DUPLICATE_ANNOTATIONS.format( annotation.getName(), fullName(getter),fullName(setter)), a1, a2 )); // recover by ignoring one of them return a1; } } }
public final <A extends Annotation> A getMethodAnnotation(Class<A> annotation, M getter, M setter, Locatable srcPos) { A a1 = getter==null?null:getMethodAnnotation(annotation,getter,srcPos); A a2 = setter==null?null:getMethodAnnotation(annotation,setter,srcPos); if(a1==null) { if(a2==null) return null; else return a2; } else { if(a2==null) return a1; else { // both are present getErrorHandler().error(new IllegalAnnotationException( Messages.DUPLICATE_ANNOTATIONS.format( annotation.getName(), fullName(getter),fullName(setter)), a1, a2 )); // recover by ignoring one of them return a1; } } }
public final <A extends Annotation> A getMethodAnnotation(Class<A> annotation, M getter, M setter, Locatable srcPos) { A a1 = getter==null?null:getMethodAnnotation(annotation,getter,srcPos); A a2 = setter==null?null:getMethodAnnotation(annotation,setter,srcPos); if(a1==null) { if(a2==null) return null; else return a2; } else { if(a2==null) return a1; else { // both are present getErrorHandler().error(new IllegalAnnotationException( Messages.DUPLICATE_ANNOTATIONS.format( annotation.getName(), fullName(getter),fullName(setter)), a1, a2 )); // recover by ignoring one of them return a1; } } }