-
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
Apply declaration bounds to string conversions and binary comparisons #213
Apply declaration bounds to string conversions and binary comparisons #213
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'll look at this in detail once #212 is merged.
framework/src/main/java/org/checkerframework/framework/flow/CFAbstractTransfer.java
Outdated
Show resolved
Hide resolved
framework/src/main/java/org/checkerframework/framework/type/AnnotatedTypeFactory.java
Outdated
Show resolved
Hide resolved
eead7d5
to
429a905
Compare
This reverts commit ec3c6e1.
429a905
to
1deedb7
Compare
…ng-conversion-node
…ng-conversion-node
…ng-conversion-node
…ng-conversion-node
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 for all the work on this, especially the extensive tests! I have a bunch of comments we can discuss.
javacutil/src/main/java/org/checkerframework/javacutil/TreeUtils.java
Outdated
Show resolved
Hide resolved
checker/src/main/java/org/checkerframework/checker/lock/LockTreeAnnotator.java
Show resolved
Hide resolved
framework/src/main/java/org/checkerframework/framework/flow/CFAbstractTransfer.java
Outdated
Show resolved
Hide resolved
framework/src/main/java/org/checkerframework/framework/flow/CFAbstractTransfer.java
Outdated
Show resolved
Hide resolved
framework/src/main/java/org/checkerframework/framework/flow/CFAbstractTransfer.java
Outdated
Show resolved
Hide resolved
framework/src/main/java/org/checkerframework/framework/type/AnnotatedTypeFactory.java
Outdated
Show resolved
Hide resolved
...rc/main/java/org/checkerframework/framework/type/treeannotator/PropagationTreeAnnotator.java
Outdated
Show resolved
Hide resolved
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 for all these fixes! I only have small comments.
Can you expand the changelog to mention these changes?
Also, should the PR title be a bit more general now?
checker/src/main/java/org/checkerframework/checker/signedness/SignednessVisitor.java
Show resolved
Hide resolved
framework/src/main/java/org/checkerframework/framework/type/AnnotatedTypeFactory.java
Outdated
Show resolved
Hide resolved
framework/src/main/java/org/checkerframework/framework/type/AnnotatedTypeFactory.java
Outdated
Show resolved
Hide resolved
framework/src/main/java/org/checkerframework/framework/type/AnnotatedTypeFactory.java
Outdated
Show resolved
Hide resolved
framework/src/main/java/org/checkerframework/framework/type/AnnotatedTypeFactory.java
Outdated
Show resolved
Hide resolved
javacutil/src/main/java/org/checkerframework/javacutil/TreeUtils.java
Outdated
Show resolved
Hide resolved
javacutil/src/main/java/org/checkerframework/javacutil/TreeUtils.java
Outdated
Show resolved
Hide resolved
javacutil/src/main/java/org/checkerframework/javacutil/TreeUtils.java
Outdated
Show resolved
Hide resolved
@@ -336,6 +336,17 @@ public static boolean isBooleanType(TypeMirror type) { | |||
return isDeclaredOfName(type, "java.lang.Boolean") || type.getKind() == TypeKind.BOOLEAN; | |||
} | |||
|
|||
/** | |||
* Checks if the type represents a character type, that is either char (primitive type) or |
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 see that this is similar to the comment on the above method, but shouldn't it be that is, is either...
? At the moment, doesn't this mean that there are other possible options for "character type", but we return true only for these two?
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 thought this means we are checking if the given TypeMirror
is a boxed or primitive character type. Could you please elaborate on "other possible options"?
…cai1/checker-framework into apply-bounds-to-string-conversion-node
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!
This PR is based on #212
Previously, string conversion node gets the same value as its operand has. This behavior is error prone because the annotations of its operand could be the supertypes of String's declaration bounds. This PR fixes such issue using the following rules:
One new issue is also introduced by this PR: opprop#208