{"record":{"id":"5e440144c2057ddf","repo":"quarkusio/quarkus","slug":"converting-to-toformat-is-not-supported","errorCode":null,"errorMessage":"Converting to ${toFormat} is not supported","messagePattern":"Converting to (.+?) is not supported","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"core/processor/src/main/java/io/quarkus/annotation/processor/documentation/config/formatter/JavadocTransformer.java","lineNumber":17,"sourceCode":"package io.quarkus.annotation.processor.documentation.config.formatter;\n\nimport io.quarkus.annotation.processor.documentation.config.model.JavadocFormat;\n\npublic final class JavadocTransformer {\n\n    private JavadocTransformer() {\n    }\n\n    public static String transform(String javadoc, JavadocFormat fromFormat, JavadocFormat toFormat) {\n        switch (toFormat) {\n            case ASCIIDOC:\n                return JavadocToAsciidocTransformer.toAsciidoc(javadoc, fromFormat);\n            case MARKDOWN:\n                return JavadocToMarkdownTransformer.toMarkdown(javadoc, fromFormat);\n            default:\n                throw new IllegalArgumentException(\"Converting to \" + toFormat + \" is not supported\");\n        }\n    }\n}\n","sourceCodeStart":1,"sourceCodeEnd":21,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/core/processor/src/main/java/io/quarkus/annotation/processor/documentation/config/formatter/JavadocTransformer.java#L1-L21","documentation":"JavadocTransformer.transform dispatches Javadoc conversion by target format: ASCIIDOC and MARKDOWN are supported; anything else (null or an unknown JavadocFormat) hits the default branch and throws IllegalArgumentException.","triggerScenarios":"Calling JavadocTransformer.transform(javadoc, fromFormat, toFormat) with toFormat that is neither ASCIIDOC nor MARKDOWN — typically a null format from an unset configuration or a newly added enum constant not yet handled in the switch.","commonSituations":"Custom doc tooling passing an uninitialized format variable; adding a new JavadocFormat constant to the enum without updating the transformer switch; configuration mistake in a documentation generation pipeline.","solutions":["Pass JavadocFormat.ASCIIDOC or JavadocFormat.MARKDOWN as the target format","Check for null/default format before calling transform","Update JavadocTransformer's switch to handle any newly added format enum constant","Audit the caller to see where the bad format value originates"],"exampleFix":"// before\nJavadocFormat toFormat = null; // unset\nString out = JavadocTransformer.transform(javadoc, from, toFormat);\n// after\nJavadocFormat toFormat = JavadocFormat.ASCIIDOC;\nString out = JavadocTransformer.transform(javadoc, from, toFormat);","handlingStrategy":"validation","validationCode":"Objects.requireNonNull(toFormat, \"toFormat must be set\");\nif (toFormat != JavadocFormat.ASCIIDOC && toFormat != JavadocFormat.MARKDOWN) {\n    throw new IllegalArgumentException(\"Unsupported target format: \" + toFormat);\n}","typeGuard":null,"tryCatchPattern":"try {\n    return JavadocTransformer.transform(javadoc, from, toFormat);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage() != null && e.getMessage().startsWith(\"Converting to\")) {\n        return JavadocTransformer.transform(javadoc, from, JavadocFormat.ASCIIDOC);\n    }\n    throw e;\n}","preventionTips":["Only pass ASCIIDOC or MARKDOWN as the target format","Default unset format variables to a valid enum constant","Update the transformer switch whenever JavadocFormat gains a new constant"],"tags":["annotation-processor","javadoc","enum","documentation"],"backgroundTag":"unsupported-format-conversion","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}