< prev index next >

src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java

Print this page
rev 52865 : [mq]: 8210031

@@ -69,10 +69,20 @@
  * @author Robert Field
  * @author Bhavesh Patel (Modified)
  */
 public class ClassWriterImpl extends SubWriterHolderWriter implements ClassWriter {
 
+    private static final Set<String> suppressSubtypesSet
+            = Set.of("java.lang.Object",
+                     "org.omg.CORBA.Object");
+
+    private static final Set<String> suppressImplementingSet
+            = Set.of( "java.lang.Cloneable",
+                    "java.lang.constant.Constable",
+                    "java.lang.constant.ConstantDesc",
+                    "java.io.Serializable");
+
     protected final TypeElement typeElement;
 
     protected final ClassTree classtree;
 
     private final Navigation navBar;

@@ -368,14 +378,15 @@
      * {@inheritDoc}
      */
     @Override
     public void addSubClassInfo(Content classInfoTree) {
         if (utils.isClass(typeElement)) {
-            if (typeElement.getQualifiedName().contentEquals("java.lang.Object") ||
-                    typeElement.getQualifiedName().contentEquals("org.omg.CORBA.Object")) {
+            for (String s : suppressSubtypesSet) {
+                if (typeElement.getQualifiedName().contentEquals(s)) {
                 return;    // Don't generate the list, too huge
             }
+            }
             Set<TypeElement> subclasses = classtree.directSubClasses(typeElement, false);
             if (!subclasses.isEmpty()) {
                 Content label = contents.subclassesLabel;
                 Content dt = HtmlTree.DT(label);
                 Content dl = HtmlTree.DL(dt);

@@ -410,13 +421,14 @@
     @Override
     public void addInterfaceUsageInfo (Content classInfoTree) {
         if (!utils.isInterface(typeElement)) {
             return;
         }
-        if (typeElement.getQualifiedName().contentEquals("java.lang.Cloneable") ||
-                typeElement.getQualifiedName().contentEquals("java.io.Serializable")) {
-            return;   // Don't generate the list, too big
+        for (String s : suppressImplementingSet) {
+            if (typeElement.getQualifiedName().contentEquals(s)) {
+                return;    // Don't generate the list, too huge
+            }
         }
         Set<TypeElement> implcl = classtree.implementingClasses(typeElement);
         if (!implcl.isEmpty()) {
             Content label = contents.implementingClassesLabel;
             Content dt = HtmlTree.DT(label);
< prev index next >