Browse Source

Polishing

pull/921/merge
Juergen Hoeller 9 years ago
parent
commit
ee35b5ed07
  1. 8
      spring-core/src/main/java/org/springframework/core/annotation/AnnotatedElementUtils.java
  2. 8
      spring-core/src/main/java/org/springframework/util/StringUtils.java

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

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

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

@ -527,7 +527,7 @@ public abstract class StringUtils { @@ -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 { @@ -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 { @@ -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 { @@ -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

Loading…
Cancel
Save