From 2227e7023b162f4889773b7d9b004e36b5b70cf2 Mon Sep 17 00:00:00 2001 From: Emmanuel Jimenez Date: Thu, 11 Jun 2026 13:32:56 -0700 Subject: [PATCH] Remove unused ProcessorErrors methods. These methods using LazyString or Supplier for error messages were not being used anymore. RELNOTES=NA PiperOrigin-RevId: 930708366 --- .../processor/internal/ProcessorErrors.java | 48 ------------------- 1 file changed, 48 deletions(-) diff --git a/hilt-compiler/main/java/dagger/hilt/processor/internal/ProcessorErrors.java b/hilt-compiler/main/java/dagger/hilt/processor/internal/ProcessorErrors.java index ccbef75a487..ce97c857298 100644 --- a/hilt-compiler/main/java/dagger/hilt/processor/internal/ProcessorErrors.java +++ b/hilt-compiler/main/java/dagger/hilt/processor/internal/ProcessorErrors.java @@ -82,13 +82,6 @@ public static void checkState(boolean expression, Supplier errorMessageS } } - public static void checkState(boolean expression, LazyString errorMessage) { - if (!expression) { - throw new BadInputException(errorMessage.toString()); - } - } - - /** * Ensures the truth of an expression involving the state of the calling instance, but not * involving any parameters to the calling method. @@ -156,15 +149,6 @@ public static void checkState( } } - public static void checkState( - boolean expression, XElement badElement, LazyString errorMessage) { - Preconditions.checkNotNull(badElement); - if (!expression) { - throw new BadInputException(errorMessage.toString(), badElement); - } - } - - /** * Ensures the truth of an expression involving the state of the calling instance, but not * involving any parameters to the calling method. @@ -198,37 +182,5 @@ public static void checkStateX( } } - /** - * Ensures the truth of an expression involving the state of the calling instance, but not - * involving any parameters to the calling method. - * - * @param expression a boolean expression - * @param badElements the elements that were at fault - * @param errorMessageSupplier the supplier to construct the exception message if the check fails - * @throws BadInputException if {@code expression} is false - */ - public static void checkStateX( - boolean expression, - Collection badElements, - LazyString errorMessageSupplier) { - Preconditions.checkNotNull(badElements); - if (!expression) { - Preconditions.checkState(!badElements.isEmpty()); - throw new BadInputException(errorMessageSupplier.toString(), badElements); - } - } - - public static void checkStateX( - boolean expression, - Collection badElements, - Supplier errorMessageSupplier) { - Preconditions.checkNotNull(badElements); - if (!expression) { - Preconditions.checkState(!badElements.isEmpty()); - throw new BadInputException(errorMessageSupplier.get(), badElements); - } - } - - private ProcessorErrors() {} }