Skip to content

Commit

Permalink
Fix typo JvmWildcards -> JvmWildcard
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 698476751
  • Loading branch information
java-team-github-bot authored and Guice Team committed Nov 20, 2024
1 parent 74ec25c commit 73aaaad
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ private MissingImplementationErrorHints() {}
private static final String WILDCARD_SUPER = "? super ";

private static final String WILDCARDS_WARNING =
"\nYou might be running into a @JvmSuppressWildcards or @JvmWildcards issue.";
"\nYou might be running into a @JvmSuppressWildcards or @JvmWildcard issue.";

private static final String WILDCARDS_POSSIBLE_FIXES =
"\nConsider these options instead (these are guesses but use your best judgment):";
Expand Down Expand Up @@ -150,7 +150,7 @@ private static boolean areSimilarTypes(

/**
* Conceptually, this method converts aType to be like bType by adding
* appropriate @JvmSuppressWildcards or @JvmWildcards annotations. This assumes that the two types
* appropriate @JvmSuppressWildcards or @JvmWildcard annotations. This assumes that the two types
* only differ in variance (e.g. `Foo` vs `? extends Foo`) and that aType is implemented in
* Kotlin. For example, if this method is called with the (List<? super String>,
* List<String>), it will return "List<@JvmSuppressWildcards String>".
Expand All @@ -169,10 +169,10 @@ static String convertToLatterViaJvmAnnotations(TypeLiteral<?> aType, TypeLiteral
conversion.append("@JvmSuppressWildcards ");
i += WILDCARD_SUPER.length(); // Skip over the "? super " part
} else if (b.startsWith(WILDCARD_EXTENDS, j)) {
conversion.append("@JvmWildcards ");
conversion.append("@JvmWildcard ");
j += WILDCARD_EXTENDS.length(); // Skip over the "? extends " part
} else if (b.startsWith(WILDCARD_SUPER, j)) {
conversion.append("@JvmWildcards ");
conversion.append("@JvmWildcard ");
j += WILDCARD_SUPER.length(); // Skip over the "? super " part
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ Unable to create injector, see the following errors:

1) [Guice/MissingImplementation]: No implementation for Producer<? extends Foo> was bound.

You might be running into a @JvmSuppressWildcards or @JvmWildcards issue.
You might be running into a @JvmSuppressWildcards or @JvmWildcard issue.
Consider these options instead (these are guesses but use your best judgment):
* Inject this: Producer<@JvmSuppressWildcards Foo>
* Or bind this: Producer<@JvmWildcards Foo> at MissingImplementationErrorKtTest$InjectionHasUnnecessaryExtendsClauseModule.provideProducerOfFoo(MissingImplementationErrorKtTest.kt:52)
* Or bind this: Producer<@JvmWildcard Foo> at MissingImplementationErrorKtTest$InjectionHasUnnecessaryExtendsClauseModule.provideProducerOfFoo(MissingImplementationErrorKtTest.kt:52)

Requested by:
1 : MissingImplementationErrorKtTest$InjectionHasUnnecessaryExtendsClauseModule.injectProducerOfFoo(MissingImplementationErrorKtTest.kt:56)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ Unable to create injector, see the following errors:

1) [Guice/MissingImplementation]: No implementation for Consumer<? super Foo> was bound.

You might be running into a @JvmSuppressWildcards or @JvmWildcards issue.
You might be running into a @JvmSuppressWildcards or @JvmWildcard issue.
Consider these options instead (these are guesses but use your best judgment):
* Inject this: Consumer<@JvmSuppressWildcards Foo>
* Or bind this: Consumer<@JvmWildcards Foo> at MissingImplementationErrorKtTest$InjectionHasUnnecessarySuperClauseModule.provideConsumerOfFoo(MissingImplementationErrorKtTest.kt:95)
* Or bind this: Consumer<@JvmWildcard Foo> at MissingImplementationErrorKtTest$InjectionHasUnnecessarySuperClauseModule.provideConsumerOfFoo(MissingImplementationErrorKtTest.kt:95)

Requested by:
1 : MissingImplementationErrorKtTest$InjectionHasUnnecessarySuperClauseModule.injectConsumerOfFoo(MissingImplementationErrorKtTest.kt:99)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ Unable to create injector, see the following errors:

1) [Guice/MissingImplementation]: No implementation for Producer<Foo> was bound.

You might be running into a @JvmSuppressWildcards or @JvmWildcards issue.
You might be running into a @JvmSuppressWildcards or @JvmWildcard issue.
Consider these options instead (these are guesses but use your best judgment):
* Inject this: Producer<@JvmWildcards Foo>
* Inject this: Producer<@JvmWildcard Foo>
* Or bind this: Producer<@JvmSuppressWildcards Foo> at MissingImplementationErrorKtTest$InjectionMissingExtendsClauseModule.configure(MissingImplementationErrorKtTest.kt:114)

Requested by:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ Unable to create injector, see the following errors:

1) [Guice/MissingImplementation]: No implementation for Consumer<Foo> was bound.

You might be running into a @JvmSuppressWildcards or @JvmWildcards issue.
You might be running into a @JvmSuppressWildcards or @JvmWildcard issue.
Consider these options instead (these are guesses but use your best judgment):
* Inject this: Consumer<@JvmWildcards Foo>
* Inject this: Consumer<@JvmWildcard Foo>
* Or bind this: Consumer<@JvmSuppressWildcards Foo> at MissingImplementationErrorKtTest$InjectionMissingSuperClauseModule.configure(MissingImplementationErrorKtTest.kt:114)

Requested by:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public void oneTypeConversion() {
convertToLatterViaJvmAnnotations(
new TypeLiteral<Map<String, Integer>>() {},
new TypeLiteral<Map<? extends String, Integer>>() {}))
.isEqualTo("java.util.Map<@JvmWildcards java.lang.String, java.lang.Integer>");
.isEqualTo("java.util.Map<@JvmWildcard java.lang.String, java.lang.Integer>");
}

@Test
Expand All @@ -155,7 +155,7 @@ public void mixedConversion() {
new TypeLiteral<Map<String, ? extends Integer>>() {},
new TypeLiteral<Map<? extends String, Integer>>() {}))
.isEqualTo(
"java.util.Map<@JvmWildcards java.lang.String,"
"java.util.Map<@JvmWildcard java.lang.String,"
+ " @JvmSuppressWildcards java.lang.Integer>");
}

Expand All @@ -166,7 +166,7 @@ public void complexConversion() {
new TypeLiteral<Map<List<? extends String>, ? super Integer>>() {},
new TypeLiteral<Map<? extends List<? extends String>, Integer>>() {}))
.isEqualTo(
"java.util.Map<@JvmWildcards java.util.List<out java.lang.String>,"
"java.util.Map<@JvmWildcard java.util.List<out java.lang.String>,"
+ " @JvmSuppressWildcards java.lang.Integer>");
}
}

0 comments on commit 73aaaad

Please sign in to comment.