Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Duplicate key" with fields that are equally named #11

Open
MrEAlderson opened this issue Jun 2, 2024 · 3 comments
Open

"Duplicate key" with fields that are equally named #11

MrEAlderson opened this issue Jun 2, 2024 · 3 comments

Comments

@MrEAlderson
Copy link

MrEAlderson commented Jun 2, 2024

I am using ProGuard to obfuscate a plugin that I maintain, together with a -overloadaggressively setting that I got from a template back then. Today I learned what that actually does and that it is apparently fully legitimate to have fields be equally named on the bytecode level (source):
image
Which leads to the following error:

[23:05:23 ERROR]: [PluginRemapper] Encountered exception remapping plugins
java.util.concurrent.CompletionException: java.lang.RuntimeException: Failed to remap plugin jar 'plugins\bedwars.jar'
        at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315) ~[?:?]
        at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320) ~[?:?]
        at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:649) ~[?:?]
        at java.base/java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:482) ~[?:?]
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
        at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?]
Caused by: java.lang.RuntimeException: Failed to remap plugin jar 'plugins\bedwars.jar'
        at io.papermc.paper.pluginremap.PluginRemapper.lambda$remap$7(PluginRemapper.java:358) ~[paper-1.20.6.jar:1.20.6-130-5d8e53d]
        at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646) ~[?:?]
        ... 4 more
Caused by: java.lang.RuntimeException: Failed to execute task de/marcely/bedwars/s
        at net.neoforged.art.internal.AsyncHelper.invokeAll(AsyncHelper.java:56) ~[AutoRenamingTool-2.0.3.jar:?]
        at net.neoforged.art.internal.AsyncHelper.consumeAll(AsyncHelper.java:36) ~[AutoRenamingTool-2.0.3.jar:?]
        at net.neoforged.art.internal.RenamerImpl.run(RenamerImpl.java:177) ~[paper-1.20.6.jar:?]
        at net.neoforged.art.internal.RenamerImpl.run(RenamerImpl.java:95) ~[paper-1.20.6.jar:?]
        at io.papermc.paper.pluginremap.PluginRemapper.lambda$remap$7(PluginRemapper.java:355) ~[paper-1.20.6.jar:1.20.6-130-5d8e53d]
        at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646) ~[?:?]
        ... 4 more
Caused by: java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Duplicate key a (attempted merging values private final de/marcely/bedwars/s/a Lde/marcely/bedwars/q; and private final de/marcely/bedwars/s/a Lde/marcely/bedwars/r;)
        at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[?:?]
        at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191) ~[?:?]
        at net.neoforged.art.internal.AsyncHelper.invokeAll(AsyncHelper.java:52) ~[AutoRenamingTool-2.0.3.jar:?]
        at net.neoforged.art.internal.AsyncHelper.consumeAll(AsyncHelper.java:36) ~[AutoRenamingTool-2.0.3.jar:?]
        at net.neoforged.art.internal.RenamerImpl.run(RenamerImpl.java:177) ~[paper-1.20.6.jar:?]
        at net.neoforged.art.internal.RenamerImpl.run(RenamerImpl.java:95) ~[paper-1.20.6.jar:?]
        at io.papermc.paper.pluginremap.PluginRemapper.lambda$remap$7(PluginRemapper.java:355) ~[paper-1.20.6.jar:1.20.6-130-5d8e53d]
        at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646) ~[?:?]
        ... 4 more
