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

@ParametersDelegate fails if delegate class implements BiPredicate #582

Open
lindenb opened this issue May 13, 2024 · 1 comment
Open

@ParametersDelegate fails if delegate class implements BiPredicate #582

lindenb opened this issue May 13, 2024 · 1 comment

Comments

@lindenb
Copy link
Contributor

lindenb commented May 13, 2024

Hi,

I've got the following code:

@ParametersDelegate
private StructuralVariantComparator svComparator = new StructuralVariantComparator();

with:

public class StructuralVariantComparator implements BiPredicate<VariantContext,VariantContext> {
(....)

when I run my code (java 17/ jc 1.82), I got the following stacktrace:

Exception in thread "main" java.lang.reflect.InaccessibleObjectException: Unable to make private boolean java.util.function.BiPredicate.lambda$or$2(java.util.function.BiPredicate,java.lang.Object,java.lang.Object) accessible: module java.base does not "opens java.util.function" to unnamed module @2a48d10f
	at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
	at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
	at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:199)
	at java.base/java.lang.reflect.Method.setAccessible(Method.java:193)
	at com.beust.jcommander.Parameterized.parseArg(Parameterized.java:123)
	at com.beust.jcommander.parser.DefaultParameterizedParser.parseArg(DefaultParameterizedParser.java:23)
	at com.beust.jcommander.JCommander.addDescription(JCommander.java:608)
	at com.beust.jcommander.JCommander.addDescription(JCommander.java:652)
	at com.beust.jcommander.JCommander.createDescriptions(JCommander.java:601)
	at com.beust.jcommander.JCommander.parse(JCommander.java:361)
	at com.beust.jcommander.JCommander.parse(JCommander.java:342)
	at com.github.lindenb.jvarkit.util.jcommander.Launcher.parseArgs(Launcher.java:541)
	at com.github.lindenb.jvarkit.util.jcommander.Launcher.instanceMain(Launcher.java:796)
	at com.github.lindenb.jvarkit.util.jcommander.Launcher.instanceMainWithExit(Launcher.java:982)
	at com.github.lindenb.jvarkit.tools.structvar.SVCasesControls.main(SVCasesControls.java:232)

But there is no error if I comment out the interface:

public class StructuralVariantComparator /* implements BiPredicate<VariantContext,VariantContext> */{
@mkarg
Copy link
Collaborator

mkarg commented Jul 6, 2024

Thank you for filing this bug request! Do you feel confident providing a PR with a test (and possibly a proposed solution)?

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