-
Notifications
You must be signed in to change notification settings - Fork 135
Implement several failing safety-analysis test cases #2272
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
base: develop
Are you sure you want to change the base?
Conversation
| @Test | ||
| void testFunctionSafeType() { | ||
| helper().addSourceLines( | ||
| "Test.java", | ||
| "import com.palantir.logsafe.*;", | ||
| "import java.util.function.*;", | ||
| "class Test {", | ||
| " // BUG: Diagnostic contains: Dangerous", | ||
| " Function<@Unsafe String, @Safe String> func = in -> in;", | ||
| "}") | ||
| .doTest(); | ||
| } | ||
|
|
||
| @Test | ||
| void testFunctionConsumesSafetyAnnotatedType_expression() { | ||
| helper().addSourceLines( | ||
| "Test.java", | ||
| "import com.palantir.logsafe.*;", | ||
| "import java.util.function.*;", | ||
| "class Test {", | ||
| " // BUG: Diagnostic contains: Dangerous", | ||
| " Consumer<@Unsafe String> func = in -> fun(in);", | ||
| " void fun(@Safe Object ob) {}", | ||
| "}") | ||
| .doTest(); | ||
| } | ||
|
|
||
| @Test | ||
| void testFunctionConsumesSafetyAnnotatedType_statement() { | ||
| helper().addSourceLines( | ||
| "Test.java", | ||
| "import com.palantir.logsafe.*;", | ||
| "import java.util.function.*;", | ||
| "class Test {", | ||
| " // BUG: Diagnostic contains: Dangerous", | ||
| " Consumer<@Unsafe String> func = in -> { fun(in); };", | ||
| " void fun(@Safe Object ob) {}", | ||
| "}") | ||
| .doTest(); | ||
| } |
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.
Fixed in #3050
| @Test | ||
| void testFunctionConsumesSafetyAnnotatedType_reference() { | ||
| helper().addSourceLines( | ||
| "Test.java", | ||
| "import com.palantir.logsafe.*;", | ||
| "import java.util.function.*;", | ||
| "class Test {", | ||
| " // BUG: Diagnostic contains: Dangerous", | ||
| " Consumer<@Unsafe String> func = Test::fun;", | ||
| " void fun(@Safe Object ob) {}", | ||
| "}") | ||
| .doTest(); | ||
| } |
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 has been addressed in #3052
|
This PR has been automatically marked as stale because it has not been touched in the last 14 days. If you'd like to keep it open, please leave a comment or add the 'long-lived' label, otherwise it'll be closed in 7 days. |
==COMMIT_MSG==
Implement several failing safety-analysis test cases
==COMMIT_MSG==
Getting these out of my head, into a system!