[PATCH] 8036827: Incorrect printing of the generic method declaration

B. Blaser bsrbnd at gmail.com
Wed Jan 25 20:23:30 UTC 2017


Hi,

Next is a suggestion to remove javap's redundant printing of "extends
java.lang.Object" in the following example (according to JDK 8036827
description):

class JDK_8036827 {
    public <T> T m1(T a) {
        return null;
    }
}

Regards,
Bernard

diff --git a/src/jdk.jdeps/share/classes/com/sun/tools/javap/ClassWriter.java
b/src/jdk.jdeps/share/classes/com/sun/tools/javap/ClassWriter.java
--- a/src/jdk.jdeps/share/classes/com/sun/tools/javap/ClassWriter.java
+++ b/src/jdk.jdeps/share/classes/com/sun/tools/javap/ClassWriter.java
@@ -344,8 +344,7 @@
             public StringBuilder visitTypeParamType(TypeParamType
type, StringBuilder sb) {
                 sb.append(type.name);
                 String sep = " extends ";
-                if (type.classBound != null
-                        && (options.verbose || !type.classBound.isObject())) {
+                if (type.classBound != null && !type.classBound.isObject()) {
                     sb.append(sep);
                     append(sb, type.classBound);
                     sep = " & ";


More information about the compiler-dev mailing list