Caused by: java.lang.IllegalStateException: Duplicate key a (attempted merging values private final de/marcely/bedwars/s/a Lde/marcely/bedwars/q; and private final de/marcely/bedwars/s/a Lde/marcely/bedwars/r;)
        at java.base/java.util.stream.Collectors.duplicateKeyException(Collectors.java:135) ~[?:?]
        at java.base/java.util.stream.Collectors.lambda$uniqKeysMapAccumulator$1(Collectors.java:182) ~[?:?]
        at java.base/java.util.stream.ReduceOps$3ReducingSink.accept(ReduceOps.java:169) ~[?:?]
        at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) ~[?:?]
        at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1708) ~[?:?]
        at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[?:?]
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[?:?]
        at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921) ~[?:?]
        at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?]
        at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682) ~[?:?]
        at net.neoforged.art.internal.ClassProviderImpl$ClassInfo.<init>(ClassProviderImpl.java:122) ~[AutoRenamingTool-2.0.3.jar:?]
        at net.neoforged.art.internal.ClassProviderBuilderImpl.lambda$addClass$1(ClassProviderBuilderImpl.java:64) ~[AutoRenamingTool-2.0.3.jar:?]
        at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1708) ~[?:?]
        at net.neoforged.art.internal.ClassProviderBuilderImpl.addClass(ClassProviderBuilderImpl.java:64) ~[AutoRenamingTool-2.0.3.jar:?]
        at net.neoforged.art.internal.RenamerImpl.lambda$run$2(RenamerImpl.java:178) ~[paper-1.20.6.jar:?]
        at net.neoforged.art.internal.AsyncHelper.lambda$null$0(AsyncHelper.java:33) ~[AutoRenamingTool-2.0.3.jar:?]
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317) ~[?:?]
        ... 3 more

Related PR: #9

@DerMistkaefer
Copy link

We upgrading to paper 1.21 and now getting the same error in PlayerChunkMap

[22:52:30 ERROR]: [PluginRemapper] Encountered exception remapping plugins
java.util.concurrent.CompletionException: java.lang.RuntimeException: Failed to remap plugin jar 'plugins\lobby-spigot.jar'
        at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315) ~[?:?]
        at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320) ~[?:?]
        at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:649) ~[?:?]
        at java.base/java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:482) ~[?:?]
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
        at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?]
Caused by: java.lang.RuntimeException: Failed to remap plugin jar 'plugins\lobby-spigot.jar'
        at io.papermc.paper.pluginremap.PluginRemapper.lambda$remap$7(PluginRemapper.java:358) ~[paper-1.21.jar:1.21-DEV-167961e]
        at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646) ~[?:?]
        ... 4 more
Caused by: java.lang.RuntimeException: Failed to execute task de/cytooxien/lobby/spigot/phantom/entityhider/EntityHiderPacketListener.class
        at net.neoforged.art.internal.AsyncHelper.invokeAll(AsyncHelper.java:56) ~[AutoRenamingTool-2.0.3.jar:?]
        at net.neoforged.art.internal.AsyncHelper.invokeAll(AsyncHelper.java:41) ~[AutoRenamingTool-2.0.3.jar:?]
        at net.neoforged.art.internal.RenamerImpl.run(RenamerImpl.java:184) ~[paper-1.21.jar:?]
        at net.neoforged.art.internal.RenamerImpl.run(RenamerImpl.java:95) ~[paper-1.21.jar:?]
        at io.papermc.paper.pluginremap.PluginRemapper.lambda$remap$7(PluginRemapper.java:355) ~[paper-1.21.jar:1.21-DEV-167961e]
        at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646) ~[?:?]
        ... 4 more
Caused by: java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Duplicate key F (attempted merging values private final net/minecraft/server/level/PlayerChunkMap/F Lnet/minecraft/world/level/entity/ChunkStatusUpdateListener; and public final net/minecraft/server/level/PlayerChunkMap/F Lnet/minecraft/server/level/PlayerChunkMap$ChunkDistanceManager;)
        at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[?:?]
        at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191) ~[?:?]
        at net.neoforged.art.internal.AsyncHelper.invokeAll(AsyncHelper.java:52) ~[AutoRenamingTool-2.0.3.jar:?]
        at net.neoforged.art.internal.AsyncHelper.invokeAll(AsyncHelper.java:41) ~[AutoRenamingTool-2.0.3.jar:?]
        at net.neoforged.art.internal.RenamerImpl.run(RenamerImpl.java:184) ~[paper-1.21.jar:?]
        at net.neoforged.art.internal.RenamerImpl.run(RenamerImpl.java:95) ~[paper-1.21.jar:?]
        at io.papermc.paper.pluginremap.PluginRemapper.lambda$remap$7(PluginRemapper.java:355) ~[paper-1.21.jar:1.21-DEV-167961e]
        at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646) ~[?:?]
        ... 4 more
