diff --git a/spring-core/src/main/java/org/springframework/core/env/PropertySource.java b/spring-core/src/main/java/org/springframework/core/env/PropertySource.java index 868fdfa5059..a88223c941c 100644 --- a/spring-core/src/main/java/org/springframework/core/env/PropertySource.java +++ b/spring-core/src/main/java/org/springframework/core/env/PropertySource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 the original author or authors. + * Copyright 2002-2022 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. @@ -134,9 +134,9 @@ public abstract class PropertySource { *

No properties other than {@code name} are evaluated. */ @Override - public boolean equals(@Nullable Object other) { - return (this == other || (other instanceof PropertySource && - ObjectUtils.nullSafeEquals(getName(), ((PropertySource) other).getName()))); + public boolean equals(@Nullable Object obj) { + return (this == obj || (obj instanceof PropertySource other && + ObjectUtils.nullSafeEquals(getName(), other.getName()))); } /**