Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-15841

BeanDefinitionBuilder method arguments not annotated with @Nullable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: 5.0 RC3
    • Fix Version/s: 5.0 RC4
    • Component/s: Core
    • Labels:
      None
    • Last commented by a User:
      false

      Description

      BeanDefinitionBuilder declares setInitMethodName, setDestroyMethodName and setScope methods that do not accept @Nullable arguments.

      Forwarding values from a given BeanDefinition requires warning suppression or additional code to satisfy null checks:

      class CassandraCqlClusterParser extends AbstractBeanDefinitionParser {
      
      	@Override
      	protected AbstractBeanDefinition parseInternal(Element element, ParserContext parserContext) {
      
      		BeanDefinitionBuilder builder = …;
      
      		if (parserContext.isNested()) {
      
      			// warning is raised in the next line
      			builder.setScope(parserContext.getContainingBeanDefinition().getScope());
      		}
      
      		return …;
      	}
      }
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                juergen.hoeller Juergen Hoeller
                Reporter:
                mp911de Mark Paluch
                Last updater:
                Stéphane Nicoll
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  46 weeks ago