-
Notifications
You must be signed in to change notification settings - Fork 19
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 EISOP issue #321 #325
Fix EISOP issue #321 #325
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I only have a few small comments.
We can ignore the daikon failure, it will go away when I update with the next typetools release.
framework/src/main/java/org/checkerframework/framework/stub/AnnotationFileElementTypes.java
Outdated
Show resolved
Hide resolved
*/ | ||
void preProcessTopLevelType(String typeName) { | ||
boolean success = processingClasses.add(typeName); | ||
assert success; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assert success; | |
assert success : "type " + typeName + " is already being processed!"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the failure string make it clearer what is going wrong? Can you improve on it?
Instead of success
, would changed
be clearer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm also wondering whether to throw a BugInCF
instead of an assert - if you're worried that this could arise in a client configuration, the assert is likely not enabled and a BugInCF
would ensure we raise an error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think added
is more straightforward. I'm also using BugInCF
now to ensure we always raise the error.
framework/src/main/java/org/checkerframework/framework/stub/AnnotationFileElementTypes.java
Outdated
Show resolved
Hide resolved
framework/src/main/java/org/checkerframework/framework/stub/AnnotationFileElementTypes.java
Outdated
Show resolved
Hide resolved
framework/src/main/java/org/checkerframework/framework/stub/AnnotationFileParser.java
Outdated
Show resolved
Hide resolved
framework/src/main/java/org/checkerframework/framework/stub/AnnotationFileParser.java
Outdated
Show resolved
Hide resolved
framework/src/main/java/org/checkerframework/framework/stub/AnnotationFileParser.java
Outdated
Show resolved
Hide resolved
framework/src/main/java/org/checkerframework/framework/stub/AnnotationFileParser.java
Show resolved
Hide resolved
framework/src/main/java/org/checkerframework/framework/stub/AnnotationFileParser.java
Outdated
Show resolved
Hide resolved
@@ -3119,16 +3149,27 @@ private void stubDebug(String warning) { | |||
private class AjavaAnnotationCollectorVisitor extends DefaultJointVisitor { | |||
@Override | |||
public Void visitClass(ClassTree javacTree, Node javaParserNode) { | |||
TypeDeclaration<?> typeDecl = (TypeDeclaration<?>) javaParserNode; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The old code guarded this cast by an instanceof
. No test fails with a ClassCastException, but do you see any reason why the previous code used an instanceof
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, from its super implementation, it seems javaParserNode
can have type of LocalClassDeclarationStmt
or LocalRecordDeclarationStmt
. These two types are not TypeDeclaration
but wrappers for ClassOrInterfaceDeclaration
and RecordDeclaration
, which will be unwrapped by the call super.visitClass(...)
. So, I need to add the instanceof
check back.
…notationFileElementTypes.java Co-authored-by: Werner Dietl <[email protected]>
…notationFileElementTypes.java Co-authored-by: Werner Dietl <[email protected]>
…notationFileParser.java Co-authored-by: Werner Dietl <[email protected]>
…notationFileParser.java Co-authored-by: Werner Dietl <[email protected]>
…notationFileParser.java Co-authored-by: Werner Dietl <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looks great!
This PR fixes #321 by preventing the parsing of multiple stub files for the same JDK class in the same round.