Skip to content

Commit ee35b5e

Browse files
committed
Polishing
1 parent 7a8a9c7 commit ee35b5e

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

spring-core/src/main/java/org/springframework/core/annotation/AnnotatedElementUtils.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ public Boolean process(AnnotatedElement annotatedElement, Annotation annotation,
296296
*/
297297
public static <A extends Annotation> A getMergedAnnotation(AnnotatedElement element, Class<A> annotationType) {
298298
AnnotationAttributes attributes = getMergedAnnotationAttributes(element, annotationType);
299-
return (attributes != null ? AnnotationUtils.synthesizeAnnotation(attributes, annotationType, element) : null);
299+
return AnnotationUtils.synthesizeAnnotation(attributes, annotationType, element);
300300
}
301301

302302
/**
@@ -401,8 +401,7 @@ public static AnnotationAttributes getMergedAnnotationAttributes(AnnotatedElemen
401401
public static <A extends Annotation> A findMergedAnnotation(AnnotatedElement element, Class<A> annotationType) {
402402
Assert.notNull(annotationType, "annotationType must not be null");
403403
AnnotationAttributes attributes = findMergedAnnotationAttributes(element, annotationType, false, false);
404-
return (attributes != null ?
405-
AnnotationUtils.synthesizeAnnotation(attributes, annotationType, element) : null);
404+
return AnnotationUtils.synthesizeAnnotation(attributes, annotationType, element);
406405
}
407406

408407
/**
@@ -429,8 +428,7 @@ public static <A extends Annotation> A findMergedAnnotation(AnnotatedElement ele
429428
@SuppressWarnings("unchecked")
430429
public static <A extends Annotation> A findMergedAnnotation(AnnotatedElement element, String annotationName) {
431430
AnnotationAttributes attributes = findMergedAnnotationAttributes(element, annotationName, false, false);
432-
return (attributes != null ?
433-
AnnotationUtils.synthesizeAnnotation(attributes, (Class<A>) attributes.annotationType(), element) : null);
431+
return AnnotationUtils.synthesizeAnnotation(attributes, (Class<A>) attributes.annotationType(), element);
434432
}
435433

436434
/**

spring-core/src/main/java/org/springframework/util/StringUtils.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ private static String changeFirstCharacterCase(String str, boolean capitalize) {
527527
}
528528

529529
/**
530-
* Extract the filename from the given path,
530+
* Extract the filename from the given Java resource path,
531531
* e.g. {@code "mypath/myfile.txt" -> "myfile.txt"}.
532532
* @param path the file path (may be {@code null})
533533
* @return the extracted filename, or {@code null} if none
@@ -541,7 +541,7 @@ public static String getFilename(String path) {
541541
}
542542

543543
/**
544-
* Extract the filename extension from the given path,
544+
* Extract the filename extension from the given Java resource path,
545545
* e.g. "mypath/myfile.txt" -> "txt".
546546
* @param path the file path (may be {@code null})
547547
* @return the extracted filename extension, or {@code null} if none
@@ -562,7 +562,7 @@ public static String getFilenameExtension(String path) {
562562
}
563563

564564
/**
565-
* Strip the filename extension from the given path,
565+
* Strip the filename extension from the given Java resource path,
566566
* e.g. "mypath/myfile.txt" -> "mypath/myfile".
567567
* @param path the file path (may be {@code null})
568568
* @return the path with stripped filename extension,
@@ -584,7 +584,7 @@ public static String stripFilenameExtension(String path) {
584584
}
585585

586586
/**
587-
* Apply the given relative path to the given path,
587+
* Apply the given relative path to the given Java resource path,
588588
* assuming standard Java folder separation (i.e. "/" separators).
589589
* @param path the path to start from (usually a full file path)
590590
* @param relativePath the relative path to apply

0 commit comments

Comments
 (0)