{"record":{"id":"91a6f4caff4e3af4","repo":"xai-org/x-algorithm","slug":"unsupported-type-s-to-fingerprint","errorCode":null,"errorMessage":"Unsupported type %s to fingerprint.","messagePattern":"Unsupported type (.+?) to fingerprint\\.","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"botmaker/src/java/com/twitter/botmaker/compiler/Serializer.java","lineNumber":547,"sourceCode":"        Tuple tuple = (Tuple) value;\n        Type[] typeParams = new Type[tuple.size()];\n        Arrays.fill(typeParams, Type.OBJECT);\n        Serializer<Tuple> tupleSerializer = tupleOf(typeParams);\n        tupleSerializer.computeFingerprint(hasher, (Tuple) value);\n      } else if (value instanceof TBase) {\n        Class<? extends TBase> clazz = (Class<? extends TBase>) value.getClass();\n        Serializer serializer = thriftOf(clazz);\n        serializer.computeFingerprint(hasher, value);\n      } else if (value instanceof TEnum) {\n        Class<? extends TEnum> clazz = (Class<? extends TEnum>) value.getClass();\n        Serializer serializer = thriftEnumOf(clazz);\n        serializer.computeFingerprint(hasher, value);\n      } else if (value instanceof ThriftStruct) {\n        Class<? extends ThriftStruct> clazz = (Class<? extends ThriftStruct>) value.getClass();\n        Serializer serializer = thriftStructOf(clazz);\n        serializer.computeFingerprint(hasher, value);\n      } else {\n        throw new UnsupportedOperationException(\n            String.format(\"Unsupported type %s to fingerprint.\", value.getClass().getName())\n        );\n      }\n    }\n\n    @Override\n    protected void serialize(TProtocol prot, Object value) throws Exception {\n      if (value instanceof Boolean) {\n        prot.writeByte(tagBoolean);\n        BOOLEAN.serialize(prot, (Boolean) value, false);\n      } else if (value instanceof String) {\n        prot.writeByte(tagString);\n        STRING.serialize(prot, (String) value, false);\n      } else if (value instanceof ByteBuffer) {\n        prot.writeByte(tagBinary);\n        BINARY.serialize(prot, (ByteBuffer) value, false);\n      } else if (value instanceof Float) {\n        prot.writeByte(tagFloat);","sourceCodeStart":529,"sourceCodeEnd":565,"githubUrl":"https://github.com/xai-org/x-algorithm/blob/24c60942c5c5fdad3a6addffb4c6e6d2f228f04f/botmaker/src/java/com/twitter/botmaker/compiler/Serializer.java#L529-L565","documentation":"The generic fingerprinting entry point (Serializer.computeFingerprint) only knows how to hash certain value shapes: values with a matching registered Serializer and ThriftStruct instances. Any other runtime class hits UnsupportedOperationException with the class name, so fingerprints cannot silently diverge for unhandled types.","triggerScenarios":"Passing a value whose class has no registered Serializer and is not a ThriftStruct — e.g. a plain POJO, java.util.Date, or a custom type not wired into the serializer registry — into computeFingerprint.","commonSituations":"Adding a new field type to a fingerprinted struct without registering a Serializer for it; refactors that swap a field from a Thrift type to a plain class.","solutions":["Register/implement a Serializer<Foo> for the offending class named in the message","Convert the value to an already-supported type (String, Long, ThriftStruct, etc.) before fingerprinting","If the field should not participate in the fingerprint, exclude it from the hashed value"],"exampleFix":"// before\nhasher = Serializer.computeFingerprint(hasher, myPojo); // UnsupportedOperationException\n\n// after\nSerializer<MyPojo> S = new Serializer<MyPojo>() { /* implement fingerprint/serialize */ };\nhasher = S.computeFingerprint(hasher, myPojo);","handlingStrategy":"validation","validationCode":"// Only fingerprint values you know are supported\nboolean fingerprintable(Object v) {\n  return v == null || v instanceof ThriftStruct || hasRegisteredSerializer(v.getClass());\n}","typeGuard":"boolean hasRegisteredSerializer(Class<?> c) {\n  return Serializer.registryLookup(c) != null; // however your wiring exposes it\n}","tryCatchPattern":"try {\n  Serializer.computeFingerprint(hasher, value);\n} catch (UnsupportedOperationException e) {\n  // convert to string form as a stable fallback or fail fast with schema error\n}","preventionTips":["Register a Serializer whenever adding a new field type to fingerprinted structs","Unit-test fingerprinting of every field type","Prefer ThriftStruct types for fingerprinted data"],"tags":["serialization","fingerprinting","unsupported-type"],"backgroundTag":"unsupported-type-serialization","analyzedSha":"24c60942c5c5fdad3a6addffb4c6e6d2f228f04f","analyzedAt":"2026-08-28T11:40:14.686Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}