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

Support static final MethodHandles and MethodTypes #3

Open
SirYwell opened this issue Nov 2, 2022 · 1 comment
Open

Support static final MethodHandles and MethodTypes #3

SirYwell opened this issue Nov 2, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@SirYwell
Copy link
Owner

SirYwell commented Nov 2, 2022

Currently, all the analysis is done on method-level. Also analysing fields will improve usabililty, as it's a common pattern to have method handles as (dynamic) constants.

Example of what should be supported:

class Example {
	private static final MethodType TYPE = MethodType.methodType(int.class, String.class);
	private static final MethodHandle HANDLE;
	static {
		HANDLE = MethodHandles.empty(TYPE);
	}
	int get() {
		return (int) HANDLE.invoke("Hello World"); // detect issues here
	}
}
@SirYwell SirYwell added this to the 1.0.0 milestone Nov 5, 2022
@SirYwell
Copy link
Owner Author

#19 is part 1 of this: initializers are analyzed, but assignments in bodies are ignored for now.

@SirYwell SirYwell added the enhancement New feature or request label May 1, 2023
@SirYwell SirYwell self-assigned this May 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant