Defensive error reporting when StandardAnnotationMetadata introspects declared methods
Issue: SPR-13791
This commit is contained in:
		
							parent
							
								
									21329df7e1
								
							
						
					
					
						commit
						a36c0a50e6
					
				| 
						 | 
				
			
			@ -131,6 +131,7 @@ public class StandardAnnotationMetadata extends StandardClassMetadata implements
 | 
			
		|||
 | 
			
		||||
	@Override
 | 
			
		||||
	public boolean hasAnnotatedMethods(String annotationName) {
 | 
			
		||||
		try {
 | 
			
		||||
			Method[] methods = getIntrospectedClass().getDeclaredMethods();
 | 
			
		||||
			for (Method method : methods) {
 | 
			
		||||
				if (!method.isBridge() && method.getAnnotations().length > 0 &&
 | 
			
		||||
| 
						 | 
				
			
			@ -140,9 +141,14 @@ public class StandardAnnotationMetadata extends StandardClassMetadata implements
 | 
			
		|||
			}
 | 
			
		||||
			return false;
 | 
			
		||||
		}
 | 
			
		||||
		catch (Throwable ex) {
 | 
			
		||||
			throw new IllegalStateException("Failed to introspect annotated methods on " + getIntrospectedClass(), ex);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
	public Set<MethodMetadata> getAnnotatedMethods(String annotationName) {
 | 
			
		||||
		try {
 | 
			
		||||
			Method[] methods = getIntrospectedClass().getDeclaredMethods();
 | 
			
		||||
			Set<MethodMetadata> annotatedMethods = new LinkedHashSet<MethodMetadata>();
 | 
			
		||||
			for (Method method : methods) {
 | 
			
		||||
| 
						 | 
				
			
			@ -153,5 +159,9 @@ public class StandardAnnotationMetadata extends StandardClassMetadata implements
 | 
			
		|||
			}
 | 
			
		||||
			return annotatedMethods;
 | 
			
		||||
		}
 | 
			
		||||
		catch (Throwable ex) {
 | 
			
		||||
			throw new IllegalStateException("Failed to introspect annotated methods on " + getIntrospectedClass(), ex);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue