Browse Source

Polishing

pull/30915/head
Juergen Hoeller 1 year ago
parent
commit
c64a322e19
  1. 4
      framework-docs/modules/ROOT/pages/core/beans/context-introduction.adoc
  2. 4
      spring-aop/src/main/java/org/springframework/aop/framework/CglibAopProxy.java
  3. 12
      spring-context/src/main/java/org/springframework/context/support/AbstractXmlApplicationContext.java
  4. 2
      spring-context/src/test/java/org/springframework/mock/env/MockEnvironment.java
  5. 4
      spring-core/src/testFixtures/java/org/springframework/core/testfixture/env/MockPropertySource.java
  6. 5
      spring-jms/src/main/java/org/springframework/jms/connection/CachingConnectionFactory.java
  7. 5
      spring-test/src/main/java/org/springframework/mock/env/MockEnvironment.java
  8. 4
      spring-test/src/main/java/org/springframework/mock/env/MockPropertySource.java
  9. 4
      spring-web/src/main/java/org/springframework/web/util/pattern/PathPattern.java

4
framework-docs/modules/ROOT/pages/core/beans/context-introduction.adoc

@ -910,7 +910,7 @@ Java:: @@ -910,7 +910,7 @@ Java::
[source,java,indent=0,subs="verbatim,quotes",role="primary"]
----
// create a startup step and start recording
StartupStep scanPackages = this.getApplicationStartup().start("spring.context.base-packages.scan");
StartupStep scanPackages = getApplicationStartup().start("spring.context.base-packages.scan");
// add tagging information to the current step
scanPackages.tag("packages", () -> Arrays.toString(basePackages));
// perform the actual phase we're instrumenting
@ -924,7 +924,7 @@ Kotlin:: @@ -924,7 +924,7 @@ Kotlin::
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
----
// create a startup step and start recording
val scanPackages = this.getApplicationStartup().start("spring.context.base-packages.scan")
val scanPackages = getApplicationStartup().start("spring.context.base-packages.scan")
// add tagging information to the current step
scanPackages.tag("packages", () -> Arrays.toString(basePackages))
// perform the actual phase we're instrumenting

4
spring-aop/src/main/java/org/springframework/aop/framework/CglibAopProxy.java

