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

Compiler seems to be inlining all static constants #38

Open
hornta opened this issue Aug 3, 2021 · 1 comment
Open

Compiler seems to be inlining all static constants #38

hornta opened this issue Aug 3, 2021 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@hornta
Copy link

hornta commented Aug 3, 2021

I have not found a single static constant used in the classes. Is it a compiler issue?

Here is an example of what such a constant could look like. I searched across the whole project for this but I have not found anything. It's from the 1.17.1 client.

public static final float DEFAULT_BB_HEIGHT = 1.8f;

According to this page there is an CLI option to turn it off --relinkconststring false According to the documentation it does its best to recover the static final and doesn't work when there are multiple public static const but this should make it a bit easier to at least debug the minecraft jars.

@hube12
Copy link
Owner

hube12 commented Aug 4, 2021

Since a few snapshots (1.17), mojang shipped all its constants, debugging as well as some class that were previously removed by proguard, by extension we got name of some of the "magic" constants used accross the code base. However java when compiling will replace all constants with their value so a compiler will always have to trace back and try to associate them. We can for sure activate that option but since it's a feature by mojang to share constants name, I don't think I will enable it globally (probably a flag)

@hube12 hube12 added the documentation Improvements or additions to documentation label Jun 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants