From f38ab3863f3fb1f80b8cbe8254def2274fd4b598 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Fri, 17 Jul 2020 19:06:14 +0200 Subject: [PATCH] Polishing --- .../context/ConfigurableApplicationContext.java | 9 +++++---- .../AbstractJndiLocatingBeanDefinitionParser.java | 11 +++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/spring-context/src/main/java/org/springframework/context/ConfigurableApplicationContext.java b/spring-context/src/main/java/org/springframework/context/ConfigurableApplicationContext.java index e837138a9f88..3808b0be528a 100644 --- a/spring-context/src/main/java/org/springframework/context/ConfigurableApplicationContext.java +++ b/spring-context/src/main/java/org/springframework/context/ConfigurableApplicationContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -147,11 +147,12 @@ public interface ConfigurableApplicationContext extends ApplicationContext, Life void addProtocolResolver(ProtocolResolver resolver); /** - * Load or refresh the persistent representation of the configuration, - * which might an XML file, properties file, or relational database schema. + * Load or refresh the persistent representation of the configuration, which + * might be from Java-based configuration, an XML file, a properties file, a + * relational database schema, or some other format. *

As this is a startup method, it should destroy already created singletons * if it fails, to avoid dangling resources. In other words, after invocation - * of that method, either all or no singletons at all should be instantiated. + * of this method, either all or no singletons at all should be instantiated. * @throws BeansException if the bean factory could not be initialized * @throws IllegalStateException if already initialized and multiple refresh * attempts are not supported diff --git a/spring-context/src/main/java/org/springframework/ejb/config/AbstractJndiLocatingBeanDefinitionParser.java b/spring-context/src/main/java/org/springframework/ejb/config/AbstractJndiLocatingBeanDefinitionParser.java index 73b15c22373a..34c4ac5c9ad6 100644 --- a/spring-context/src/main/java/org/springframework/ejb/config/AbstractJndiLocatingBeanDefinitionParser.java +++ b/spring-context/src/main/java/org/springframework/ejb/config/AbstractJndiLocatingBeanDefinitionParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,7 +24,9 @@ import org.springframework.util.StringUtils; import org.springframework.util.xml.DomUtils; -import static org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.*; +import static org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.DEFAULT_VALUE; +import static org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.LAZY_INIT_ATTRIBUTE; +import static org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.TRUE_VALUE; /** * Abstract base class for BeanDefinitionParsers which build @@ -47,8 +49,9 @@ abstract class AbstractJndiLocatingBeanDefinitionParser extends AbstractSimpleBe @Override protected boolean isEligibleAttribute(String attributeName) { - return (super.isEligibleAttribute(attributeName) && !ENVIRONMENT_REF.equals(attributeName) && !LAZY_INIT_ATTRIBUTE - .equals(attributeName)); + return (super.isEligibleAttribute(attributeName) && + !ENVIRONMENT_REF.equals(attributeName) && + !LAZY_INIT_ATTRIBUTE.equals(attributeName)); } @Override