From 3fe97540a530834cda0ced5f52ef98a1af028f30 Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Wed, 9 Apr 2014 19:33:49 +0400 Subject: [PATCH] notnull --- .../testSrc/com/intellij/psi/ConstantValuesTest.java | 5 +++-- .../testSrc/com/intellij/psi/PsiConcurrencyStressTest.java | 3 ++- .../src/com/intellij/openapi/application/RunResult.java | 4 +++- .../src/com/intellij/testFramework/PlatformTestCase.java | 2 +- .../src/com/intellij/testFramework/UsefulTestCase.java | 2 +- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/java/java-tests/testSrc/com/intellij/psi/ConstantValuesTest.java b/java/java-tests/testSrc/com/intellij/psi/ConstantValuesTest.java index 5c3b63139860..af68ad625ac8 100644 --- a/java/java-tests/testSrc/com/intellij/psi/ConstantValuesTest.java +++ b/java/java-tests/testSrc/com/intellij/psi/ConstantValuesTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * Copyright 2000-2014 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,6 +25,7 @@ import com.intellij.psi.impl.JavaConstantExpressionEvaluator; import com.intellij.psi.search.GlobalSearchScope; import com.intellij.testFramework.PsiTestCase; import com.intellij.testFramework.PsiTestUtil; +import org.jetbrains.annotations.NotNull; import java.io.IOException; @@ -57,7 +58,7 @@ public class ConstantValuesTest extends PsiTestCase{ } @Override - protected void invokeTestRunnable(Runnable runnable) throws Exception { + protected void invokeTestRunnable(@NotNull Runnable runnable) throws Exception { super.invokeTestRunnable(runnable); final PsiJavaFile file = (PsiJavaFile)myClass.getContainingFile(); diff --git a/java/java-tests/testSrc/com/intellij/psi/PsiConcurrencyStressTest.java b/java/java-tests/testSrc/com/intellij/psi/PsiConcurrencyStressTest.java index 9250602002dd..8316fe7111da 100644 --- a/java/java-tests/testSrc/com/intellij/psi/PsiConcurrencyStressTest.java +++ b/java/java-tests/testSrc/com/intellij/psi/PsiConcurrencyStressTest.java @@ -33,6 +33,7 @@ import com.intellij.pom.java.LanguageLevel; import com.intellij.psi.search.GlobalSearchScope; import com.intellij.testFramework.*; import com.intellij.util.IncorrectOperationException; +import org.jetbrains.annotations.NotNull; import java.util.Random; import java.util.concurrent.CountDownLatch; @@ -193,7 +194,7 @@ public class PsiConcurrencyStressTest extends PsiTestCase { } @Override - protected void invokeTestRunnable(final Runnable runnable) throws Exception { + protected void invokeTestRunnable(@NotNull final Runnable runnable) throws Exception { runnable.run(); } } diff --git a/platform/core-api/src/com/intellij/openapi/application/RunResult.java b/platform/core-api/src/com/intellij/openapi/application/RunResult.java index 85c84480a6cf..4d41bbb86889 100644 --- a/platform/core-api/src/com/intellij/openapi/application/RunResult.java +++ b/platform/core-api/src/com/intellij/openapi/application/RunResult.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * Copyright 2000-2014 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -63,6 +63,7 @@ public class RunResult extends Result { return myResult; } + @NotNull public RunResult logException(Logger logger) { if (hasException()) { logger.error(myThrowable); @@ -71,6 +72,7 @@ public class RunResult extends Result { return this; } + @NotNull public RunResult throwException() throws RuntimeException, Error { if (hasException()) { if (myThrowable instanceof RuntimeException) { diff --git a/platform/testFramework/src/com/intellij/testFramework/PlatformTestCase.java b/platform/testFramework/src/com/intellij/testFramework/PlatformTestCase.java index ddc240e9f2c6..8d062af0780f 100644 --- a/platform/testFramework/src/com/intellij/testFramework/PlatformTestCase.java +++ b/platform/testFramework/src/com/intellij/testFramework/PlatformTestCase.java @@ -694,7 +694,7 @@ public abstract class PlatformTestCase extends UsefulTestCase implements DataPro } @Override - protected void invokeTestRunnable(final Runnable runnable) throws Exception { + protected void invokeTestRunnable(@NotNull final Runnable runnable) throws Exception { final Exception[] e = new Exception[1]; Runnable runnable1 = new Runnable() { @Override diff --git a/platform/testFramework/src/com/intellij/testFramework/UsefulTestCase.java b/platform/testFramework/src/com/intellij/testFramework/UsefulTestCase.java index d8a5f0fb9408..40ecf18868c3 100644 --- a/platform/testFramework/src/com/intellij/testFramework/UsefulTestCase.java +++ b/platform/testFramework/src/com/intellij/testFramework/UsefulTestCase.java @@ -328,7 +328,7 @@ public abstract class UsefulTestCase extends TestCase { UIUtil.invokeAndWaitIfNeeded(r); } - protected void invokeTestRunnable(Runnable runnable) throws Exception { + protected void invokeTestRunnable(@NotNull Runnable runnable) throws Exception { UIUtil.invokeAndWaitIfNeeded(runnable); //runnable.run(); }