diff --git a/check_api/src/main/java/com/google/errorprone/scanner/ErrorProneInjector.java b/check_api/src/main/java/com/google/errorprone/scanner/ErrorProneInjector.java index 7a3c79cee5ac..2183023183ad 100644 --- a/check_api/src/main/java/com/google/errorprone/scanner/ErrorProneInjector.java +++ b/check_api/src/main/java/com/google/errorprone/scanner/ErrorProneInjector.java @@ -24,7 +24,6 @@ import com.google.common.collect.MutableClassToInstanceMap; import com.google.errorprone.ErrorProneFlags; import com.google.errorprone.annotations.CanIgnoreReturnValue; -import com.google.inject.ProvisionException; import java.lang.reflect.Constructor; import java.util.ArrayList; import java.util.List; @@ -41,6 +40,17 @@ public final class ErrorProneInjector { private final ClassToInstanceMap instances = MutableClassToInstanceMap.create(); + /** Indicates that there was a runtime failure while providing an instance. */ + public static final class ProvisionException extends RuntimeException { + public ProvisionException(String message) { + super(message); + } + + public ProvisionException(String message, Throwable cause) { + super(message, cause); + } + } + public static ErrorProneInjector create() { return new ErrorProneInjector(); } diff --git a/check_api/src/test/java/com/google/errorprone/scanner/ErrorProneInjectorTest.java b/check_api/src/test/java/com/google/errorprone/scanner/ErrorProneInjectorTest.java index 023b9ea30ac2..3d6dc3d02df4 100644 --- a/check_api/src/test/java/com/google/errorprone/scanner/ErrorProneInjectorTest.java +++ b/check_api/src/test/java/com/google/errorprone/scanner/ErrorProneInjectorTest.java @@ -19,7 +19,7 @@ import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.assertThrows; -import com.google.inject.ProvisionException; +import com.google.errorprone.scanner.ErrorProneInjector.ProvisionException; import javax.inject.Inject; import org.junit.Test; import org.junit.runner.RunWith;