From 39714b603040f1619f5e0e2a13ea8a90bb993c27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20Walln=C3=B6fer?= Date: Wed, 28 May 2025 09:46:49 +0000 Subject: [PATCH] 8357869: Remove PreviewNote taglet in its current form Reviewed-by: erikj --- make/Docs.gmk | 2 - .../build/tools/taglet/PreviewNote.java | 127 ------------------ 2 files changed, 129 deletions(-) delete mode 100644 make/jdk/src/classes/build/tools/taglet/PreviewNote.java diff --git a/make/Docs.gmk b/make/Docs.gmk index 9026217fa42..d88683e2b28 100644 --- a/make/Docs.gmk +++ b/make/Docs.gmk @@ -79,8 +79,6 @@ JAVADOC_TAGS := \ -tag see \ -taglet build.tools.taglet.ExtLink \ -taglet build.tools.taglet.Incubating \ - -taglet build.tools.taglet.PreviewNote \ - --preview-note-tag previewNote \ -tagletpath $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \ $(CUSTOM_JAVADOC_TAGS) \ # diff --git a/make/jdk/src/classes/build/tools/taglet/PreviewNote.java b/make/jdk/src/classes/build/tools/taglet/PreviewNote.java deleted file mode 100644 index ee3f9bea527..00000000000 --- a/make/jdk/src/classes/build/tools/taglet/PreviewNote.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright (c) 2025, 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 build.tools.taglet; - -import java.util.EnumSet; -import java.util.List; -import java.util.Set; - - -import javax.lang.model.element.Element; -import javax.tools.Diagnostic; - - -import com.sun.source.doctree.DocTree; -import com.sun.source.doctree.UnknownInlineTagTree; -import jdk.javadoc.doclet.Doclet; -import jdk.javadoc.doclet.DocletEnvironment; -import jdk.javadoc.doclet.Reporter; -import jdk.javadoc.doclet.StandardDoclet; -import jdk.javadoc.doclet.Taglet; - -import static com.sun.source.doctree.DocTree.Kind.UNKNOWN_INLINE_TAG; - -/** - * An inline tag to insert a note formatted as preview note. - * The tag can be used as follows: - * - *
- * {@previewNote jep-number [Preview note heading]}
- * Preview note content
- * {@previewNote}
- * 
- * - */ -public class PreviewNote implements Taglet { - - static final String TAG_NAME = "previewNote"; - Reporter reporter = null; - - @Override - public void init(DocletEnvironment env, Doclet doclet) { - if (doclet instanceof StandardDoclet stdoclet) { - reporter = stdoclet.getReporter(); - } - } - - /** - * Returns the set of locations in which the tag may be used. - */ - @Override - public Set getAllowedLocations() { - return EnumSet.allOf(Taglet.Location.class); - } - - @Override - public boolean isInlineTag() { - return true; - } - - @Override - public String getName() { - return TAG_NAME; - } - - @Override - public String toString(List tags, Element elem) { - - for (DocTree tag : tags) { - if (tag.getKind() == UNKNOWN_INLINE_TAG) { - UnknownInlineTagTree inlineTag = (UnknownInlineTagTree) tag; - String[] content = inlineTag.getContent().toString().trim().split("\\s+", 2); - if (!content[0].isBlank()) { - StringBuilder sb = new StringBuilder(""" -
- """); - if (content.length == 2) { - sb.append(""" -
- """) - .append(content[1]) - .append(""" -
- """); - } - sb.append(""" -
- """); - return sb.toString(); - } else { - return """ -
-
- """; - } - } - } - - if (reporter == null) { - throw new IllegalArgumentException("@" + TAG_NAME + " taglet content must be begin or end"); - } - reporter.print(Diagnostic.Kind.ERROR, "@" + TAG_NAME + " taglet content must be begin or end"); - return ""; - } -}