From 8df07490614503a67a04d31b331fd79d4440ac31 Mon Sep 17 00:00:00 2001 From: Matyrobbrt Date: Fri, 16 Aug 2024 23:21:28 +0300 Subject: [PATCH 1/2] Synchronize stub creation --- .../java/net/neoforged/jst/interfaceinjection/StubStore.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interfaceinjection/src/main/java/net/neoforged/jst/interfaceinjection/StubStore.java b/interfaceinjection/src/main/java/net/neoforged/jst/interfaceinjection/StubStore.java index 9f54544..99c05e0 100644 --- a/interfaceinjection/src/main/java/net/neoforged/jst/interfaceinjection/StubStore.java +++ b/interfaceinjection/src/main/java/net/neoforged/jst/interfaceinjection/StubStore.java @@ -60,7 +60,7 @@ public InterfaceInformation createStub(String jvm) { return new InterfaceInformation(createStub(jvm, typeParameterCount), generics); } - private String createStub(String jvm, int typeParameterCount) { + private synchronized String createStub(String jvm, int typeParameterCount) { var fqn = jvmToFqn.get(jvm); if (fqn != null) return fqn; From 2e1dfddc36041ac3768be3f4aa8af51fad8eb5a1 Mon Sep 17 00:00:00 2001 From: Matyrobbrt Date: Fri, 16 Aug 2024 23:53:52 +0300 Subject: [PATCH 2/2] Synchronize save --- .../java/net/neoforged/jst/interfaceinjection/StubStore.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interfaceinjection/src/main/java/net/neoforged/jst/interfaceinjection/StubStore.java b/interfaceinjection/src/main/java/net/neoforged/jst/interfaceinjection/StubStore.java index 99c05e0..6283bfa 100644 --- a/interfaceinjection/src/main/java/net/neoforged/jst/interfaceinjection/StubStore.java +++ b/interfaceinjection/src/main/java/net/neoforged/jst/interfaceinjection/StubStore.java @@ -88,7 +88,7 @@ private synchronized String createStub(String jvm, int typeParameterCount) { return fqn; } - public void save(Path path) throws IOException { + public synchronized void save(Path path) throws IOException { if (path.getParent() != null && !Files.isDirectory(path.getParent())) { Files.createDirectories(path.getParent()); }