Refactoring: Introduce EMPTY AnalyzeExhaust constant

This commit is contained in:
Nikolay Krasko
2013-08-15 18:07:43 +04:00
parent 58aaa2bc00
commit a4f452a943
2 changed files with 3 additions and 7 deletions
@@ -24,6 +24,7 @@ import org.jetbrains.jet.lang.resolve.BodiesResolveContext;
import org.jetbrains.jet.lang.types.ErrorUtils;
public class AnalyzeExhaust {
public static final AnalyzeExhaust EMPTY = success(BindingContext.EMPTY, ErrorUtils.getErrorModule());
public static AnalyzeExhaust success(@NotNull BindingContext bindingContext, @NotNull ModuleDescriptor module) {
return new AnalyzeExhaust(bindingContext, module, null, null);
@@ -69,6 +70,7 @@ public class AnalyzeExhaust {
@NotNull
public Throwable getError() {
if (error == null) throw new IllegalStateException("Should be called only for error analyze result");
return error;
}