From 2d8e6c806db00fd87b86f4b135db1d459850beb1 Mon Sep 17 00:00:00 2001 From: Camotoy <20743703+Camotoy@users.noreply.github.com> Date: Sun, 26 May 2024 19:06:21 -0400 Subject: [PATCH] Friendly error if implementation name cannot be found --- .../interfaces/processor/ConfigImplementationGenerator.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/extra/interface/ap/src/main/java/org/spongepowered/configurate/interfaces/processor/ConfigImplementationGenerator.java b/extra/interface/ap/src/main/java/org/spongepowered/configurate/interfaces/processor/ConfigImplementationGenerator.java index e6c89dcd..b45cef94 100644 --- a/extra/interface/ap/src/main/java/org/spongepowered/configurate/interfaces/processor/ConfigImplementationGenerator.java +++ b/extra/interface/ap/src/main/java/org/spongepowered/configurate/interfaces/processor/ConfigImplementationGenerator.java @@ -188,6 +188,10 @@ private boolean gatherElementSpec( if (nodeTypeElement.getKind().isInterface()) { // first find the generated class for given type String implName = this.processor.generatedClasses().getProperty(configClass.reflectionName()); + if (implName == null) { + this.processor.printError("Could not determine an implementation type for method " + element.getSimpleName()); + return false; + } // make it canonical and replace superinterface type with source interface type if present implName = implName.replace('$', '.').replace(type.getQualifiedName(), this.source.getQualifiedName()); configClass = ClassName.bestGuess(implName);