Cleanup JDK-8226585-branch
authorjlahoda
Wed, 02 Oct 2019 11:29:49 +0200
branchJDK-8226585-branch
changeset 58441 82f43796b28c
parent 58440 4c8a6d1d066c
Cleanup
make/jdk/src/classes/build/tools/taglet/Preview.java
src/java.base/share/classes/jdk/internal/PreviewFeature.java
--- a/make/jdk/src/classes/build/tools/taglet/Preview.java	Wed Oct 02 10:59:40 2019 +0200
+++ b/make/jdk/src/classes/build/tools/taglet/Preview.java	Wed Oct 02 11:29:49 2019 +0200
@@ -29,6 +29,7 @@
 import java.util.EnumSet;
 import java.util.List;
 import java.util.Set;
+import java.util.function.Predicate;
 import javax.lang.model.element.Element;
 import com.sun.source.doctree.DocTree;
 import com.sun.source.doctree.TextTree;
@@ -65,7 +66,11 @@
         String[] summaryAndDetails = previewText.split("\n\r?\n\r?");
         String summary = summaryAndDetails[0];
         String details = summaryAndDetails.length > 1 ? summaryAndDetails[1] : summaryAndDetails[0];
-        if (Arrays.stream(new Exception().getStackTrace()).anyMatch(el -> el.getClassName().endsWith("HtmlDocletWriter") && el.getMethodName().equals("addSummaryComment"))) {
+        StackTraceElement[] stackTrace = new Exception().getStackTrace();
+        Predicate<StackTraceElement> isSummary =
+                el -> el.getClassName().endsWith("HtmlDocletWriter") &&
+                      el.getMethodName().equals("addSummaryComment");
+        if (Arrays.stream(stackTrace).anyMatch(isSummary)) {
             return "<div style=\"display:inline-block; font-weight:bold\">" + summary + "</div><br>";
         }
         return "<div style=\"border: 1px solid red; border-radius: 25px; padding: 5px; display:inline-block; font-size: larger\">" + details + "</div><br>";
--- a/src/java.base/share/classes/jdk/internal/PreviewFeature.java	Wed Oct 02 10:59:40 2019 +0200
+++ b/src/java.base/share/classes/jdk/internal/PreviewFeature.java	Wed Oct 02 11:29:49 2019 +0200
@@ -31,7 +31,7 @@
  * Indicates the API declaration in question is associated with a
  * <em>preview feature</em>. See JEP 12: "Preview Language and VM
  * Features" (http://openjdk.java.net/jeps/12).
- * @since 13
+ * @since 14
  */
 // Match the meaningful targets of java.lang.Deprecated, omit local
 // variables and parameter declarations