Removed redundant checking for test mode. Exceptions will be thrown anyway.

This commit is contained in:
Evgeny Gerashchenko
2013-03-27 17:20:29 +04:00
parent 3917f11b12
commit d8ccfe55b6
3 changed files with 10 additions and 26 deletions
@@ -17,7 +17,6 @@
package org.jetbrains.jet.lang.resolve.java.kotlinSignature;
import com.google.common.collect.*;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.util.Pair;
import com.intellij.openapi.util.SystemInfo;
@@ -655,16 +654,11 @@ public class SignaturesPropagationData {
private static void reportCantFindSuperFunction(PsiMethodWrapper method) {
String errorMessage = "Can't find super function for " + method.getPsiMethod() +
" defined in " + method.getPsiMethod().getContainingClass();
if (ApplicationManager.getApplication().isUnitTestMode()) {
throw new IllegalStateException(errorMessage);
if (SystemInfo.isMac) {
LOG.error("Remove duplicates from your JDK definition\n" + errorMessage);
}
else {
if (SystemInfo.isMac) {
LOG.error("Remove duplicates from your JDK definition\n" + errorMessage);
}
else {
LOG.error(errorMessage);
}
LOG.error(errorMessage);
}
}
@@ -243,20 +243,13 @@ public final class JavaFunctionResolver {
boolean returnTypeOk =
isReturnTypeOkForOverride(JetTypeChecker.INSTANCE, superFunctionSubstituted, functionDescriptor);
if (!paramsOk || !returnTypeOk) {
String errorMessage = "Loaded Java method overrides another, but resolved as Kotlin function, doesn't.\n"
+ "super function = " + superFunction + "\n"
+ "super class = " + superFunction.getContainingDeclaration() + "\n"
+ "sub function = " + functionDescriptor + "\n"
+ "sub class = " + functionDescriptor.getContainingDeclaration() + "\n"
+ "sub method = " + PsiFormatUtil.getExternalName(method.getPsiMethod()) + "\n"
+ "@KotlinSignature = " + method.getSignatureAnnotation().signature();
if (ApplicationManager.getApplication().isUnitTestMode()) {
throw new IllegalStateException(errorMessage);
}
else {
LOG.error(errorMessage);
}
LOG.error("Loaded Java method overrides another, but resolved as Kotlin function, doesn't.\n"
+ "super function = " + superFunction + "\n"
+ "super class = " + superFunction.getContainingDeclaration() + "\n"
+ "sub function = " + functionDescriptor + "\n"
+ "sub class = " + functionDescriptor.getContainingDeclaration() + "\n"
+ "sub method = " + PsiFormatUtil.getExternalName(method.getPsiMethod()) + "\n"
+ "@KotlinSignature = " + method.getSignatureAnnotation().signature());
}
}
}