@ -370,8 +370,8 @@ class CglibAopProxy implements AopProxy, Serializable { @@ -370,8 +370,8 @@ class CglibAopProxy implements AopProxy, Serializable {
@Override
public boolean equals(@Nullable Object other) {
return (this == other || (other instanceof CglibAopProxy cglibAopProxy &&
AopProxyUtils.equalsInProxy(this.advised, cglibAopProxy.advised)));
return (this == other || (other instanceof CglibAopProxy that &&
AopProxyUtils.equalsInProxy(this.advised, that.advised)));
}
@Override

12
spring-context/src/main/java/org/springframework/context/support/AbstractXmlApplicationContext.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2023 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.
@ -20,6 +20,7 @@ import java.io.IOException; @@ -20,6 +20,7 @@ import java.io.IOException;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.beans.factory.xml.BeanDefinitionDocumentReader;
import org.springframework.beans.factory.xml.ResourceEntityResolver;
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
import org.springframework.context.ApplicationContext;
@ -95,12 +96,13 @@ public abstract class AbstractXmlApplicationContext extends AbstractRefreshableC @@ -95,12 +96,13 @@ public abstract class AbstractXmlApplicationContext extends AbstractRefreshableC
}
/**
* Initialize the bean definition reader used for loading the bean
* definitions of this context. Default implementation is empty.
* Initialize the bean definition reader used for loading the bean definitions
* of this context. The default implementation sets the validating flag.
* <p>Can be overridden in subclasses, e.g. for turning off XML validation
* or using a different XmlBeanDefinitionParser implementation.
* or using a different {@link BeanDefinitionDocumentReader} implementation.
* @param reader the bean definition reader used by this context
* @see org.springframework.beans.factory.xml.XmlBeanDefinitionReader#setDocumentReaderClass
* @see XmlBeanDefinitionReader#setValidating
* @see XmlBeanDefinitionReader#setDocumentReaderClass
*/
protected void initBeanDefinitionReader(XmlBeanDefinitionReader reader) {
reader.setValidating(this.validating);

2
spring-context/src/test/java/org/springframework/mock/env/MockEnvironment.java vendored

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2023 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.

4
spring-core/src/testFixtures/java/org/springframework/core/testfixture/env/MockPropertySource.java vendored

@ -28,7 +28,7 @@ import org.springframework.core.env.PropertySource; @@ -28,7 +28,7 @@ import org.springframework.core.env.PropertySource;
*
* The {@link #setProperty} and {@link #withProperty} methods are exposed for
* convenience, for example:
* <pre>
* <pre class="code">
* {@code
* PropertySource<?> source = new MockPropertySource().withProperty("foo", "bar");
* }
@ -77,7 +77,7 @@ public class MockPropertySource extends PropertiesPropertySource { @@ -77,7 +77,7 @@ public class MockPropertySource extends PropertiesPropertySource {
/**
* Create a new {@code MockPropertySource} with the given name and backed by the given
* {@link Properties} object
* {@link Properties} object.
* @param name the {@linkplain #getName() name} of the property source
* @param properties the properties to use
*/

5
spring-jms/src/main/java/org/springframework/jms/connection/CachingConnectionFactory.java

@ -559,11 +559,10 @@ public class CachingConnectionFactory extends SingleConnectionFactory { @@ -559,11 +559,10 @@ public class CachingConnectionFactory extends SingleConnectionFactory {
}
@Override
public boolean equals(@Nullable Object obj) {
public boolean equals(@Nullable Object other) {
// Effectively checking object equality as well as toString equality.
// On WebSphere MQ, Destination objects do not implement equals...
return (this == obj || (obj instanceof DestinationCacheKey otherKey &&
destinationEquals(otherKey)));
return (this == other || (other instanceof DestinationCacheKey that && destinationEquals(that)));
}
@Override

5
spring-test/src/main/java/org/springframework/mock/env/MockEnvironment.java vendored

@ -21,8 +21,7 @@ import org.springframework.core.env.ConfigurableEnvironment; @@ -21,8 +21,7 @@ import org.springframework.core.env.ConfigurableEnvironment;
/**
* Simple {@link ConfigurableEnvironment} implementation exposing
* {@link #setProperty(String, String)} and {@link #withProperty(String, String)}
* methods for testing purposes.
* {@link #setProperty} and {@link #withProperty} methods for testing purposes.
*
* @author Chris Beams
* @author Sam Brannen
@ -33,6 +32,7 @@ public class MockEnvironment extends AbstractEnvironment { @@ -33,6 +32,7 @@ public class MockEnvironment extends AbstractEnvironment {
private final MockPropertySource propertySource = new MockPropertySource();
/**
* Create a new {@code MockEnvironment} with a single {@link MockPropertySource}.
*/
@ -40,6 +40,7 @@ public class MockEnvironment extends AbstractEnvironment { @@ -40,6 +40,7 @@ public class MockEnvironment extends AbstractEnvironment {
getPropertySources().addLast(this.propertySource);
}
/**
* Set a property on the underlying {@link MockPropertySource} for this environment.
*/

4
spring-test/src/main/java/org/springframework/mock/env/MockPropertySource.java vendored

@ -48,6 +48,7 @@ public class MockPropertySource extends PropertiesPropertySource { @@ -48,6 +48,7 @@ public class MockPropertySource extends PropertiesPropertySource {
*/
public static final String MOCK_PROPERTIES_PROPERTY_SOURCE_NAME = "mockProperties";
/**
* Create a new {@code MockPropertySource} named {@value #MOCK_PROPERTIES_PROPERTY_SOURCE_NAME}
* that will maintain its own internal {@link Properties} instance.
@ -84,6 +85,7 @@ public class MockPropertySource extends PropertiesPropertySource { @@ -84,6 +85,7 @@ public class MockPropertySource extends PropertiesPropertySource {
super(name, properties);
}
/**
* Set the given property on the underlying {@link Properties} object.
*/
@ -97,7 +99,7 @@ public class MockPropertySource extends PropertiesPropertySource { @@ -97,7 +99,7 @@ public class MockPropertySource extends PropertiesPropertySource {
* @return this {@link MockPropertySource} instance
*/
public MockPropertySource withProperty(String name, Object value) {
this.setProperty(name, value);
setProperty(name, value);
return this;
}

4
spring-web/src/main/java/org/springframework/web/util/pattern/PathPattern.java

@ -599,13 +599,11 @@ public class PathPattern implements Comparable<PathPattern> { @@ -599,13 +599,11 @@ public class PathPattern implements Comparable<PathPattern> {
private final PathMatchInfo pathMatchInfo;
PathRemainingMatchInfo(PathContainer pathMatched, PathContainer pathRemaining) {
this(pathMatched, pathRemaining, PathMatchInfo.EMPTY);
}
PathRemainingMatchInfo(PathContainer pathMatched, PathContainer pathRemaining,
PathMatchInfo pathMatchInfo) {
PathRemainingMatchInfo(PathContainer pathMatched, PathContainer pathRemaining, PathMatchInfo pathMatchInfo) {
this.pathRemaining = pathRemaining;
this.pathMatched = pathMatched;
this.pathMatchInfo = pathMatchInfo;

Loading…
Cancel
Save