{"record":{"id":"5206b4ed294398de","repo":"NationalSecurityAgency/ghidra","slug":"property-propertyname-is-not-object-type","errorCode":null,"errorMessage":"Property ${propertyName} is not object type","messagePattern":"Property (.+?) is not object type","errorType":"validation","errorClass":"TypeMismatchException","httpStatus":null,"severity":"error","filePath":"Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/database/program/DBTraceProgramViewPropertyMapManager.java","lineNumber":376,"sourceCode":"\t}\n\n\t@Override\n\tpublic StringPropertyMap getStringPropertyMap(String propertyName) {\n\t\tTracePropertyMap<String> map = program.trace.getAddressPropertyManager()\n\t\t\t\t.getPropertyMap(propertyName, String.class);\n\t\treturn map == null ? null : new DBTraceProgramViewStringPropertyMap(map, propertyName);\n\t}\n\n\t@Override\n\t@SuppressWarnings(\"unchecked\")\n\tpublic ObjectPropertyMap<? extends Saveable> getObjectPropertyMap(String propertyName) {\n\t\tTracePropertyMap<?> map =\n\t\t\tprogram.trace.getAddressPropertyManager().getPropertyMap(propertyName);\n\t\tif (map == null) {\n\t\t\treturn null;\n\t\t}\n\t\tif (!Saveable.class.isAssignableFrom(map.getValueClass())) {\n\t\t\tthrow new TypeMismatchException(\"Property \" + propertyName + \" is not object type\");\n\t\t}\n\t\treturn new DBTraceProgramViewObjectPropertyMap<>((TracePropertyMap<? extends Saveable>) map,\n\t\t\tpropertyName);\n\t}\n\n\t@Override\n\tpublic VoidPropertyMap getVoidPropertyMap(String propertyName) {\n\t\tTracePropertyMap<Boolean> map = program.trace.getAddressPropertyManager()\n\t\t\t\t.getPropertyMap(propertyName, Boolean.class);\n\t\treturn map == null ? null : new DBTraceProgramViewVoidPropertyMap(map, propertyName);\n\t}\n\n\t@Override\n\tpublic boolean removePropertyMap(String propertyName) {\n\t\t// It would delete for entire trace, not just this view\n\t\tthrow new UnsupportedOperationException();\n\t}\n","sourceCodeStart":358,"sourceCodeEnd":394,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/database/program/DBTraceProgramViewPropertyMapManager.java#L358-L394","documentation":"Thrown as TypeMismatchException by getObjectPropertyMap when the named property's value class is not assignable to Saveable. The trace stores property maps with typed value classes; an ObjectPropertyMap requires the values to be Saveable objects. Requesting it as an object map when the property is actually a string/void/boolean/etc. map is a type mismatch.","triggerScenarios":"Calling getObjectPropertyMap(propertyName) for a property whose value class is a primitive-backed type (String, Boolean, etc.) rather than a Saveable subclass.","commonSituations":"Assuming a property is object-typed when it was defined as a string or void property. Mismatched property-type expectations between code that writes and code that reads a custom trace property.","solutions":["Check the property's value class via the address property manager before requesting a specific map type.","Use the correct accessor: getStringPropertyMap / getVoidPropertyMap / getObjectPropertyMap matching the actual value type.","If you need an object map, ensure the property was created with a Saveable value class."],"exampleFix":"// before\nObjectPropertyMap<?> m = propMgr.getObjectPropertyMap(\"myProp\");\n\n// after\nTracePropertyMap<?> map = trace.getAddressPropertyManager().getPropertyMap(\"myProp\");\nif (map != null && Saveable.class.isAssignableFrom(map.getValueClass())) {\n    ObjectPropertyMap<?> m = propMgr.getObjectPropertyMap(\"myProp\");\n} else {\n    // use the correct typed accessor (string, void, etc.)\n}","handlingStrategy":"validation","validationCode":"// Check the property's value class before requesting an object map\nTracePropertyMap<?> map = trace.getAddressPropertyManager().getPropertyMap(propertyName);\nif (map != null && Saveable.class.isAssignableFrom(map.getValueClass())) {\n    ObjectPropertyMap<?> om = propMgr.getObjectPropertyMap(propertyName);\n}","typeGuard":"static boolean isObjectProperty(TracePropertyMap<?> map) {\n    return map != null && Saveable.class.isAssignableFrom(map.getValueClass());\n}","tryCatchPattern":null,"preventionTips":["Inspect the property's value class before choosing the typed accessor.","Match the accessor (string/void/object) to the actual value type.","Document property value types at creation time."],"tags":["trace-modeling","property-map","type-mismatch","ghidra"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}