-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Generic Junit Injection #462
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still reviewing ...
@Test | ||
void test() { | ||
assertThat(intymcintface).isNotNull(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assert on stringy too
@@ -49,7 +50,7 @@ static class HelloBean { | |||
|
|||
static class MyPlugin implements Plugin { | |||
|
|||
public boolean forType(Class<?> type) { | |||
public boolean forType(Type type) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation, format only
* Return a single bean given its type and generic components. | ||
* | ||
* <pre>{@code | ||
* Map<String, CoffeeMaker> coffeeMaker = beanScope.get(Map.class, String.class, CoffeeMaker.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like extra functionality and not part of the bug fix?
Improve this example
* @throws java.util.NoSuchElementException When no matching bean is found | ||
*/ | ||
default <T> T get(@Nullable String name, Type type, Type... types) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whitespace formatting
This looks like extra functionality unrelated to the bug fix.
@@ -196,6 +197,12 @@ private <D> BeanScopeBuilder.ForTesting spy(Class<D> type, @Nullable String name | |||
return this; | |||
} | |||
|
|||
private <D> BeanScopeBuilder.ForTesting spy( | |||
Type type, @Nullable String name, @Nullable Consumer<D> consumer) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
formatting
private final Type rawType; | ||
public final Type[] typeArguments; | ||
|
||
public ParameterizedTypeImpl(Type ownerType, Type rawType, Type... typeArguments) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove public modifier
} | ||
|
||
/** Returns an array type whose elements are all instances of {@code componentType}. */ | ||
public static GenericArrayType arrayOf(Type elementType) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove public modifier
* Returns a new parameterized type, applying {@code typeArguments} to {@code rawType}. Use this | ||
* method if {@code rawType} is not enclosed in another type. | ||
*/ | ||
public static ParameterizedType newParameterizedType(Type rawType, Type... typeArguments) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove public modifier
|
||
} else if (type instanceof ParameterizedType) { | ||
ParameterizedType parameterizedType = (ParameterizedType) type; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whitespace
return rawType(((WildcardType) type).getUpperBounds()[0]); | ||
|
||
} else { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whitespace
resolves #461