From f254d3f8cc274ce20de28efdcb141ad63c7b44e5 Mon Sep 17 00:00:00 2001 From: Baptiste Candellier Date: Fri, 24 Jun 2022 19:09:46 +0200 Subject: [PATCH] fix: fix wording of some error messages --- .../toothpick/compiler/common/ToothpickProcessor.kt | 4 ++-- .../memberinjector/MemberInjectorProcessor.kt | 8 ++++---- .../memberinjector/FieldMemberInjectorTest.kt | 12 ++++++------ .../memberinjector/MethodMemberInjectorTest.kt | 8 ++++---- .../RelaxedFactoryForClassContainingFieldsTest.kt | 8 ++++---- .../RelaxedFactoryForClassContainingMethodsTest.kt | 8 ++++---- 6 files changed, 24 insertions(+), 24 deletions(-) diff --git a/compiler-core/src/main/java/toothpick/compiler/common/ToothpickProcessor.kt b/compiler-core/src/main/java/toothpick/compiler/common/ToothpickProcessor.kt index 9fa3eb71..7476c434 100644 --- a/compiler-core/src/main/java/toothpick/compiler/common/ToothpickProcessor.kt +++ b/compiler-core/src/main/java/toothpick/compiler/common/ToothpickProcessor.kt @@ -155,7 +155,7 @@ abstract class ToothpickProcessor( if (parentClass == null) { logger.error( this, - "@Inject-annotated property %s must be part of a class.", + "@Inject-annotated %s must be part of a class.", qualifiedName?.asString() ) return null @@ -164,7 +164,7 @@ abstract class ToothpickProcessor( if (parentClass.isPrivate()) { logger.error( this, - "Parent class of @Inject-annotated class %s must not be private.", + "Parent class of @Inject-annotated %s must not be private.", qualifiedName?.asString() ) return null diff --git a/compiler-memberinjector/src/main/java/toothpick/compiler/memberinjector/MemberInjectorProcessor.kt b/compiler-memberinjector/src/main/java/toothpick/compiler/memberinjector/MemberInjectorProcessor.kt index f794bcde..0494c9a1 100644 --- a/compiler-memberinjector/src/main/java/toothpick/compiler/memberinjector/MemberInjectorProcessor.kt +++ b/compiler-memberinjector/src/main/java/toothpick/compiler/memberinjector/MemberInjectorProcessor.kt @@ -140,7 +140,7 @@ class MemberInjectorProcessor( if (isPrivate()) { logger.error( this, - "@Inject-annotated property %s must not be private.", + "@Inject-annotated %s must not be private.", qualifiedName?.asString() ) return false @@ -149,7 +149,7 @@ class MemberInjectorProcessor( if (!isMutable || modifiers.contains(Modifier.FINAL)) { logger.error( this, - "@Inject-annotated property %s must be mutable.", + "@Inject-annotated %s must be mutable.", qualifiedName?.asString() ) return false @@ -165,7 +165,7 @@ class MemberInjectorProcessor( if (isPrivate()) { logger.error( this, - "@Inject-annotated method %s must not be private.", + "@Inject-annotated function %s must not be private.", qualifiedName?.asString() ) return false @@ -197,7 +197,7 @@ class MemberInjectorProcessor( if (!hasWarningSuppressed(SUPPRESS_WARNING_ANNOTATION_VISIBLE_VALUE)) { logger.crashOrWarnWhenMethodIsNotPackageOrInternal( this, - "@Inject-annotated method %s should have package or internal visibility.", + "@Inject-annotated function %s should have package or internal visibility.", qualifiedName?.asString() ) } diff --git a/compiler-memberinjector/src/test/java/toothpick/compiler/memberinjector/FieldMemberInjectorTest.kt b/compiler-memberinjector/src/test/java/toothpick/compiler/memberinjector/FieldMemberInjectorTest.kt index 2de84ad6..2c4a68c7 100644 --- a/compiler-memberinjector/src/test/java/toothpick/compiler/memberinjector/FieldMemberInjectorTest.kt +++ b/compiler-memberinjector/src/test/java/toothpick/compiler/memberinjector/FieldMemberInjectorTest.kt @@ -918,7 +918,7 @@ class FieldMemberInjectorTest { .processedWith(MemberInjectorProcessorProvider()) .failsToCompile() .withLogContaining( - "@Inject-annotated property test.TestFieldInjection.foo must not be private." + "@Inject-annotated test.TestFieldInjection.foo must not be private." ) } @@ -941,7 +941,7 @@ class FieldMemberInjectorTest { .processedWith(MemberInjectorProcessorProvider()) .failsToCompile() .withLogContaining( - "@Inject-annotated property test.TestFieldInjection.foo must not be private." + "@Inject-annotated test.TestFieldInjection.foo must not be private." ) } @@ -965,7 +965,7 @@ class FieldMemberInjectorTest { .processedWith(MemberInjectorProcessorProvider()) .failsToCompile() .withLogContaining( - "@Inject-annotated property test.TestFieldInjection.foo must be mutable." + "@Inject-annotated test.TestFieldInjection.foo must be mutable." ) } @@ -988,7 +988,7 @@ class FieldMemberInjectorTest { .processedWith(MemberInjectorProcessorProvider()) .failsToCompile() .withLogContaining( - "@Inject-annotated property test.TestFieldInjection.foo must be mutable." + "@Inject-annotated test.TestFieldInjection.foo must be mutable." ) } @@ -1014,7 +1014,7 @@ class FieldMemberInjectorTest { .processedWith(MemberInjectorProcessorProvider()) .failsToCompile() .withLogContaining( - "Parent class of @Inject-annotated class test.TestFieldInjection.InnerClass.foo must not be private." + "Parent class of @Inject-annotated test.TestFieldInjection.InnerClass.foo must not be private." ) } @@ -1039,7 +1039,7 @@ class FieldMemberInjectorTest { .processedWith(MemberInjectorProcessorProvider()) .failsToCompile() .withLogContaining( - "Parent class of @Inject-annotated class test.TestFieldInjection.InnerClass.foo must not be private." + "Parent class of @Inject-annotated test.TestFieldInjection.InnerClass.foo must not be private." ) } diff --git a/compiler-memberinjector/src/test/java/toothpick/compiler/memberinjector/MethodMemberInjectorTest.kt b/compiler-memberinjector/src/test/java/toothpick/compiler/memberinjector/MethodMemberInjectorTest.kt index 3797939f..6ca87780 100644 --- a/compiler-memberinjector/src/test/java/toothpick/compiler/memberinjector/MethodMemberInjectorTest.kt +++ b/compiler-memberinjector/src/test/java/toothpick/compiler/memberinjector/MethodMemberInjectorTest.kt @@ -410,7 +410,7 @@ class MethodMemberInjectorTest { .processedWith(MemberInjectorProcessorProvider()) .failsToCompile() .withLogContaining( - "@Inject-annotated method test.TestMethodInjection.m must not be private." + "@Inject-annotated function test.TestMethodInjection.m must not be private." ) } @@ -434,7 +434,7 @@ class MethodMemberInjectorTest { .processedWith(MemberInjectorProcessorProvider()) .failsToCompile() .withLogContaining( - "@Inject-annotated method test.TestMethodInjection.m must not be private." + "@Inject-annotated function test.TestMethodInjection.m must not be private." ) } @@ -460,7 +460,7 @@ class MethodMemberInjectorTest { .processedWith(MemberInjectorProcessorProvider()) .failsToCompile() .withLogContaining( - "Parent class of @Inject-annotated class test.TestMethodInjection.InnerClass.m must not be private." + "Parent class of @Inject-annotated test.TestMethodInjection.InnerClass.m must not be private." ) } @@ -486,7 +486,7 @@ class MethodMemberInjectorTest { .processedWith(MemberInjectorProcessorProvider()) .failsToCompile() .withLogContaining( - "Parent class of @Inject-annotated class test.TestMethodInjection.InnerClass.m must not be private." + "Parent class of @Inject-annotated test.TestMethodInjection.InnerClass.m must not be private." ) } diff --git a/compiler/src/test/java/toothpick/compiler/RelaxedFactoryForClassContainingFieldsTest.kt b/compiler/src/test/java/toothpick/compiler/RelaxedFactoryForClassContainingFieldsTest.kt index 387ba71d..40030233 100644 --- a/compiler/src/test/java/toothpick/compiler/RelaxedFactoryForClassContainingFieldsTest.kt +++ b/compiler/src/test/java/toothpick/compiler/RelaxedFactoryForClassContainingFieldsTest.kt @@ -129,7 +129,7 @@ class RelaxedFactoryForClassContainingFieldsTest { .processedWith(FactoryProcessorProvider(), MemberInjectorProcessorProvider()) .failsToCompile() .withLogContaining( - "@Inject-annotated property test.TestRelaxedFactoryCreationForInjectField.foo must not be private." + "@Inject-annotated test.TestRelaxedFactoryCreationForInjectField.foo must not be private." ) } @@ -152,7 +152,7 @@ class RelaxedFactoryForClassContainingFieldsTest { .processedWith(FactoryProcessorProvider(), MemberInjectorProcessorProvider()) .failsToCompile() .withLogContaining( - "@Inject-annotated property test.TestRelaxedFactoryCreationForInjectField.foo must not be private." + "@Inject-annotated test.TestRelaxedFactoryCreationForInjectField.foo must not be private." ) } @@ -177,7 +177,7 @@ class RelaxedFactoryForClassContainingFieldsTest { .processedWith(FactoryProcessorProvider(), MemberInjectorProcessorProvider()) .failsToCompile() .withLogContaining( - "Parent class of @Inject-annotated class test.TestRelaxedFactoryCreationForInjectField.InnerClass.foo must not be private." + "Parent class of @Inject-annotated test.TestRelaxedFactoryCreationForInjectField.InnerClass.foo must not be private." ) } @@ -202,7 +202,7 @@ class RelaxedFactoryForClassContainingFieldsTest { .processedWith(FactoryProcessorProvider(), MemberInjectorProcessorProvider()) .failsToCompile() .withLogContaining( - "TestRelaxedFactoryCreationForInjectField.kt:5: Parent class of @Inject-annotated class test.TestRelaxedFactoryCreationForInjectField.InnerClass.foo must not be private." + "TestRelaxedFactoryCreationForInjectField.kt:5: Parent class of @Inject-annotated test.TestRelaxedFactoryCreationForInjectField.InnerClass.foo must not be private." ) } diff --git a/compiler/src/test/java/toothpick/compiler/RelaxedFactoryForClassContainingMethodsTest.kt b/compiler/src/test/java/toothpick/compiler/RelaxedFactoryForClassContainingMethodsTest.kt index 0e0b454f..af9cfcfd 100644 --- a/compiler/src/test/java/toothpick/compiler/RelaxedFactoryForClassContainingMethodsTest.kt +++ b/compiler/src/test/java/toothpick/compiler/RelaxedFactoryForClassContainingMethodsTest.kt @@ -129,7 +129,7 @@ class RelaxedFactoryForClassContainingMethodsTest { .processedWith(FactoryProcessorProvider(), MemberInjectorProcessorProvider()) .failsToCompile() .withLogContaining( - "@Inject-annotated method test.TestRelaxedFactoryCreationForInjectMethod.m must not be private." + "@Inject-annotated function test.TestRelaxedFactoryCreationForInjectMethod.m must not be private." ) } @@ -152,7 +152,7 @@ class RelaxedFactoryForClassContainingMethodsTest { .processedWith(FactoryProcessorProvider(), MemberInjectorProcessorProvider()) .failsToCompile() .withLogContaining( - "@Inject-annotated method test.TestRelaxedFactoryCreationForInjectMethod.m must not be private." + "@Inject-annotated function test.TestRelaxedFactoryCreationForInjectMethod.m must not be private." ) } @@ -177,7 +177,7 @@ class RelaxedFactoryForClassContainingMethodsTest { .processedWith(FactoryProcessorProvider(), MemberInjectorProcessorProvider()) .failsToCompile() .withLogContaining( - "Parent class of @Inject-annotated class test.TestRelaxedFactoryCreationForInjectMethod.InnerClass.m must not be private." + "Parent class of @Inject-annotated test.TestRelaxedFactoryCreationForInjectMethod.InnerClass.m must not be private." ) } @@ -202,7 +202,7 @@ class RelaxedFactoryForClassContainingMethodsTest { .processedWith(FactoryProcessorProvider(), MemberInjectorProcessorProvider()) .failsToCompile() .withLogContaining( - "Parent class of @Inject-annotated class test.TestRelaxedFactoryCreationForInjectMethod.InnerClass.m must not be private." + "Parent class of @Inject-annotated test.TestRelaxedFactoryCreationForInjectMethod.InnerClass.m must not be private." ) }