diff --git a/spring-core/src/main/java/org/springframework/core/annotation/AnnotatedElementUtils.java b/spring-core/src/main/java/org/springframework/core/annotation/AnnotatedElementUtils.java
index 2766e07066..74549cf2f4 100644
--- a/spring-core/src/main/java/org/springframework/core/annotation/AnnotatedElementUtils.java
+++ b/spring-core/src/main/java/org/springframework/core/annotation/AnnotatedElementUtils.java
@@ -296,7 +296,7 @@ public class AnnotatedElementUtils {
*/
public static A getMergedAnnotation(AnnotatedElement element, Class annotationType) {
AnnotationAttributes attributes = getMergedAnnotationAttributes(element, annotationType);
- return (attributes != null ? AnnotationUtils.synthesizeAnnotation(attributes, annotationType, element) : null);
+ return AnnotationUtils.synthesizeAnnotation(attributes, annotationType, element);
}
/**
@@ -401,8 +401,7 @@ public class AnnotatedElementUtils {
public static A findMergedAnnotation(AnnotatedElement element, Class annotationType) {
Assert.notNull(annotationType, "annotationType must not be null");
AnnotationAttributes attributes = findMergedAnnotationAttributes(element, annotationType, false, false);
- return (attributes != null ?
- AnnotationUtils.synthesizeAnnotation(attributes, annotationType, element) : null);
+ return AnnotationUtils.synthesizeAnnotation(attributes, annotationType, element);
}
/**
@@ -429,8 +428,7 @@ public class AnnotatedElementUtils {
@SuppressWarnings("unchecked")
public static A findMergedAnnotation(AnnotatedElement element, String annotationName) {
AnnotationAttributes attributes = findMergedAnnotationAttributes(element, annotationName, false, false);
- return (attributes != null ?
- AnnotationUtils.synthesizeAnnotation(attributes, (Class) attributes.annotationType(), element) : null);
+ return AnnotationUtils.synthesizeAnnotation(attributes, (Class) attributes.annotationType(), element);
}
/**
diff --git a/spring-core/src/main/java/org/springframework/util/StringUtils.java b/spring-core/src/main/java/org/springframework/util/StringUtils.java
index fda4d2a16a..6d470ae88e 100644
--- a/spring-core/src/main/java/org/springframework/util/StringUtils.java
+++ b/spring-core/src/main/java/org/springframework/util/StringUtils.java
@@ -527,7 +527,7 @@ public abstract class StringUtils {
}
/**
- * Extract the filename from the given path,
+ * Extract the filename from the given Java resource path,
* e.g. {@code "mypath/myfile.txt" -> "myfile.txt"}.
* @param path the file path (may be {@code null})
* @return the extracted filename, or {@code null} if none
@@ -541,7 +541,7 @@ public abstract class StringUtils {
}
/**
- * Extract the filename extension from the given path,
+ * Extract the filename extension from the given Java resource path,
* e.g. "mypath/myfile.txt" -> "txt".
* @param path the file path (may be {@code null})
* @return the extracted filename extension, or {@code null} if none
@@ -562,7 +562,7 @@ public abstract class StringUtils {
}
/**
- * Strip the filename extension from the given path,
+ * Strip the filename extension from the given Java resource path,
* e.g. "mypath/myfile.txt" -> "mypath/myfile".
* @param path the file path (may be {@code null})
* @return the path with stripped filename extension,
@@ -584,7 +584,7 @@ public abstract class StringUtils {
}
/**
- * Apply the given relative path to the given path,
+ * Apply the given relative path to the given Java resource path,
* assuming standard Java folder separation (i.e. "/" separators).
* @param path the path to start from (usually a full file path)
* @param relativePath the relative path to apply