{"record":{"id":"a95ac0df9e02f3a4","repo":"xai-org/x-algorithm","slug":"unsupported-field-type-s-a95ac0","errorCode":null,"errorMessage":"Unsupported field type %s","messagePattern":"Unsupported field type (.+?)","errorType":"exception","errorClass":"SemanticCheckFailure","httpStatus":null,"severity":"error","filePath":"botmaker/src/java/com/twitter/botmaker/compiler/types/ThriftStructType.java","lineNumber":335,"sourceCode":"      Manifest valueManifest = (Manifest) manifest.typeArguments().apply(0);\n      FieldValueMetaData elemMetaData = getFieldValueMetadata(valueManifest);\n      return new ListMetaData(elemMetaData);\n    } else if (scala.collection.Set.class.equals(runtimeClass)) {\n      Manifest valueManifest = (Manifest) manifest.typeArguments().apply(0);\n      FieldValueMetaData elemMetaData = getFieldValueMetadata(valueManifest);\n      return new SetMetaData(elemMetaData);\n    } else if (scala.collection.Map.class.equals(runtimeClass)) {\n      Manifest keyManifest = (Manifest) manifest.typeArguments().apply(0);\n      Manifest valueManifest = (Manifest) manifest.typeArguments().apply(1);\n      FieldValueMetaData keyMetaData = getFieldValueMetadata(keyManifest);\n      FieldValueMetaData valueMetaData = getFieldValueMetadata(valueManifest);\n      return new MapMetaData(keyMetaData, valueMetaData);\n    } else if (ThriftStruct.class.isAssignableFrom(runtimeClass)) {\n      return new ThriftStructMetaData(runtimeClass);\n    } else if (ThriftEnum.class.isAssignableFrom(runtimeClass)) {\n      return new ThriftEnumMetaData((Class<? extends ThriftEnum>) runtimeClass);\n    } else {\n      throw new SemanticCheckFailure(\n          String.format(\"Unsupported field type %s\", runtimeClass.toString()));\n    }\n  }\n\n  private static ThriftStructCodec getThriftStructCodec(\n      Class<? extends ThriftStruct> thriftClass) throws SemanticCheckFailure {\n\n    try {\n      Class<? extends ThriftStructCodec> codecClass =\n          (Class<? extends ThriftStructCodec>) ClassCache.forName(thriftClass.getName() + \"$\");\n      Field codecField = codecClass.getField(\"MODULE$\");\n      ThriftStructCodec codec = (ThriftStructCodec) codecField.get(null);\n      return codec;\n    } catch (Exception e) {\n      throw new SemanticCheckFailure(\n          String.format(\"Cannot load ThriftStruct Codec for %s: $s\",\n              thriftClass.getName(), e.toString()));\n    }","sourceCodeStart":317,"sourceCodeEnd":353,"githubUrl":"https://github.com/xai-org/x-algorithm/blob/24c60942c5c5fdad3a6addffb4c6e6d2f228f04f/botmaker/src/java/com/twitter/botmaker/compiler/types/ThriftStructType.java#L317-L353","documentation":"getFieldValueMetadata builds FieldValueMetaData for a field's runtime class, supporting collections, ThriftStruct, and ThriftEnum. Any other runtime class falls through to SemanticCheckFailure 'Unsupported field type'.","triggerScenarios":"A thrift field whose Java runtime class is not a Map/Set/List, ThriftStruct, or ThriftEnum (e.g. plain Java types, TBase structs mixed into scrooge unions, or arbitrary classes) reaching getFieldValueMetadata via fieldValueMetaData/elemMetaData/keyMetaData/valueMetaData.","commonSituations":"New field type introduced in a thrift IDL that the botmaker compiler version predates; mixing apache-thrift TBase structs with scrooge ThriftStruct types; custom thrift annotations producing unexpected Java classes.","solutions":["Upgrade botmaker/compiler to a version supporting the field's type","Remove/exclude the unsupported field from the rule","Verify the field's Java class is a scrooge ThriftStruct/ThriftEnum or standard collection"],"exampleFix":"// before\nfield: weirdField  // runtime class not supported\n// after\nfield: structField  // ThriftStruct-typed field, or upgrade botmaker","handlingStrategy":"try-catch","validationCode":"Class<?> c = fieldClass;\nboolean ok = Map.class.isAssignableFrom(c) || Set.class.isAssignableFrom(c)\n    || List.class.isAssignableFrom(c) || ThriftStruct.class.isAssignableFrom(c)\n    || ThriftEnum.class.isAssignableFrom(c);","typeGuard":null,"tryCatchPattern":"catch SemanticCheckFailure 'Unsupported field type' during metadata build; skip or fail fast per rule with the offending class name","preventionTips":["Track botmaker release notes for new thrift type support","Keep thrift IDL field types within the supported set"],"tags":["thrift","type-system","schema-validation"],"backgroundTag":"unsupported-thrift-field-type","analyzedSha":"24c60942c5c5fdad3a6addffb4c6e6d2f228f04f","analyzedAt":"2026-08-28T11:40:14.686Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}