Skip to content

Commit

Permalink
Prefer constructors with String
Browse files Browse the repository at this point in the history
  • Loading branch information
daivanov committed Jun 13, 2018
1 parent 6fd086e commit 4e8cd7c
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ public int methodComplexity(Method method) {

int complexity = 0;
for (Class<?> parameter : method.getParameterTypes()) {
if (parameter.isInterface()
|| (Modifier.isAbstract(parameter.getModifiers()) && !parameter.isPrimitive())
|| parameter.isAssignableFrom(method.getDeclaringClass())) {
complexity++;
if (!parameter.isPrimitive() && !parameter.equals(String.class)) {
if (parameter.isInterface()
|| Modifier.isAbstract(parameter.getModifiers())
|| parameter.isAssignableFrom(method.getDeclaringClass())) {
complexity++;
}
}
}
return complexity;
Expand Down

0 comments on commit 4e8cd7c

Please sign in to comment.