{"record":{"id":"7c414b6bf3aec0a2","repo":"languagetool-org/languagetool","slug":"too-many-lemmas-value-size-for-the-same","errorCode":null,"errorMessage":"Too many lemmas (\" + value.size() + \" for the same hash \" + value + \", the storage needs adjusting","messagePattern":"Too many lemmas \\(\" \\+ value\\.size\\(\\) \\+ \" for the same hash \" \\+ value \\+ \", the storage needs adjusting","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"languagetool-core/src/main/java/org/languagetool/synthesis/ManualSynthesizer.java","lineNumber":87,"sourceCode":"    Map<TaggedWord, List<String>> mapping = loadMapping(inputStream);\n    Int2ObjectOpenHashMap<List<Triple<String, String, String>>> byHash = groupByHash(mapping);\n\n    map = new Int2IntOpenHashMap(byHash.size());\n    int valueCount = mapping.values().stream().mapToInt(v -> v.size()).sum();\n    int firstIndex = ENTRY_SIZE; // skip an entry, as 0 means an absent value in TObjectIntHashMap\n    data = new String[valueCount * ENTRY_SIZE + firstIndex];\n    if (valueCount > MAX_OFFSET) {\n      throw new UnsupportedOperationException(\"Too many values (\" + valueCount + \"), the storage needs adjusting\");\n    }\n    byHash.int2ObjectEntrySet().fastForEach(new Consumer<Int2ObjectMap.Entry<List<Triple<String, String, String>>>>() {\n      int index = firstIndex;\n\n      @Override\n      public void accept(Int2ObjectMap.Entry<List<Triple<String, String, String>>> listEntry) {\n        int hash = listEntry.getIntKey();\n        List<Triple<String, String, String>> value = listEntry.getValue();\n        if (value.size() > MAX_LENGTH) {\n          throw new UnsupportedOperationException(\n            \"Too many lemmas (\" + value.size() + \" for the same hash \" + value + \", the storage needs adjusting\");\n        }\n        map.put(hash, ((index / ENTRY_SIZE) << OFFSET_SHIFT) | value.size());\n        for (Triple<String, String, String> triple : value) {\n          data[index++] = intern(triple.getLeft());\n          data[index++] = intern(triple.getMiddle());\n          data[index++] = intern(triple.getRight());\n        }\n      }\n    });\n\n    possibleTags = Collections.unmodifiableSet(collectTags(mapping));\n  }\n\n  private static Int2ObjectOpenHashMap<List<Triple<String, String, String>>> groupByHash(Map<TaggedWord, List<String>> mapping) {\n    Int2ObjectOpenHashMap<List<Triple<String, String, String>>> byHash = new Int2ObjectOpenHashMap<>(mapping.size());\n    for (Map.Entry<TaggedWord, List<String>> entry : mapping.entrySet()) {\n      TaggedWord tw = entry.getKey();","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/languagetool-org/languagetool/blob/2e990059ce67d5e2a0f7f7ca5d31160c6709df4b/languagetool-core/src/main/java/org/languagetool/synthesis/ManualSynthesizer.java#L69-L105","documentation":"Capacity guard while grouping entries by hash in the ManualSynthesizer constructor: several distinct lemma+POS pairs collide to the same 32-bit hash and their combined entries no longer fit the fixed-size slot layout, so the compact storage cannot encode them. The input at fault is the loaded data whose lemmas share a hash bucket.","triggerScenarios":"Thrown at languagetool-core/src/main/java/org/languagetool/synthesis/ManualSynthesizer.java:87 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Adjust the storage encoding (e.g. allow more entries per hash bucket) so colliding lemmas fit","Rename or restructure the colliding lemma entries in the data file so they hash to different buckets"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2e990059ce67d5e2a0f7f7ca5d31160c6709df4b","analyzedAt":"2026-09-06T09:20:17.015Z","contentChangedAt":"2026-09-06T09:20:17.015Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}