diff --git a/java/com/google/turbine/binder/Binder.java b/java/com/google/turbine/binder/Binder.java index d2ce948c..d5f1ed7a 100644 --- a/java/com/google/turbine/binder/Binder.java +++ b/java/com/google/turbine/binder/Binder.java @@ -91,6 +91,19 @@ public final class Binder { ClassPath bootclasspath, Optional moduleVersion) { TurbineLog log = new TurbineLog(); + BindingResult br = bind(log, units, classpath, processorInfo, bootclasspath, moduleVersion); + log.maybeThrow(); + return br; + } + + /** Binds symbols and types to the given compilation units. */ + public static @Nullable BindingResult bind( + TurbineLog log, + ImmutableList units, + ClassPath classpath, + ProcessorInfo processorInfo, + ClassPath bootclasspath, + Optional moduleVersion) { BindingResult br; try { br = @@ -114,7 +127,6 @@ public final class Binder { .addAll(turbineError.diagnostics()) .build()); } - log.maybeThrow(); return br; }