We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
public class TestBean { public static final int[] test = new int[]{1,2,3}; }
How to get the value of test? CtField.getConstantValue() return null if the field type is a primitive type.
The text was updated successfully, but these errors were encountered:
Getting the value of test at compile time would be difficult because the above code is compiled into the bytecode equivalent to:
public class TestBean { public static final int[] test; static { test = new int[] { 1, 2, 3 }; } }
To obtain the value of test, you must statically analyze the body of this static initializer. It would be possible but Javassist does not help.
test
Sorry, something went wrong.
No branches or pull requests
How to get the value of test? CtField.getConstantValue() return null if the field type is a primitive type.
The text was updated successfully, but these errors were encountered: