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

Don't crash on binding variables. #5015

Merged
merged 4 commits into from
Jan 27, 2022
Merged

Don't crash on binding variables. #5015

merged 4 commits into from
Jan 27, 2022

Conversation

kelloggm
Copy link
Contributor

@kelloggm kelloggm commented Jan 21, 2022

This pull request makes it so that the Checker Framework does not crash on binding variables, but the Checker Framework still needs to properly check and type binding variables. See issue #5021.

Fixes #5013.

@kelloggm kelloggm assigned kelloggm and unassigned smillst Jan 21, 2022
@kelloggm
Copy link
Contributor Author

I've investigated the test failure here and I'm not sure how to resolve it. @smillst do you have any idea how to handle the issue described below?

The tests are failing due to a BugInCF error issued by the method testJointJavacJavaParserVisitor in BaseTypeVisitor. This issue does not occur when I run the index checker from the command line on its own; only during the tests. I think it has something to do with the processing of .ajava files.

The problem appears to be that the JointJavacJavaParserVisitor does not have any notion of what to do with a binding variable. There is a method in that class visitBindingPattern17 that I think is where such an action should take place, but it's empty and returns null. I don't know this part of the code base, so I'm not exactly certain what it is supposed to be doing - from what I can gather, it's just testing that every Javac Tree has a matching node in the JavaParser parse? But not sure how that is achieved.

Here are some possible paths forward:

  • figure out what needs to go in JointJavacJavaParserVisitor#visitBindingPattern17 to make the test succeed
  • disable the test in the Index Checker tests, somehow.

There are two things I'm unsure of:

  • what the specification of JointJavacJavaParserVisitor#visitBindingPattern17 should be
  • what the consequences of disabling this test for the Index Checker's test suite would be

@smillst
Copy link
Member

smillst commented Jan 24, 2022

I'll fix JointJavacJavaParserVisitor#visitBindingPattern17. I implemented JointJavacJavaParserVisitor#visitSwitchExpression17, so I know what to do.

@smillst smillst changed the title Fix for issue 5013: handle binding variables when when reading java expression from string Don't crash on binding variables. Jan 25, 2022
@smillst smillst assigned mernst and unassigned smillst Jan 25, 2022
@mernst mernst merged commit 3935b4c into typetools:master Jan 27, 2022
@mernst mernst deleted the 5013 branch January 27, 2022 16:51
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.

Index Checker crashes on pattern matching variable
3 participants