From f0b3c0341fbc7fedb1349cdc4bcef1677a273a42 Mon Sep 17 00:00:00 2001 From: Lukas Eder Date: Mon, 21 Nov 2022 11:13:30 +0100 Subject: [PATCH] [jOOQ/jOOQ#14255] Improve generated unknown data type javadoc when forcedTypes match return type, but there are still unknown parameter types --- .../src/main/java/org/jooq/codegen/JavaGenerator.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/jOOQ-codegen/src/main/java/org/jooq/codegen/JavaGenerator.java b/jOOQ-codegen/src/main/java/org/jooq/codegen/JavaGenerator.java index 943672a074..f9051a188e 100644 --- a/jOOQ-codegen/src/main/java/org/jooq/codegen/JavaGenerator.java +++ b/jOOQ-codegen/src/main/java/org/jooq/codegen/JavaGenerator.java @@ -8239,17 +8239,21 @@ public class JavaGenerator extends AbstractGenerator { private boolean printDeprecationIfUnknownTypes(JavaWriter out, Collection params) { for (ParameterDefinition param : params) - if (printDeprecationIfUnknownType(out, getJavaType(param.getType(resolver(out)), out))) + if (printDeprecationIfUnknownType(out, getJavaType(param.getType(resolver(out)), out), "Parameter type or return type is unknown. ")) return true; return false; } private boolean printDeprecationIfUnknownType(JavaWriter out, String type) { + return printDeprecationIfUnknownType(out, type, ""); + } + + private boolean printDeprecationIfUnknownType(JavaWriter out, String type, String precision) { if (generateDeprecationOnUnknownTypes() && (Object.class.getName().equals(type) || kotlin && "Any".equals(type))) { if (kotlin) { out.println("@%s(message = \"%s\")", out.ref("kotlin.Deprecated"), escapeString( - "Unknown data type. " + "Unknown data type. " + precision + "If this is a qualified, user-defined type, it may have been excluded from code generation. " + "If this is a built-in type, you can define an explicit org.jooq.Binding to specify how this type should be handled. " + "Deprecation can be turned off using in your code generator configuration." @@ -8257,7 +8261,7 @@ public class JavaGenerator extends AbstractGenerator { } else { out.javadoc("@deprecated " - + "Unknown data type. " + + "Unknown data type. " + precision + "If this is a qualified, user-defined type, it may have been excluded from code generation. " + "If this is a built-in type, you can define an explicit {@link org.jooq.Binding} to specify how this type should be handled. " + "Deprecation can be turned off using {@literal } in your code generator configuration."