{"record":{"id":"b316fb3d120a69e8","repo":"apple/pkl","slug":"standard-library-class-pclass-qualifiedname-i","errorCode":null,"errorMessage":"Standard library class `${pClass.qualifiedName}` is not supported by Java code generator. If you think this is an omission, please let us know.","messagePattern":"Standard library class `(.+?)` is not supported by Java code generator\\. If you think this is an omission, please let us know\\.","errorType":"exception","errorClass":"JavaCodeGeneratorException","httpStatus":null,"severity":"error","filePath":"pkl-codegen-java/src/main/kotlin/org/pkl/codegen/java/JavaCodeGenerator.kt","lineNumber":847,"sourceCode":"                } else {\n                  typeArguments[0].toJavaPoetTypeArgumentName()\n                },\n                if (typeArguments.isEmpty()) {\n                  OBJECT\n                } else {\n                  typeArguments[1].toJavaPoetTypeArgumentName()\n                },\n              )\n              .nullableIf(nullable)\n          PClassInfo.Module -> PMODULE.nullableIf(nullable)\n          PClassInfo.Class -> PCLASS.nullableIf(nullable)\n          PClassInfo.Regex -> PATTERN.nullableIf(nullable)\n          PClassInfo.Version -> VERSION.nullableIf(nullable)\n          else ->\n            when {\n              !classInfo.isStandardLibraryClass -> pClass.toJavaPoetName().nullableIf(nullable)\n              else ->\n                throw JavaCodeGeneratorException(\n                  \"Standard library class `${pClass.qualifiedName}` is not supported by Java code generator. \" +\n                    \"If you think this is an omission, please let us know.\"\n                )\n            }\n        }\n      }\n      is PType.Nullable -> baseType.toJavaPoetName(nullable = true, boxed = true)\n      is PType.Constrained -> baseType.toJavaPoetName(nullable = nullable, boxed = boxed)\n      is PType.Alias ->\n        when (typeAlias.qualifiedName) {\n          \"pkl.base#NonNull\" -> OBJECT.nullableIf(nullable)\n          \"pkl.base#Int8\" -> TypeName.BYTE.boxIf(boxed).nullableIf(nullable)\n          \"pkl.base#Int16\",\n          \"pkl.base#UInt8\" -> TypeName.SHORT.boxIf(boxed).nullableIf(nullable)\n          \"pkl.base#Int32\",\n          \"pkl.base#UInt16\" -> TypeName.INT.boxIf(boxed).nullableIf(nullable)\n          \"pkl.base#UInt\",\n          \"pkl.base#UInt32\" -> TypeName.LONG.boxIf(boxed).nullableIf(nullable)","sourceCodeStart":829,"sourceCodeEnd":865,"githubUrl":"https://github.com/apple/pkl/blob/f3efcbfc9b60d30053b0536d664948d7aa1b8673/pkl-codegen-java/src/main/kotlin/org/pkl/codegen/java/JavaCodeGenerator.kt#L829-L865","documentation":"Standard-library Pkl classes other than the explicitly mapped ones (Regex, Version, etc.) cannot be translated to Java types, so toJavaPoetName throws. The message invites filing an issue since the omission may just be unmapped support.","triggerScenarios":"A generated schema contains a property whose type is a stdlib class (e.g. some pkl.base or pkl.collection class not in the mapping table) — PClassInfo that isStandardLibraryClass and not one of the handled cases.","commonSituations":"Using less-common pkl.base classes (e.g. IntSeq, List/Map exotic usages beyond mapped ones) or newer stdlib classes introduced before the generator added mappings.","solutions":["Change the Pkl property type to a supported class (String, Int, Duration, DataSize, Regex, Version, collections, etc.).","Upgrade the pkl-codegen-java version — newer versions map more stdlib classes.","Wrap or replace the exotic stdlib type with your own class.","File an upstream issue asking for the class to be mapped, as the message suggests."],"exampleFix":"// before (Pkl)\nids: IntSeq\n// after\nids: List<Int>","handlingStrategy":"validation","validationCode":"fun isMappedStdlibClass(c: PClass) = c.isStandardLibraryClass && c.qualifiedName in setOf(\"pkl.base#Regex\",\"pkl.base#Version\")","typeGuard":null,"tryCatchPattern":"try { generate() } catch (e: JavaCodeGeneratorException) { if (\"Standard library class\" in e.message!! && \"not supported\" in e.message!!) replaceType() else throw e }","preventionTips":["Restrict generated schemas to known-mapped stdlib classes","Prefer basic/collection types in codegen-facing modules","Upgrade the generator when adopting new stdlib classes"],"tags":["codegen","stdlib","type-mapping"],"backgroundTag":"unsupported-operation","analyzedSha":"f3efcbfc9b60d30053b0536d664948d7aa1b8673","analyzedAt":"2026-09-08T13:10:45.570Z","contentChangedAt":"2026-09-08T13:10:45.570Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}