< prev index next >

src/java.base/share/classes/java/lang/constant/MethodTypeDesc.java

Print this page
rev 54588 : 8212975: ClassDesc should have a full name method
Reviewed-by: vromero

*** 179,193 **** * canonical names for parameter and return types. * * @return the human-readable descriptor for this method type */ default String displayDescriptor() { return String.format("(%s)%s", Stream.of(parameterArray()) ! .map(ClassDesc::displayName) .collect(Collectors.joining(",")), ! returnType().displayName()); } /** * Compares the specified object with this descriptor for equality. Returns * {@code true} if and only if the specified object is also a --- 179,205 ---- * canonical names for parameter and return types. * * @return the human-readable descriptor for this method type */ default String displayDescriptor() { + return displayDescriptor(false); + } + + /** + * Returns a human-readable descriptor for this method type, using the + * canonical names for parameter and return types. + * + * @param detail if true displays class names in full + * + * @return the human-readable descriptor for this method type + */ + default String displayDescriptor(boolean detail) { return String.format("(%s)%s", Stream.of(parameterArray()) ! .map(cd -> cd.displayName(detail)) .collect(Collectors.joining(",")), ! returnType().displayName(detail)); } /** * Compares the specified object with this descriptor for equality. Returns * {@code true} if and only if the specified object is also a
< prev index next >