-
Notifications
You must be signed in to change notification settings - Fork 134
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 safety evaluation requiring lhs assignment to be safe unnecessarily #2242
Fix safety evaluation requiring lhs assignment to be safe unnecessarily #2242
Conversation
The type parameter passthrough code would evaluate to SAFE rather than UNKNOWN when type parameters were unknown/erased.
Generate changelog in
|
"Test.java", | ||
"import com.palantir.logsafe.*;", | ||
"import java.util.*;", | ||
"class Test<OutputT> {", |
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.
This test exposed the issue, but only when the (unused) type parameter is present. JCTree.type
of the field when <OutputT>
is present is java.util.Set
and without it, JCTree.type
is java.util.Set<java.lang.Throwable>
!
I've updated the check to both:
- avoid returning type-info based safety in the case that there's no type info
- check both the symbol type and tree type for safety info
Released 4.123.0 |
###### _excavator_ is a bot for automating changes across repositories. Changes produced by the roomba/latest-baseline-oss check. # Release Notes ## 4.123.0 | Type | Description | Link | | ---- | ----------- | ---- | | Improvement | Fix safety evaluation requiring lhs of an assignment to be safe unnecessarily | palantir/gradle-baseline#2242 | ## 4.124.0 | Type | Description | Link | | ---- | ----------- | ---- | | Fix | VarUsage failures reference a real tree | palantir/gradle-baseline#2244 | To enable or disable this check, please contact the maintainers of Excavator.
The type parameter passthrough code would evaluate to SAFE rather
as opposed to UNKNOWN when type parameters were unknown/erased.
==COMMIT_MSG==
Fix safety evaluation requiring lhs of an assignment to be safe unnecessarily
==COMMIT_MSG==