Skip to content

Commit 4273c4a

Browse files
committed
Adjust LookupWriter to log at WARN rather than ERROR due to Quarkus dev mode
Die to Quarkus dev mode (#3541 #3582) we want to log FilerException at WARN level rather than ERROR. This is because Quarkus dev mode will invoke the annotation processor more than usual, so we expect to fail with the FilerException.
1 parent 51424d9 commit 4273c4a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

querybean-generator/src/main/java/io/ebean/querybean/generator/LookupWriter.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@
77
import java.util.Collection;
88
import java.util.Set;
99

10+
import javax.annotation.processing.FilerException;
1011
import javax.annotation.processing.RoundEnvironment;
1112
import javax.lang.model.element.TypeElement;
1213
import javax.lang.model.util.Elements;
1314
import javax.tools.FileObject;
1415

1516
/** Write the source code for the factory. */
16-
class LookupWriter {
17+
final class LookupWriter {
1718
private LookupWriter() {}
1819

1920
private static final String METAINF_SERVICES_LOOKUP =
@@ -58,21 +59,20 @@ static void write(
5859
String fqn = pkg + ".EbeanMethodLookup";
5960
try {
6061
var javaFileObject = processingContext.createWriter(fqn);
61-
6262
var writer = new Append(javaFileObject.openWriter());
6363

6464
writer.append(FILE_STRING, pkg);
6565
writer.close();
6666
writeServicesFile(processingContext, fqn);
67+
} catch (FilerException e) {
68+
processingContext.logWarn(null, "FilerException writing Lookup " + e.getMessage());
6769
} catch (IOException e) {
6870
processingContext.logError(null, "Failed to write lookup class " + e.getMessage());
6971
}
7072
}
7173
}
7274

73-
private static void writeServicesFile(ProcessingContext processingContext, String fqn)
74-
throws IOException {
75-
75+
private static void writeServicesFile(ProcessingContext processingContext, String fqn) throws IOException {
7676
FileObject jfo = processingContext.createMetaInfWriter(METAINF_SERVICES_LOOKUP);
7777
if (jfo != null) {
7878
Writer writer = jfo.openWriter();

0 commit comments

Comments
 (0)