{"record":{"id":"c07211d6e1b045c6","repo":"windmill-labs/windmill","slug":"unexpected-java-type-node-kind-for-this","errorCode":null,"errorMessage":"Unexpected Java type node kind: {} for '{}'. This type is not handled by Windmill, please open an issue if this seems to be an error","messagePattern":"Unexpected Java type node kind: (.+?) for '(.+?)'\\. This type is not handled by Windmill, please open an issue if this seems to be an error","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"backend/parsers/windmill-parser-java/src/lib.rs","lineNumber":148,"sourceCode":"                Ok(\"double\") => (Typ::Float, None),\n                Ok(s) => bail!(\"Unknown type `{s}`\"),\n                Err(e) => bail!(\"Error getting type name: {}\", e),\n            }\n        }\n        \"boolean_type\" => {\n            match typ_node.utf8_text(code.as_bytes()) {\n                Ok(\"boolean\") => (Typ::Bool, None),\n                Ok(s) => bail!(\"Unknown type `{s}`\"),\n                Err(e) => bail!(\"Error getting type name: {}\", e),\n            }\n        }\n        \"array_type\" => {\n            let new_typ_node = typ_node\n                .named_child(0)\n                .ok_or(anyhow!(\"Failed to find inner type of array type\"))?;\n            (Typ::List(Box::new(find_typ(new_typ_node, code)?.0)), null)\n        }\n        wc => bail!(\n            \"Unexpected Java type node kind: {} for '{}'. This type is not handled by Windmill, please open an issue if this seems to be an error\",\n            wc,\n            typ_node.utf8_text(code.as_bytes())?\n        ),\n\n    };\n    Ok(res)\n}\n\nfn parse_java_typ<'a>(\n    param_node: Node<'a>,\n    code: &str,\n) -> anyhow::Result<(Option<String>, Typ, String, Option<Value>)> {\n    let name = param_node\n        .child_by_field_name(\"name\")\n        .and_then(|n| n.utf8_text(code.as_bytes()).ok())\n        .unwrap_or(\"\");\n    let otyp_node = param_node.child_by_field_name(\"type\");","sourceCodeStart":130,"sourceCodeEnd":166,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/backend/parsers/windmill-parser-java/src/lib.rs#L130-L166","documentation":"windmill-parser-java's find_typ maps tree-sitter Java type nodes (primitive types, generic_type, array_type, etc.) to Windmill Typs. Any type node kind outside the handled match arms falls through to this bail. It means the script declares a parameter whose Java type expression the parser has no mapping for, so the signature cannot be inferred.","triggerScenarios":"Declaring a main/worker function parameter with an unsupported Java type node kind — e.g. wildcard types (`List<?>`), annotated types, intersection types, nested/qualified inner types, or other tree-sitter node kinds not in the handled list — when deploying a Java script to Windmill.","commonSituations":"Using generic wildcards (`Map<String, ?>`) or arrays-of-generics edge cases; using types the parser never got an arm for like `var`; copy-pasting library types with annotations (`@NotNull String[]` forms parsed differently).","solutions":["Replace the unsupported type with a supported one: primitive types, String, boxed primitives, simple generics like List<T>/T[], plain arrays.","Use `Object` as a fallback parameter type if the value shape is opaque to Windmill.","Simplify nested types (e.g. `List<List<String>>` or wildcard `List<?>`) to a concrete supported form.","If a common type is rejected, open an issue as the message suggests, including the parameter declaration."],"exampleFix":"// before\nvoid main(Map<String, ?> params) {\n// after\nvoid main(Map<String, Object> params) {","handlingStrategy":"validation","validationCode":"const SUPPORTED = /^(String|Byte|Short|Integer|Long|Float|Double|Boolean|Character|Object|byte|short|int|long|char|float|double|boolean)$/;\nfunction validateJavaParamType(t) {\n  const base = t.replace(/\\[\\s*\\]/g, '').trim();\n  if (SUPPORTED.test(base)) return null;\n  if (/^(List|Map|Set)</.test(base) && !base.includes('?')) return null;\n  return `Java type '${t}' is not handled; use primitives, String, boxed types, List<T>/T[] or Object`;\n}","typeGuard":null,"tryCatchPattern":"try {\n  const sig = parseJavaSignature(source);\n} catch (e) {\n  if (String(e).includes('Unexpected Java type node kind')) {\n    throw new Error(`Unsupported Java parameter type: simplify it (no wildcards/var/annotations), or wrap as Object`);\n  }\n  throw e;\n}","preventionTips":["Restrict main() parameter types to primitives, String, boxed types, simple generics and arrays","Avoid wildcards (?), var, intersection types and annotated type expressions in entrypoint signatures","Test signature parsing locally before deploying the script"],"tags":["java","parser","unsupported-type"],"backgroundTag":"unsupported-type-signature","analyzedSha":"e474e8803ce2ff5c2df09a58dab51d45f5c922ca","analyzedAt":"2026-09-03T12:38:19.024Z","contentChangedAt":"2026-09-03T12:38:19.024Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}