Skip to content

Commit

Permalink
Test assignment to catch() variable.
Browse files Browse the repository at this point in the history
RELNOTES: none
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=117841559
  • Loading branch information
cpovirk authored and cushon committed Mar 23, 2016
1 parent 06b7c8c commit 672a344
Showing 1 changed file with 7 additions and 3 deletions.
Expand Up @@ -20,7 +20,7 @@
import java.io.OutputStream;

/**
* Tests for caught exceptions.
* Tests for {@code try} blocks.
*/
public class NullnessPropagationTransferCases8 {
public void caughtException() {
Expand All @@ -29,6 +29,10 @@ public void caughtException() {
} catch (Throwable t) {
// BUG: Diagnostic contains: (Non-null)
triggerNullnessChecker(t);

t = something();
// BUG: Diagnostic contains: (Nullable)
triggerNullnessChecker(t);
}
}

Expand All @@ -44,7 +48,7 @@ void tryWithResources() throws Exception {
}
}

OutputStream something() {
return new ByteArrayOutputStream();
<T> T something() {
return null;
}
}

0 comments on commit 672a344

Please sign in to comment.