Skip to content

Commit

Permalink
Reformat imports
Browse files Browse the repository at this point in the history
  • Loading branch information
ImMorpheus committed Mar 9, 2024
1 parent c61f0ce commit 08e9471
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
*/
package org.spongepowered.plugin.processor;

import static javax.tools.Diagnostic.Kind.ERROR;

import org.checkerframework.checker.nullness.qual.Nullable;
import org.spongepowered.api.event.Event;
import org.spongepowered.api.event.Listener;
Expand Down Expand Up @@ -57,6 +55,7 @@
import javax.lang.model.type.TypeMirror;
import javax.lang.model.util.Elements;
import javax.lang.model.util.Types;
import javax.tools.Diagnostic;

@SupportedAnnotationTypes(ListenerProcessor.LISTENER_ANNOTATION_CLASS)
@SupportedSourceVersion(SourceVersion.RELEASE_17)
Expand All @@ -82,7 +81,7 @@ public boolean process(final Set<? extends TypeElement> annotations, final Round
if (ProcessorUtils.contains(annotations, Listener.class)) {
for (final Element e : roundEnv.getElementsAnnotatedWith(Listener.class)) {
if (e.getKind() != ElementKind.METHOD) {
this.processingEnv.getMessager().printMessage(ERROR, "Invalid element of type " + e.getKind() + " annotated with @Listener", e);
this.processingEnv.getMessager().printMessage(Diagnostic.Kind.ERROR, "Invalid element of type " + e.getKind() + " annotated with @Listener", e);
continue;
}
final ExecutableElement method = (ExecutableElement) e;
Expand Down Expand Up @@ -183,11 +182,11 @@ private boolean isTypeSubclass(final Element typedElement, final String subclass
// Error collection

private void error(final CharSequence message, final Element element) {
this.processingEnv.getMessager().printMessage(ERROR, message, element);
this.processingEnv.getMessager().printMessage(Diagnostic.Kind.ERROR, message, element);
}

private void error(final CharSequence message, final Element element, final AnnotationMirror annotation, final AnnotationValue value) {
this.processingEnv.getMessager().printMessage(ERROR, message, element, annotation, value);
this.processingEnv.getMessager().printMessage(Diagnostic.Kind.ERROR, message, element, annotation, value);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
import org.spongepowered.api.event.advancement.CriterionEvent;
import org.spongepowered.api.registry.DefaultedRegistryValue;
import org.spongepowered.api.scoreboard.criteria.Criterion;
import org.spongepowered.api.util.Builder;
import org.spongepowered.api.util.CopyableBuilder;
import org.spongepowered.api.util.annotation.CatalogedBy;
import org.spongepowered.configurate.ConfigurationOptions;
Expand Down
9 changes: 4 additions & 5 deletions src/main/java/org/spongepowered/api/event/Listener.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,16 @@
*/
package org.spongepowered.api.event;

import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
* Used to annotate a method as an {@link EventListener}.
*/
@Retention(RUNTIME)
@Target(METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface Listener {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import org.spongepowered.api.advancement.criteria.ScoreAdvancementCriterion;
import org.spongepowered.api.advancement.criteria.trigger.FilteredTrigger;
import org.spongepowered.api.advancement.criteria.trigger.FilteredTriggerConfiguration;
import org.spongepowered.api.advancement.criteria.trigger.Trigger;
import org.spongepowered.api.event.Cancellable;
import org.spongepowered.api.event.Cause;
import org.spongepowered.api.event.GenericEvent;
Expand Down

0 comments on commit 08e9471

Please sign in to comment.