No need to escape exceptions in recursionDetected()

This commit is contained in:
Andrey Breslav
2013-10-03 13:12:38 +04:00
parent db34868b6e
commit 4cd5c66c27
5 changed files with 25 additions and 27 deletions
@@ -50,7 +50,6 @@ import org.jetbrains.jet.lang.types.TypeUtils;
import org.jetbrains.jet.storage.NotNullLazyValue;
import org.jetbrains.jet.storage.NullableLazyValue;
import org.jetbrains.jet.storage.StorageManager;
import org.jetbrains.jet.utils.WrappedValues;
import java.util.*;
@@ -397,10 +396,10 @@ public class LazyClassDescriptor extends ClassDescriptorBase implements LazyDesc
}
}
},
new Function<Boolean, Object>() {
new Function<Boolean, Collection<JetType>>() {
@Override
public Object fun(Boolean firstTime) {
return WrappedValues.unescapeExceptionOrNull(Collections.emptyList());
public Collection<JetType> fun(Boolean firstTime) {
return Collections.emptyList();
}
},
new Consumer<Collection<JetType>>() {
@@ -4,7 +4,6 @@ import com.intellij.openapi.util.Computable;
import com.intellij.util.Consumer;
import com.intellij.util.Function;
import junit.framework.TestCase;
import org.jetbrains.jet.utils.WrappedValues;
import java.util.ArrayList;
import java.util.Arrays;
@@ -264,9 +263,9 @@ public class StorageManagerTest extends TestCase {
return rec.compute();
}
},
new Function<Boolean, Object>() {
new Function<Boolean, String>() {
@Override
public Object fun(Boolean aBoolean) {
public String fun(Boolean aBoolean) {
return "tolerant";
}
},
@@ -347,11 +346,11 @@ public class StorageManagerTest extends TestCase {
return rec.compute();
}
},
new Function<Boolean, Object>() {
new Function<Boolean, String>() {
@Override
public Object fun(Boolean firstTime) {
public String fun(Boolean firstTime) {
if (firstTime) {
return WrappedValues.escapeThrowable(new ReenteringLazyValueComputationException());
throw new ReenteringLazyValueComputationException();
}
return "second";
}