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

Improve interaction with typetools checker-qual dependency #1107

Open
wmdietl opened this issue Feb 10, 2025 · 0 comments
Open

Improve interaction with typetools checker-qual dependency #1107

wmdietl opened this issue Feb 10, 2025 · 0 comments

Comments

@wmdietl
Copy link
Member

wmdietl commented Feb 10, 2025

In EISOP we have a few small changes to the annotations in checker-qual, in particular DefaultQualifier has the additional applyToSubpackages attribute.

When directly depending on the artifacts, it should be easy to keep the dependencies in sync.
But e.g. when trying to combine NullAway with EISOP, one can run into an exception like this:

error: Error when invoking constructor org.checkerframework.checker.nullness.KeyForAnnotatedTypeFactory(class org.checkerframework.common.basetype.BaseTypeChecker) on args [org.checkerframework.checker.nullness.KeyForSubchecker@61a6bcfa]; cause: TreeUtils.getMethod(org.checkerframework.framework.qual.DefaultQualifier, applyToSubpackages, 0): expected 1 match, found 0: []
  ; The Checker Framework crashed.  Please report the crash.  Version: Checker Framework 3.42.0-eisop5. 
  Checker: class org.checkerframework.checker.nullness.NullnessChecker
  Exception: org.checkerframework.javacutil.BugInCF: TreeUtils.getMethod(org.checkerframework.framework.qual.DefaultQualifier, applyToSubpackages, 0): expected 1 match, found 0: []; org.checkerframework.javacutil.BugInCF: TreeUtils.getMethod(org.checkerframework.framework.qual.DefaultQualifier, applyToSubpackages, 0): expected 1 match, found 0: []
  	at org.checkerframework.javacutil.TreeUtils.getMethod(TreeUtils.java:1248)
  	at org.checkerframework.javacutil.TreeUtils.getMethod(TreeUtils.java:1223)
  	at org.checkerframework.framework.util.defaults.QualifierDefaults.<init>(QualifierDefaults.java:200)
  	at org.checkerframework.framework.type.GenericAnnotatedTypeFactory.createQualifierDefaults(GenericAnnotatedTypeFactory.java:800)
  	at org.checkerframework.framework.type.GenericAnnotatedTypeFactory.createAndInitQualifierDefaults(GenericAnnotatedTypeFactory.java:786)

Tasks:

  • Write an example that shows how to successfully use EP + NullAway + EISOP together in a project
  • Write a test case that has an invalid combination of typetools checker-qual and eisop checker, illustrating the crash
  • More gracefully handle the situation. If the applyToSubpackages attribute isn't there, issue a note to the user and continue without the feature.
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

1 participant