mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-10 13:17:09 +07:00
LSP-390 EquationsExternalizer: make a singleton to prevent externalizer hashcode mismatch errors in LSP
LSP creates "a new copy of the world" for each request, and this caused EquationsExternalizer to be recreated too. GitOrigin-RevId: 3f56d2a933d3d96533f5afd4c206fcecde04a716
This commit is contained in:
committed by
intellij-monorepo-bot
parent
fa34bb71df
commit
427a1cb8f3
+1
-1
@@ -24,7 +24,7 @@ public final class BytecodeAnalysisGist {
|
||||
gist = GistManager.getInstance().newVirtualFileGist(
|
||||
"BytecodeAnalysisIndex",
|
||||
ClassDataIndexer.FINAL_VERSION,
|
||||
new BytecodeAnalysisIndex.EquationsExternalizer(),
|
||||
BytecodeAnalysisIndex.EquationsExternalizer.INSTANCE,
|
||||
new ClassDataIndexer()
|
||||
);
|
||||
}
|
||||
|
||||
+2
@@ -138,6 +138,8 @@ public final class BytecodeAnalysisIndex extends ScalarIndexExtension<HMember> {
|
||||
* Externalizer for compressed equations.
|
||||
*/
|
||||
public static class EquationsExternalizer implements DataExternalizer<Map<HMember, Equations>> {
|
||||
public static final EquationsExternalizer INSTANCE = new EquationsExternalizer();
|
||||
|
||||
@Override
|
||||
public void save(@NotNull DataOutput out, Map<HMember, Equations> value) throws IOException {
|
||||
DataInputOutputUtilRt.writeSeq(out, value.entrySet(), entry -> {
|
||||
|
||||
+1
-1
@@ -284,7 +284,7 @@ public final class ClassDataIndexer implements VirtualFileGist.GistCalculator<Ma
|
||||
public void accept(Map<HMember, Equations> map) {
|
||||
try {
|
||||
UnsyncByteArrayOutputStream stream = new UnsyncByteArrayOutputStream();
|
||||
new BytecodeAnalysisIndex.EquationsExternalizer().save(new DataOutputStream(stream), map);
|
||||
BytecodeAnalysisIndex.EquationsExternalizer.INSTANCE.save(new DataOutputStream(stream), map);
|
||||
ourTotalSize.addAndGet(stream.size());
|
||||
ourTotalCount.incrementAndGet();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user