Fix Weird Behavior in the Annotation Processor (#1645)
* fix: weird behavior of the annotation processor * optimize imports
This commit is contained in:
@@ -14,7 +14,6 @@ import com.velocitypowered.api.plugin.Plugin;
|
|||||||
import java.io.BufferedWriter;
|
import java.io.BufferedWriter;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.Writer;
|
import java.io.Writer;
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import javax.annotation.processing.AbstractProcessor;
|
import javax.annotation.processing.AbstractProcessor;
|
||||||
import javax.annotation.processing.ProcessingEnvironment;
|
import javax.annotation.processing.ProcessingEnvironment;
|
||||||
@@ -68,8 +67,8 @@ public class PluginAnnotationProcessor extends AbstractProcessor {
|
|||||||
|
|
||||||
Name qualifiedName = ((TypeElement) element).getQualifiedName();
|
Name qualifiedName = ((TypeElement) element).getQualifiedName();
|
||||||
|
|
||||||
if (Objects.equals(pluginClassFound, qualifiedName.toString())) {
|
if (pluginClassFound != null) {
|
||||||
if (!warnedAboutMultiplePlugins) {
|
if (!pluginClassFound.equals(qualifiedName.toString()) && !warnedAboutMultiplePlugins) {
|
||||||
environment.getMessager()
|
environment.getMessager()
|
||||||
.printMessage(Diagnostic.Kind.WARNING, "Velocity does not yet currently support "
|
.printMessage(Diagnostic.Kind.WARNING, "Velocity does not yet currently support "
|
||||||
+ "multiple plugins. We are using " + pluginClassFound
|
+ "multiple plugins. We are using " + pluginClassFound
|
||||||
|
|||||||
Reference in New Issue
Block a user