8217000: Refactor Class::methodToString

Reviewed-by: smarks
This commit is contained in:
Joe Darcy 2019-01-15 19:10:40 -08:00
parent 3a1f460d19
commit 38cf9d76c8
2 changed files with 25 additions and 22 deletions

View file

@ -272,8 +272,9 @@ public final class Class<T> implements java.io.Serializable,
TypeVariable<?>[] typeparms = component.getTypeParameters();
if (typeparms.length > 0) {
sb.append(Stream.of(typeparms).map(Class::typeVarBounds).
collect(Collectors.joining(",", "<", ">")));
sb.append(Arrays.stream(typeparms)
.map(Class::typeVarBounds)
.collect(Collectors.joining(",", "<", ">")));
}
for (int i = 0; i < arrayDepth; i++)
@ -289,8 +290,9 @@ public final class Class<T> implements java.io.Serializable,
return typeVar.getName();
} else {
return typeVar.getName() + " extends " +
Stream.of(bounds).map(Type::getTypeName).
collect(Collectors.joining(" & "));
Arrays.stream(bounds)
.map(Type::getTypeName)
.collect(Collectors.joining(" & "));
}
}
@ -3419,8 +3421,9 @@ public final class Class<T> implements java.io.Serializable,
StringBuilder sb = new StringBuilder();
sb.append(getName() + "." + name + "(");
if (argTypes != null) {
sb.append(Stream.of(argTypes).map(c -> {return (c == null) ? "null" : c.getName();}).
collect(Collectors.joining(",")));
sb.append(Arrays.stream(argTypes)
.map(c -> (c == null) ? "null" : c.getName())
.collect(Collectors.joining(",")));
}
sb.append(")");
return sb.toString();