Skip to content

Commit 5778e59

Browse files
committed
Improve Javadoc of ReflectionSupport.tryToGetResources methods
Closes #4791.
1 parent e1f503f commit 5778e59

File tree

2 files changed

+10
-24
lines changed

2 files changed

+10
-24
lines changed

junit-platform-commons/src/main/java/org/junit/platform/commons/support/ReflectionSupport.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,10 @@ public static Try<Class<?>> tryToLoadClass(String name, ClassLoader classLoader)
104104
*
105105
* @param classpathResourceName the name of the resource to load; never
106106
* {@code null} or blank
107-
* @return a successful {@code Try} containing the loaded resources or a failed
108-
* {@code Try} containing the exception if no such resources could be loaded;
109-
* never {@code null}
107+
* @return a successful {@code Try} containing the set of loaded resources
108+
* (potentially empty) or a failed {@code Try} containing the exception in
109+
* case a failure occurred while trying to list resources; never
110+
* {@code null}
110111
* @since 1.12
111112
* @see #tryToGetResources(String, ClassLoader)
112113
*/
@@ -128,9 +129,10 @@ public static Try<Set<Resource>> tryToGetResources(String classpathResourceName)
128129
* @param classpathResourceName the name of the resource to load; never
129130
* {@code null} or blank
130131
* @param classLoader the {@code ClassLoader} to use; never {@code null}
131-
* @return a successful {@code Try} containing the loaded resources or a failed
132-
* {@code Try} containing the exception if no such resources could be loaded;
133-
* never {@code null}
132+
* @return a successful {@code Try} containing the set of loaded resources
133+
* (potentially empty) or a failed {@code Try} containing the exception in
134+
* case a failure occurred while trying to list resources; never
135+
* {@code null}
134136
* @since 1.12
135137
* @see #tryToGetResources(String)
136138
*/

junit-platform-commons/src/main/java/org/junit/platform/commons/util/ReflectionUtils.java

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -774,31 +774,15 @@ public static Try<Class<?>> tryToLoadClass(String name, ClassLoader classLoader)
774774
}
775775

776776
/**
777-
* Try to get {@linkplain Resource resources} by their name, using the
778-
* {@link ClassLoaderUtils#getDefaultClassLoader()}.
779-
*
780-
* <p>See {@link org.junit.platform.commons.support.ReflectionSupport#tryToGetResources(String)}
781-
* for details.
782-
*
783-
* @param classpathResourceName the name of the resources to load; never {@code null} or blank
784-
* @since 1.12
785-
* @see org.junit.platform.commons.support.ReflectionSupport#tryToGetResources(String, ClassLoader)
777+
* @see org.junit.platform.commons.support.ReflectionSupport#tryToGetResources(String)
786778
*/
787779
@API(status = INTERNAL, since = "1.12")
788780
public static Try<Set<Resource>> tryToGetResources(String classpathResourceName) {
789781
return tryToGetResources(classpathResourceName, ClassLoaderUtils.getDefaultClassLoader());
790782
}
791783

792784
/**
793-
* Try to get {@linkplain Resource resources} by their name, using the
794-
* supplied {@link ClassLoader}.
795-
*
796-
* <p>See {@link org.junit.platform.commons.support.ReflectionSupport#tryToGetResources(String, ClassLoader)}
797-
* for details.
798-
*
799-
* @param classpathResourceName the name of the resources to load; never {@code null} or blank
800-
* @param classLoader the {@code ClassLoader} to use; never {@code null}
801-
* @since 1.12
785+
* @see org.junit.platform.commons.support.ReflectionSupport#tryToGetResources(String, ClassLoader)
802786
*/
803787
@API(status = INTERNAL, since = "1.12")
804788
public static Try<Set<Resource>> tryToGetResources(String classpathResourceName, ClassLoader classLoader) {

0 commit comments

Comments
 (0)