Skip to content

Commit

Permalink
Polishing
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrannen committed Jan 23, 2023
1 parent 0af9910 commit 30cfc3b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,10 @@ protected static Stream<? extends Arguments> arguments(ArgumentsProvider provide
}

private Object[] consumedArguments(Object[] arguments, ParameterizedTestMethodContext methodContext) {
int parameterCount = methodContext.getParameterCount();
if (methodContext.hasAggregator()) {
return arguments;
}
int parameterCount = methodContext.getParameterCount();
return arguments.length > parameterCount ? Arrays.copyOf(arguments, parameterCount) : arguments;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,14 @@ private static boolean looksLikeAFullyQualifiedMethodName(String factoryMethodNa
if (factoryMethodName.contains("#")) {
return true;
}
int indexOfDot = factoryMethodName.indexOf(".");
if (indexOfDot == -1) {
int indexOfFirstDot = factoryMethodName.indexOf('.');
if (indexOfFirstDot == -1) {
return false;
}
int indexOfOpeningParenthesis = factoryMethodName.indexOf("(");
if (indexOfOpeningParenthesis > 0) {
// Exclude simple method names with parameters
return indexOfDot < indexOfOpeningParenthesis;
int indexOfLastOpeningParenthesis = factoryMethodName.lastIndexOf('(');
if (indexOfLastOpeningParenthesis > 0) {
// Exclude simple/local method names with parameters
return indexOfFirstDot < indexOfLastOpeningParenthesis;
}
// If we get this far, we conclude the supplied factory method name "looks"
// like it was intended to be a fully qualified method name, even if the
Expand Down

0 comments on commit 30cfc3b

Please sign in to comment.