Caused by: java.lang.IllegalStateException: Duplicate key F (attempted merging values private final net/minecraft/server/level/PlayerChunkMap/F Lnet/minecraft/world/level/entity/ChunkStatusUpdateListener; and public final net/minecraft/server/level/PlayerChunkMap/F Lnet/minecraft/server/level/PlayerChunkMap$ChunkDistanceManager;)
        at java.base/java.util.stream.Collectors.duplicateKeyException(Collectors.java:135) ~[?:?]
        at java.base/java.util.stream.Collectors.lambda$uniqKeysMapAccumulator$1(Collectors.java:182) ~[?:?]
        at java.base/java.util.stream.ReduceOps$3ReducingSink.accept(ReduceOps.java:169) ~[?:?]
        at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) ~[?:?]
        at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1708) ~[?:?]
        at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[?:?]
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[?:?]
        at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921) ~[?:?]
        at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?]
        at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682) ~[?:?]
        at net.neoforged.art.internal.ClassProviderImpl$ClassInfo.<init>(ClassProviderImpl.java:122) ~[AutoRenamingTool-2.0.3.jar:?]
        at net.neoforged.art.internal.ClassProviderImpl.computeClassInfo(ClassProviderImpl.java:80) ~[AutoRenamingTool-2.0.3.jar:?]
        at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1740) ~[?:?]
        at net.neoforged.art.internal.ClassProviderImpl.getClass(ClassProviderImpl.java:66) ~[AutoRenamingTool-2.0.3.jar:?]
        at net.neoforged.art.internal.SortedClassProvider.computeClassInfo(SortedClassProvider.java:34) ~[AutoRenamingTool-2.0.3.jar:?]
        at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1740) ~[?:?]
        at net.neoforged.art.internal.SortedClassProvider.getClass(SortedClassProvider.java:29) ~[AutoRenamingTool-2.0.3.jar:?]
        at net.neoforged.art.internal.EnhancedRemapper.computeClass(EnhancedRemapper.java:143) ~[AutoRenamingTool-2.0.3.jar:?]
        at net.neoforged.art.internal.EnhancedRemapper.getClass(EnhancedRemapper.java:126) ~[AutoRenamingTool-2.0.3.jar:?]
        at net.neoforged.art.internal.EnhancedRemapper.map(EnhancedRemapper.java:88) ~[AutoRenamingTool-2.0.3.jar:?]
        at org.objectweb.asm.commons.Remapper.mapType(Remapper.java:78) ~[asm-commons-9.7.jar:9.7]
        at org.objectweb.asm.commons.Remapper.mapType(Remapper.java:99) ~[asm-commons-9.7.jar:9.7]
        at org.objectweb.asm.commons.ClassRemapper.visitInnerClass(ClassRemapper.java:201) ~[asm-commons-9.7.jar:9.7]
        at org.objectweb.asm.ClassReader.accept(ClassReader.java:718) ~[asm-9.7.jar:9.7]
        at org.objectweb.asm.ClassReader.accept(ClassReader.java:425) ~[asm-9.7.jar:9.7]
        at net.neoforged.art.internal.RenamingTransformer.process(RenamingTransformer.java:50) ~[AutoRenamingTool-2.0.3.jar:?]
        at net.neoforged.art.internal.EntryImpl$ClassEntry.process(EntryImpl.java:58) ~[AutoRenamingTool-2.0.3.jar:?]
        at net.neoforged.art.internal.EntryImpl$ClassEntry.process(EntryImpl.java:36) ~[AutoRenamingTool-2.0.3.jar:?]
        at net.neoforged.art.internal.RenamerImpl.processEntry(RenamerImpl.java:288) ~[paper-1.21.jar:?]
        at net.neoforged.art.internal.AsyncHelper.lambda$null$2(AsyncHelper.java:40) ~[AutoRenamingTool-2.0.3.jar:?]
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317) ~[?:?]
        ... 3 more
```

@jpenilla
Copy link
Contributor

jpenilla commented Jun 16, 2024

@DerMistkaefer
That is a fixed issue which was due to the mappings patch not getting updated
PaperMC/Paper@de8220c

@danirod12
Copy link
Contributor

This PR since May will close it #9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants