tiny-remapper icon indicating copy to clipboard operation
tiny-remapper copied to clipboard

Wrong remap of super method with local static method of same name

Open kennytv opened this issue 3 years ago • 3 comments

Given the following mappings, a remap of the super, non-static method getStringRaw results in a mangled call due to the local static method with the same remapped name (being a synthetic lambda method):

c    net/minecraft/server/dedicated/Settings    net/minecraft/server/dedicated/PropertyManager
    m    (Ljava/lang/String;)Ljava/lang/String;    getStringRaw    c
c    net/minecraft/server/dedicated/DedicatedServerProperties    net/minecraft/server/dedicated/DedicatedServerProperties
    m    (Ljava/lang/String;)Ljava/lang/String;    lambda$new$3    c

DedicatedServerProperties being an extending class of Settings:

public class DedicatedServerProperties extends Settings<DedicatedServerProperties> {

The error is:

java.lang.IncompatibleClassChangeError: Expecting non-static method 'java.lang.String net.minecraft.server.dedicated.DedicatedServerProperties.c(java.lang.String)'

Specifically, this happens when cloning Paper and running the runReobf gradle task (or running the jar given by createReobfBundlerJar) ... but apparently only when doing so on Windows, not Mac or Linux

Any help or possible fix would be appreciated

kennytv avatar Mar 05 '22 10:03 kennytv

Hello, I'm facing this issue right now and really need to build a paper jar, is there any workaround I can use to get around this issue before the pull request is merged?

repeater64 avatar Mar 18 '22 19:03 repeater64

Hello, I'm facing this issue right now and really need to build a paper jar, is there any workaround I can use to get around this issue before the pull request is merged?

simply add


# Workaround by MoritzR200
c	net/minecraft/server/dedicated/DedicatedServerProperties	net/minecraft/server/dedicated/DedicatedServerProperties
	m	(Ljava/lang/String;)Ljava/lang/String;	lambda$new$3	d

to the end of the "reobf-mappings-patch.tiny" in the "build-data" folder

MoritzR200 avatar Mar 18 '22 19:03 MoritzR200

Hello, I'm facing this issue right now and really need to build a paper jar, is there any workaround I can use to get around this issue before the pull request is merged?

simply add


# Workaround by MoritzR200
c	net/minecraft/server/dedicated/DedicatedServerProperties	net/minecraft/server/dedicated/DedicatedServerProperties
	m	(Ljava/lang/String;)Ljava/lang/String;	lambda$new$3	d

to the end of the "reobf-mappings-patch.tiny" in the "build-data" folder

Thanks, before I saw this I just tried running the build from Windows Subsystem for Linux which worked for me.

repeater64 avatar Mar 18 '22 20:03 repeater64