{"record":{"id":"fdf44b062382e0c0","repo":"NationalSecurityAgency/ghidra","slug":"duplicate-type-entry-specified-name-fdf44b","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/elastic/ElasticDatabase.java","lineNumber":2903,"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 *   Install a new executable category to be managed by the database\n\t * @param query is command parameters\n\t * @throws LSHException if the command is misconfigured\n\t * @throws ElasticException for communication problems with the server\n\t */\n\tprivate void fdbInstallCategory(InstallCategoryRequest query)\n\t\t\tthrows LSHException, ElasticException {\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) {","sourceCodeStart":2885,"sourceCodeEnd":2921,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/elastic/ElasticDatabase.java#L2885-L2921","documentation":"checkStrings builds a Set and rejects any name already present (case-sensitive) with LSHException(\"Duplicate <type> entry specified: <name>\").","triggerScenarios":"A category/tag list passed to checkStrings containing the same exact string more than once.","commonSituations":"Merging multiple config sources (CLI flags plus a file) without dedup; case-sensitive near-duplicates that look different but collide.","solutions":["Dedupe the list before submission.","Build the collection with a LinkedHashSet to preserve order while dropping duplicates."],"exampleFix":"// before\nList<String> cats = merge(cliCats, fileCats); // dupes present\nquery.info.execats = cats;\n// after\nList<String> cats = new ArrayList<>(new LinkedHashSet<>(merge(cliCats, fileCats)));\nquery.info.execats = cats;","handlingStrategy":"validation","validationCode":"// Detect dupes before sending.\nSet<String> seen = new HashSet<>();\nfor (String n : list) if (!seen.add(n)) throw new IllegalArgumentException(\"Duplicate: \" + n);","typeGuard":"boolean noDupes = list.size() == new HashSet<>(list).size();","tryCatchPattern":null,"preventionTips":["Always dedupe merged lists at the seam between sources.","Decide on a canonical case policy and apply it consistently."],"tags":["bsim","validation","duplicates"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}