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

Fix IllegalArgumentException caused by mismatch of arguments in createFlowAnalysis() #199

Merged
merged 2 commits into from
Mar 26, 2022

Conversation

AndrewShf
Copy link
Member

The last 2 arguments in BaseTypeChecker.invokeConstructorFor have different number of parameters. Checkers using this method will get a java.lang.IllegalArgumentException error in runtime.

  Underlying Exception: java.lang.IllegalArgumentException: wrong number of arguments; java.lang.IllegalArgumentException: wrong number of arguments
  	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
  	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
  	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
  	at org.checkerframework.common.basetype.BaseTypeChecker.invokeConstructorFor(BaseTypeChecker.java:331)
  	at org.checkerframework.framework.type.GenericAnnotatedTypeFactory.createFlowAnalysis(GenericAnnotatedTypeFactory.java:615)
  	at org.checkerframework.framework.type.GenericAnnotatedTypeFactory.postInit(GenericAnnotatedTypeFactory.java:406)
  	at pico.typecheck.PICOAnnotatedTypeFactory.<init>(PICOAnnotatedTypeFactory.java:85)
  	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
  	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
  	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
  	at org.checkerframework.common.basetype.BaseTypeChecker.invokeConstructorFor(BaseTypeChecker.java:331)
  	at org.checkerframework.common.basetype.BaseTypeVisitor.createTypeFactory(BaseTypeVisitor.java:305)
  	at org.checkerframework.common.basetype.BaseTypeVisitor.<init>(BaseTypeVisitor.java:268)
  	at org.checkerframework.common.basetype.BaseTypeVisitor.<init>(BaseTypeVisitor.java:257)
  	at org.checkerframework.checker.initialization.InitializationVisitor.<init>(InitializationVisitor.java:79)
  	at pico.typecheck.PICOVisitor.<init>(PICOVisitor.java:72)
  	at pico.typecheck.PICOChecker.createSourceVisitor(PICOChecker.java:28)
  	at pico.typecheck.PICOChecker.createSourceVisitor(PICOChecker.java:13)
  	at org.checkerframework.framework.source.SourceChecker.initChecker(SourceChecker.java:892)
  	at org.checkerframework.common.basetype.BaseTypeChecker.initChecker(BaseTypeChecker.java:117)
  	at pico.typecheck.PICOChecker.initChecker(PICOChecker.java:22)
  	at org.checkerframework.framework.source.SourceChecker.typeProcessingStart(SourceChecker.java:843)
  	at org.checkerframework.javacutil.AbstractTypeProcessor$AttributionTaskListener.finished(AbstractTypeProcessor.java:170)

@wmdietl wmdietl changed the title fix illegalArgument error caused by mismatch of arguments in createFlowAnalysis() Fix IllegalArgumentException caused by mismatch of arguments in createFlowAnalysis() Mar 26, 2022
@wmdietl
Copy link
Member

wmdietl commented Mar 26, 2022

Thanks for the fix!
Just for context, this problem was introduced when fieldValues was removed, but the list of parameters wasn't updated: c805fff#diff-abd887c0e1c434e90869b0dae15a7077772c55e180b5cdc0c61e391c1dc61ec1R609

@wmdietl wmdietl merged commit f1c3b0b into eisop:master Mar 26, 2022
al3xliu pushed a commit to al3xliu/checker-framework that referenced this pull request Mar 27, 2022
AndrewShf pushed a commit to AndrewShf/checker-framework that referenced this pull request Apr 11, 2022
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

Successfully merging this pull request may close these issues.

2 participants