Reformat project

This commit is contained in:
broccolai 2020-12-07 12:01:30 +00:00 committed by Alexander Söderberg
parent 01d36aecd8
commit 237eda75ef
30 changed files with 130 additions and 87 deletions

View file

@ -141,7 +141,8 @@ public final class AnnotationParser<C> {
final A inner = getAnnotationRecursively(
AnnotationAccessor.of(annotation.annotationType()),
clazz,
checkedAnnotations);
checkedAnnotations
);
if (inner != null) {
innerCandidate = inner;
}

View file

@ -98,7 +98,7 @@ class MethodCommandExecutionHandler<C> implements CommandExecutionHandler<C> {
this.annotationAccessor
);
if (value != null) {
break;
break;
}
}
if (value != null) {

View file

@ -33,6 +33,7 @@ import java.lang.annotation.Target;
* {@link cloud.commandframework.annotations.CommandMethod}
* <p>
* This should only be used on {@code String[]}
*
* @since 1.2.0
*/
@Target(ElementType.METHOD)

View file

@ -97,26 +97,31 @@ class AnnotationParserTest {
final Method annotatedMethod = annotatedClass.getDeclaredMethod("annotatedMethod");
System.out.println("Looking for @CommandDescription");
final CommandDescription commandDescription = AnnotationParser.getMethodOrClassAnnotation(annotatedMethod,
CommandDescription.class);
final CommandDescription commandDescription = AnnotationParser.getMethodOrClassAnnotation(
annotatedMethod,
CommandDescription.class
);
Assertions.assertNotNull(commandDescription);
Assertions.assertEquals("Hello World!", commandDescription.value());
System.out.println("Looking for @CommandPermission");
final CommandPermission commandPermission = AnnotationParser.getMethodOrClassAnnotation(annotatedMethod,
CommandPermission.class);
final CommandPermission commandPermission = AnnotationParser.getMethodOrClassAnnotation(
annotatedMethod,
CommandPermission.class
);
Assertions.assertNotNull(commandPermission);
Assertions.assertEquals("some.permission", commandPermission.value());
System.out.println("Looking for @CommandMethod");
final CommandMethod commandMethod = AnnotationParser.getMethodOrClassAnnotation(annotatedMethod,
CommandMethod.class);
final CommandMethod commandMethod = AnnotationParser.getMethodOrClassAnnotation(
annotatedMethod,
CommandMethod.class
);
Assertions.assertNotNull(commandMethod);
Assertions.assertEquals("method", commandMethod.value());
System.out.println("Looking for @Regex");
@SuppressWarnings("unused")
final Regex regex = AnnotationParser.getMethodOrClassAnnotation(annotatedMethod, Regex.class);
@SuppressWarnings("unused") final Regex regex = AnnotationParser.getMethodOrClassAnnotation(annotatedMethod, Regex.class);
}
@Test
@ -162,6 +167,7 @@ class AnnotationParserTest {
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
private @interface AnnotatedAnnotation {
}
@ -181,6 +187,7 @@ class AnnotationParserTest {
@Target({ElementType.METHOD, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
private @interface Bad1 {
}
@ -188,6 +195,7 @@ class AnnotationParserTest {
@Target({ElementType.METHOD, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
private @interface Bad2 {
}