{"record":{"id":"3c8593fbf6be1778","repo":"NationalSecurityAgency/ghidra","slug":"duplicate-type-entry-specified-name","errorCode":null,"errorMessage":"Duplicate {type} entry specified: {name}","messagePattern":"Duplicate (.+?) entry specified: (.+?)","errorType":"validation","errorClass":"LSHException","httpStatus":null,"severity":"error","filePath":"Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/client/AbstractSQLFunctionDatabase.java","lineNumber":2170,"sourceCode":"\t\t\tconfig.info.execats = query.info.execats;\n\t\t}\n\t\tgenerate(config);\n\t\tresponse.info = config.info;\n\t}\n\n\tprivate static void checkStrings(List<String> list, String type, int limit)\n\t\t\tthrows LSHException {\n\t\tif (limit > 0 && list.size() > limit) {\n\t\t\tthrow new LSHException(\"Too many \" + type + \" specified (limit=\" +\n\t\t\t\tFunctionTagBSimFilterType.MAX_TAG_COUNT + \"): \" + list.size());\n\t\t}\n\t\tSet<String> names = new HashSet<>();\n\t\tfor (String name : list) {\n\t\t\tif (!CategoryRecord.enforceTypeCharacters(name)) {\n\t\t\t\tthrow new LSHException(\"Bad characters in one or more proposed \" + type);\n\t\t\t}\n\t\t\tif (!names.add(name)) {\n\t\t\t\tthrow new LSHException(\"Duplicate \" + type + \" entry specified: \" + name);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Entry point for the InstallCategoryRequest command\n\t * @param query the query to execute\n\t * @throws LSHException if the category is invalid or already exists\n\t * @throws SQLException if there is an error issuing the query\n\t */\n\tprivate void fdbInstallCategory(InstallCategoryRequest query)\n\t\t\tthrows LSHException, SQLException {\n\t\tResponseInfo response = query.installresponse;\n\t\tif (!CategoryRecord.enforceTypeCharacters(query.type_name)) {\n\t\t\tthrow new LSHException(\"Bad characters in proposed category type\");\n\t\t}\n\t\tif (query.isdatecolumn) {\n\t\t\tinfo.dateColumnName = query.type_name;","sourceCodeStart":2152,"sourceCodeEnd":2188,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/client/AbstractSQLFunctionDatabase.java#L2152-L2188","documentation":"Thrown by checkStrings when a duplicate entry is detected within the same list passed to it (function tags or categories). A HashSet is used to detect repeated names; the first duplicate triggers the error with the offending name. This prevents ambiguity in bitmask assignment and SQL column creation.","triggerScenarios":"Supplying query.info.functionTags or query.info.execats containing the same name more than once (case-sensitive) during database creation or category/tag installation.","commonSituations":"Merging tag lists from multiple sources without de-duplication; case variations that look different but are exact string duplicates; concatenating config fragments that overlap.","solutions":["De-duplicate the list before submission: new ArrayList<>(new LinkedHashSet<>(list)).","Check for duplicates programmatically and warn the user before the query is built.","Validate uniqueness at the data-entry layer."],"exampleFix":"// before\nquery.info.functionTags = Arrays.asList(\"libc\", \"libc\", \"stdlib\");\n// after\nquery.info.functionTags = new ArrayList<>(new LinkedHashSet<>(Arrays.asList(\"libc\", \"libc\", \"stdlib\")));","handlingStrategy":"validation","validationCode":"Set<String> seen = new HashSet<>();\nfor (String s : list) {\n    if (!seen.add(s)) throw new IllegalArgumentException(\"Duplicate: \" + s);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["De-duplicate all name lists with a LinkedHashSet before passing to BSim.","Treat duplicates as a data-quality issue at the source, not a runtime surprise."],"tags":["bsim","validation","data-integrity"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}