changeset 58350:60b7c8024c5f records

remove more dead code, for DocTrees for unused taglets
author jjg
date Thu, 17 Oct 2019 11:47:39 -0700
parents 66452d80d350
children 3732be3c579d e62676fdb665
files src/jdk.compiler/share/classes/com/sun/source/doctree/AccessorTree.java src/jdk.compiler/share/classes/com/sun/source/doctree/DocTree.java src/jdk.compiler/share/classes/com/sun/source/util/DocTreeFactory.java src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java src/jdk.compiler/share/classes/com/sun/tools/javac/tree/DCTree.java src/jdk.compiler/share/classes/com/sun/tools/javac/tree/DocTreeMaker.java
diffstat 6 files changed, 3 insertions(+), 119 deletions(-) [+]
line wrap: on
line diff
--- a/src/jdk.compiler/share/classes/com/sun/source/doctree/AccessorTree.java	Thu Oct 17 11:23:13 2019 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.source.doctree;
-
-import java.util.List;
-
-/**
- *
- * A tree node for an @getter or @setter block tag.
- *
- * <p>
- * &#064;getter description <br>
- * &#064;setter description <br>
- *
- * @since 1.10
- */
-public interface AccessorTree extends BlockTagTree {
-    /**
-     * Returns the description of the {@code @getter} or {@code @setter} tag.
-     * @return the description associated with this tag
-     */
-    List<? extends DocTree> getDescription();
-}
--- a/src/jdk.compiler/share/classes/com/sun/source/doctree/DocTree.java	Thu Oct 17 11:23:13 2019 -0700
+++ b/src/jdk.compiler/share/classes/com/sun/source/doctree/DocTree.java	Thu Oct 17 11:47:39 2019 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -37,18 +37,6 @@
     enum Kind {
 
         /**
-         * Used for instances of {@link AccessorTree}
-         * representing an embedded getter JavaDoc.
-         */
-        GETTER("getter"),
-
-        /**
-         * Used for instances of {@link AccessorTree}
-         * representing an embedded getter JavaDoc.
-         */
-        SETTER("setter"),
-
-        /**
          * Used for instances of {@link AttributeTree}
          * representing an HTML attribute.
          */
--- a/src/jdk.compiler/share/classes/com/sun/source/util/DocTreeFactory.java	Thu Oct 17 11:23:13 2019 -0700
+++ b/src/jdk.compiler/share/classes/com/sun/source/util/DocTreeFactory.java	Thu Oct 17 11:47:39 2019 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -237,13 +237,6 @@
     LiteralTree newLiteralTree(TextTree text);
 
     /**
-     * Create a new {@code AccessorTree} object, to represent a {@code @getter} tag.
-     * @param description the content of the tag
-     * @return a {@code AccessorTree} object
-     */
-    AccessorTree newAccessorTree(Kind kind, List<? extends DocTree> description);
-
-    /**
      * Create a new {@code ParamTree} object, to represent a {@code @param } tag.
      * @param isTypeParameter true if this is a type parameter, and false otherwise
      * @param name the parameter being described
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java	Thu Oct 17 11:23:13 2019 -0700
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java	Thu Oct 17 11:47:39 2019 -0700
@@ -1323,12 +1323,6 @@
                 }
             },
 
-            // {@getter text}
-            new AccessorParser(DCTree.Kind.GETTER),
-
-            // {@getter text}
-            new AccessorParser(DCTree.Kind.SETTER),
-
             // @param parameter-name description
             new TagParser(Kind.BLOCK, DCTree.Kind.PARAM) {
                 public DCTree parse(int pos) throws ParseException {
@@ -1533,15 +1527,4 @@
             tagParsers.put(names.fromString(p.getTreeKind().tagName), p);
 
     }
-
-    class AccessorParser extends TagParser {
-        AccessorParser(DocTree.Kind kind) {
-            super(Kind.BLOCK, kind, true);
-        }
-
-        public DCTree parse(int pos) throws ParseException {
-            List<DCTree> desc = blockContent();
-            return m.at(pos).newAccessorTree(treeKind, desc);
-        }
-    }
 }
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/DCTree.java	Thu Oct 17 11:23:13 2019 -0700
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/DCTree.java	Thu Oct 17 11:47:39 2019 -0700
@@ -575,32 +575,6 @@
         }
     }
 
-    public static class DCAccessor extends DCInlineTag implements AccessorTree {
-        public final Kind kind;
-        public final List<? extends DocTree> description;
-
-        DCAccessor(Kind kind, List<? extends DocTree> description) {
-            Assert.check(kind == Kind.GETTER || kind == Kind.SETTER);
-            this.kind = kind;
-            this.description = description;
-        }
-
-        @Override @DefinedBy(Api.COMPILER_TREE)
-        public Kind getKind() {
-            return kind;
-        }
-
-        @Override @DefinedBy(Api.COMPILER_TREE)
-        public <R, D> R accept(DocTreeVisitor<R, D> v, D d) {
-            return v.visitAccessor(this, d);
-        }
-
-        @Override @DefinedBy(Api.COMPILER_TREE)
-        public List<? extends DocTree> getDescription() {
-            return description;
-        }
-    }
-
     public static class DCParam extends DCBlockTag implements ParamTree {
         public final boolean isTypeParameter;
         public final DCIdentifier name;
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/DocTreeMaker.java	Thu Oct 17 11:23:13 2019 -0700
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/DocTreeMaker.java	Thu Oct 17 11:47:39 2019 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -55,7 +55,6 @@
 import com.sun.tools.javac.parser.ReferenceParser;
 import com.sun.tools.javac.parser.Tokens.Comment;
 import com.sun.tools.javac.parser.Tokens.Comment.CommentStyle;
-import com.sun.tools.javac.tree.DCTree.DCAccessor;
 import com.sun.tools.javac.tree.DCTree.DCAttribute;
 import com.sun.tools.javac.tree.DCTree.DCAuthor;
 import com.sun.tools.javac.tree.DCTree.DCComment;
@@ -362,13 +361,6 @@
     }
 
     @Override @DefinedBy(Api.COMPILER_TREE)
-    public DCAccessor newAccessorTree(Kind kind, List<? extends DocTree> desc) {
-        DCAccessor tree = new DCAccessor(kind, desc);
-        tree.pos = pos;
-        return tree;
-    }
-
-    @Override @DefinedBy(Api.COMPILER_TREE)
     public DCParam newParamTree(boolean isTypeParameter, IdentifierTree name, List<? extends DocTree> description) {
         DCParam tree = new DCParam(isTypeParameter, (DCIdentifier) name, cast(description));
         tree.pos = pos;