Skip to content

AutowiredAnnotationBeanPostProcessor.determineRequiredStatus(Annotation) throws NullPointerException if method wasnt found. [SPR-9364] #14001

@spring-projects-issues

Description

@spring-projects-issues

Michal Troicki opened SPR-9364 and commented

If ReflectionUtils.findMethod return null we should return true instead invocation of the method fail with NullPointerException.

protected boolean determineRequiredStatus(Annotation annotation) {
		try {
			Method method = ReflectionUtils.findMethod(annotation.annotationType(), this.requiredParameterName);
			return (this.requiredParameterValue == (Boolean) ReflectionUtils.invokeMethod(method, annotation));
		}
		catch (Exception ex) {
			// required by default
			return true;
		}
	}

Issue Links:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions