Skip to content

Commit a77c6fe

Browse files
committed
Fix @⁠API and @⁠since tag declarations
1 parent 598bc79 commit a77c6fe

File tree

5 files changed

+32
-14
lines changed

5 files changed

+32
-14
lines changed

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929
/**
3030
* Internal Kotlin-specific reflection utilities
3131
*
32-
* @since 5.13.3
32+
* @since 1.13.3
3333
*/
34-
@API(status = INTERNAL, since = "5.13.3")
34+
@API(status = INTERNAL, since = "1.13.3")
3535
public class KotlinReflectionUtils {
3636

3737
private static final String DEFAULT_IMPLS_CLASS_NAME = "DefaultImpls";
@@ -82,10 +82,7 @@ public static boolean isKotlinSuspendingFunction(Method method) {
8282
* <p>See
8383
* <a href="https://kotlinlang.org/docs/interfaces.html#jvm-default-method-generation-for-interface-functions">Kotlin documentation</a>
8484
* for details.
85-
*
86-
* @since 5.13.3
8785
*/
88-
@API(status = INTERNAL, since = "5.13.3")
8986
public static boolean isKotlinInterfaceDefaultImplsClass(Class<?> clazz) {
9087
if (!isKotlinType(clazz) || !DEFAULT_IMPLS_CLASS_NAME.equals(clazz.getSimpleName()) || !isStatic(clazz)) {
9188
return false;

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

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import static java.util.stream.Collectors.toCollection;
1515
import static java.util.stream.Collectors.toSet;
1616
import static org.apiguardian.api.API.Status.INTERNAL;
17-
import static org.apiguardian.api.API.Status.STABLE;
1817
import static org.junit.platform.commons.util.ReflectionUtils.HierarchyTraversalMode.BOTTOM_UP;
1918
import static org.junit.platform.commons.util.ReflectionUtils.HierarchyTraversalMode.TOP_DOWN;
2019

@@ -1107,7 +1106,10 @@ public static List<Class<?>> findNestedClasses(Class<?> clazz, Predicate<Class<?
11071106
return findNestedClasses(clazz, predicate, CycleErrorHandling.THROW_EXCEPTION);
11081107
}
11091108

1110-
@API(status = INTERNAL, since = "5.13.2")
1109+
/**
1110+
* @since 1.13.2
1111+
*/
1112+
@API(status = INTERNAL, since = "1.13.2")
11111113
public static List<Class<?>> findNestedClasses(Class<?> clazz, Predicate<Class<?>> predicate,
11121114
CycleErrorHandling errorHandling) {
11131115
Preconditions.notNull(clazz, "Class must not be null");
@@ -1136,6 +1138,7 @@ public static List<Class<?>> findNestedClasses(Class<?> clazz, Predicate<Class<?
11361138
* checked; never {@code null}
11371139
* @return {@code true} if such a nested class is present
11381140
* @throws JUnitException if a cycle is detected within an inner class hierarchy
1141+
* @since 1.13.2
11391142
*/
11401143
@API(status = INTERNAL, since = "1.13.2")
11411144
public static boolean isNestedClassPresent(Class<?> clazz, Predicate<Class<?>> predicate,
@@ -1150,14 +1153,18 @@ public static boolean isNestedClassPresent(Class<?> clazz, Predicate<Class<?>> p
11501153
}
11511154

11521155
/**
1153-
* since 1.10
1156+
* @since 1.10
11541157
* @see org.junit.platform.commons.support.ReflectionSupport#streamNestedClasses(Class, Predicate)
11551158
*/
1159+
@API(status = INTERNAL, since = "1.10")
11561160
public static Stream<Class<?>> streamNestedClasses(Class<?> clazz, Predicate<Class<?>> predicate) {
11571161
return findNestedClasses(clazz, predicate).stream();
11581162
}
11591163

1160-
@API(status = INTERNAL, since = "5.13.2")
1164+
/**
1165+
* @since 1.13.2
1166+
*/
1167+
@API(status = INTERNAL, since = "1.13.2")
11611168
public static Stream<Class<?>> streamNestedClasses(Class<?> clazz, Predicate<Class<?>> predicate,
11621169
CycleErrorHandling errorHandling) {
11631170
return findNestedClasses(clazz, predicate, errorHandling).stream();
@@ -1312,6 +1319,7 @@ public static List<Field> findFields(Class<?> clazz, Predicate<Field> predicate,
13121319
* @since 1.10
13131320
* @see org.junit.platform.commons.support.ReflectionSupport#streamFields(Class, Predicate, org.junit.platform.commons.support.HierarchyTraversalMode)
13141321
*/
1322+
@API(status = INTERNAL, since = "1.10")
13151323
public static Stream<Field> streamFields(Class<?> clazz, Predicate<Field> predicate,
13161324
HierarchyTraversalMode traversalMode) {
13171325

@@ -1453,6 +1461,9 @@ public static Optional<Method> findMethod(Class<?> clazz, String methodName, @Nu
14531461
return findMethod(clazz, methodName, resolveParameterTypes(clazz, methodName, parameterTypeNames));
14541462
}
14551463

1464+
/**
1465+
* @since 1.10
1466+
*/
14561467
@API(status = INTERNAL, since = "1.10")
14571468
public static Class<?>[] resolveParameterTypes(Class<?> clazz, String methodName,
14581469
@Nullable String parameterTypeNames) {
@@ -1539,7 +1550,7 @@ private static Optional<Method> findMethod(Class<?> clazz, Predicate<Method> pre
15391550
* @since 1.7
15401551
* @see #findMethod(Class, String, Class...)
15411552
*/
1542-
@API(status = STABLE, since = "1.7")
1553+
@API(status = INTERNAL, since = "1.7")
15431554
public static Method getRequiredMethod(Class<?> clazz, String methodName, Class<?>... parameterTypes) {
15441555
return ReflectionUtils.findMethod(clazz, methodName, parameterTypes).orElseThrow(() -> new JUnitException(
15451556
"Could not find method [%s] in class [%s]".formatted(methodName, clazz.getName())));
@@ -1575,6 +1586,7 @@ public static List<Method> findMethods(Class<?> clazz, Predicate<Method> predica
15751586
* @since 1.10
15761587
* @see org.junit.platform.commons.support.ReflectionSupport#streamMethods(Class, Predicate, org.junit.platform.commons.support.HierarchyTraversalMode)
15771588
*/
1589+
@API(status = INTERNAL, since = "1.10")
15781590
public static Stream<Method> streamMethods(Class<?> clazz, Predicate<Method> predicate,
15791591
HierarchyTraversalMode traversalMode) {
15801592

@@ -1886,6 +1898,9 @@ private static boolean isGeneric(Type type) {
18861898
return type instanceof TypeVariable || type instanceof GenericArrayType;
18871899
}
18881900

1901+
/**
1902+
* @since 1.11
1903+
*/
18891904
@API(status = INTERNAL, since = "1.11")
18901905
@SuppressWarnings("deprecation") // "AccessibleObject.isAccessible()" is deprecated in Java 9
18911906
public static <T extends Executable> T makeAccessible(T executable) {
@@ -1895,6 +1910,9 @@ public static <T extends Executable> T makeAccessible(T executable) {
18951910
return executable;
18961911
}
18971912

1913+
/**
1914+
* @since 1.12
1915+
*/
18981916
@API(status = INTERNAL, since = "1.12")
18991917
@SuppressWarnings("deprecation") // "AccessibleObject.isAccessible()" is deprecated in Java 9
19001918
public static Field makeAccessible(Field field) {
@@ -1958,7 +1976,10 @@ static Throwable getUnderlyingCause(Throwable t) {
19581976
return t;
19591977
}
19601978

1961-
@API(status = INTERNAL, since = "5.13.2")
1979+
/**
1980+
* @since 1.13.2
1981+
*/
1982+
@API(status = INTERNAL, since = "1.13.2")
19621983
public enum CycleErrorHandling {
19631984

19641985
THROW_EXCEPTION {

junit-platform-engine/src/main/java/org/junit/platform/engine/support/store/NamespacedHierarchicalStore.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public NamespacedHierarchicalStore<N> newChild() {
9696
* <p>If this store does not have a parent, an empty {@code Optional} is returned.
9797
*
9898
* @return an {@code Optional} containing the parent store, or an empty {@code Optional} if there is no parent
99-
* @since 5.13
99+
* @since 1.13
100100
*/
101101
@API(status = EXPERIMENTAL, since = "6.0")
102102
public Optional<NamespacedHierarchicalStore<N>> getParent() {

junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/DelegatingLauncherDiscoveryRequest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import org.junit.platform.launcher.PostDiscoveryFilter;
2323

2424
/**
25-
* @since 5.13
25+
* @since 1.13
2626
*/
2727
class DelegatingLauncherDiscoveryRequest implements LauncherDiscoveryRequest {
2828

junit-platform-reporting/src/main/java/org/junit/platform/reporting/open/xml/GitInfoCollector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
import org.junit.platform.commons.util.StringUtils;
2929

3030
/**
31-
* @since 5.13.2
31+
* @since 1.13.2
3232
*/
3333
interface GitInfoCollector {
3434

0 commit comments

Comments
 (0)