Polishing

This commit is contained in:
Juergen Hoeller 2015-12-07 12:52:06 +01:00
parent 7a8a9c71b6
commit ee35b5ed07
2 changed files with 7 additions and 9 deletions

View File

@ -296,7 +296,7 @@ public class AnnotatedElementUtils {
*/ */
public static <A extends Annotation> A getMergedAnnotation(AnnotatedElement element, Class<A> annotationType) { public static <A extends Annotation> A getMergedAnnotation(AnnotatedElement element, Class<A> annotationType) {
AnnotationAttributes attributes = getMergedAnnotationAttributes(element, 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 extends Annotation> A findMergedAnnotation(AnnotatedElement element, Class<A> annotationType) { public static <A extends Annotation> A findMergedAnnotation(AnnotatedElement element, Class<A> annotationType) {
Assert.notNull(annotationType, "annotationType must not be null"); Assert.notNull(annotationType, "annotationType must not be null");
AnnotationAttributes attributes = findMergedAnnotationAttributes(element, annotationType, false, false); AnnotationAttributes attributes = findMergedAnnotationAttributes(element, annotationType, false, false);
return (attributes != null ? return AnnotationUtils.synthesizeAnnotation(attributes, annotationType, element);
AnnotationUtils.synthesizeAnnotation(attributes, annotationType, element) : null);
} }
/** /**
@ -429,8 +428,7 @@ public class AnnotatedElementUtils {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public static <A extends Annotation> A findMergedAnnotation(AnnotatedElement element, String annotationName) { public static <A extends Annotation> A findMergedAnnotation(AnnotatedElement element, String annotationName) {
AnnotationAttributes attributes = findMergedAnnotationAttributes(element, annotationName, false, false); AnnotationAttributes attributes = findMergedAnnotationAttributes(element, annotationName, false, false);
return (attributes != null ? return AnnotationUtils.synthesizeAnnotation(attributes, (Class<A>) attributes.annotationType(), element);
AnnotationUtils.synthesizeAnnotation(attributes, (Class<A>) attributes.annotationType(), element) : null);
} }
/** /**

View File

@ -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"}. * e.g. {@code "mypath/myfile.txt" -> "myfile.txt"}.
* @param path the file path (may be {@code null}) * @param path the file path (may be {@code null})
* @return the extracted filename, or {@code null} if none * @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". * e.g. "mypath/myfile.txt" -> "txt".
* @param path the file path (may be {@code null}) * @param path the file path (may be {@code null})
* @return the extracted filename extension, or {@code null} if none * @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". * e.g. "mypath/myfile.txt" -> "mypath/myfile".
* @param path the file path (may be {@code null}) * @param path the file path (may be {@code null})
* @return the path with stripped filename extension, * @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). * assuming standard Java folder separation (i.e. "/" separators).
* @param path the path to start from (usually a full file path) * @param path the path to start from (usually a full file path)
* @param relativePath the relative path to apply * @param relativePath the relative path to apply