From 45d5dd39d3aefdd494b9229db6378eadb1c57464 Mon Sep 17 00:00:00 2001 From: Jordan Zimmerman Date: Sun, 31 Mar 2024 10:51:54 +0100 Subject: [PATCH] x --- .../recordbuilder/processor/RecordBuilderProcessor.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/record-builder-processor/src/main/java/io/soabase/recordbuilder/processor/RecordBuilderProcessor.java b/record-builder-processor/src/main/java/io/soabase/recordbuilder/processor/RecordBuilderProcessor.java index 5faf1952..6dae123a 100644 --- a/record-builder-processor/src/main/java/io/soabase/recordbuilder/processor/RecordBuilderProcessor.java +++ b/record-builder-processor/src/main/java/io/soabase/recordbuilder/processor/RecordBuilderProcessor.java @@ -280,9 +280,11 @@ private void handleWriteError(TypeElement element, IOException e) { } private void deletePossibleClassFile(String packageName, String className, Location location) { + String extension = location.equals(StandardLocation.CLASS_OUTPUT) ? ".class" : ".java"; + try { FileObject resource = processingEnv.getFiler().getResource(location, packageName, - className + ".class"); + className + extension); File file = new File(resource.toUri()); processingEnv.getMessager().printMessage(Diagnostic.Kind.MANDATORY_WARNING, "Exists: %s File: %s".formatted(file.exists(), file));