summaryrefslogtreecommitdiff
path: root/java/java-tests/testData/inspection/dataFlow/fixture/ContractWithNoArgs.java
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2014-08-19 12:53:10 -0700
committerTor Norbye <tnorbye@google.com>2014-08-19 12:53:10 -0700
commit02cf98d65c798d368fcec43ed64a001d513bdd4f (patch)
treee39e210ab20917b7e5ffdce14a42f5747506eed0 /java/java-tests/testData/inspection/dataFlow/fixture/ContractWithNoArgs.java
parent2e5965e996aad62ab1338b09d54caaf99ff3dd6a (diff)
downloadidea-02cf98d65c798d368fcec43ed64a001d513bdd4f.tar.gz
Snapshot idea/138.1503 from git://git.jetbrains.org/idea/community.git
Change-Id: Ie01af1d8710ec0ff51d90301bda1a18b0b5c0faf
Diffstat (limited to 'java/java-tests/testData/inspection/dataFlow/fixture/ContractWithNoArgs.java')
-rw-r--r--java/java-tests/testData/inspection/dataFlow/fixture/ContractWithNoArgs.java24
1 files changed, 24 insertions, 0 deletions
diff --git a/java/java-tests/testData/inspection/dataFlow/fixture/ContractWithNoArgs.java b/java/java-tests/testData/inspection/dataFlow/fixture/ContractWithNoArgs.java
new file mode 100644
index 000000000000..006c2e3407ec
--- /dev/null
+++ b/java/java-tests/testData/inspection/dataFlow/fixture/ContractWithNoArgs.java
@@ -0,0 +1,24 @@
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+class Doo {
+
+ @NotNull
+ public String doSomething() {
+ String s = getSomeString();
+ if (s == null) {
+ throwSomeError();
+ }
+ return s;
+ }
+
+ private static void throwSomeError() {
+ throw new RuntimeException();
+ }
+
+ @Nullable
+ public String getSomeString() {
+ return Math.random() > 0.5 ? null : "Yeah";
+ }
+
+}