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

Usages of VarHandle get and set cause warnings #448

Open
satsen opened this issue Nov 8, 2024 · 2 comments
Open

Usages of VarHandle get and set cause warnings #448

satsen opened this issue Nov 8, 2024 · 2 comments

Comments

@satsen
Copy link

satsen commented Nov 8, 2024

VarHandle varHandle = MethodHandles.byteArrayViewVarHandle(int[].class, ByteOrder.BIG_ENDIAN);
byte[] byteArray = new byte[4];
varHandle.set(byteArray, 0, 1234);
varHandle.get(byteArray, 0);

Warning: com.example.MyClass: can't find referenced method 'void set(byte[],int,int)' in library class java.lang.invoke.VarHandle
Warning: com.example.MyClass: can't find referenced method 'int get(byte[],int)' in library class java.lang.invoke.VarHandle

@mrjameshamilton
Copy link
Contributor

Hi @satsen !

You can use -dontwarn java.lang.invoke.VarHandle to ignore these warnings if it's not causing any actual issue.

@satsen
Copy link
Author

satsen commented Nov 8, 2024

Hi @mrjameshamilton. Thank you, I am already doing that. I wanted to report the issue so that it is known.

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

2 participants