Skip to content
Permalink
Browse files
8259726: Use of HashSet leads to undefined order in test output
Reviewed-by: hannesw
  • Loading branch information
jonathan-gibbons committed Jan 25, 2021
1 parent d6fb9d7 commit 982e42b89655e90a9536e3193ac59191930b5631
Showing with 242 additions and 210 deletions.
  1. +6 −7 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/Table.java
  2. +5 −5 test/langtools/jdk/javadoc/doclet/testAbstractMethod/TestAbstractMethod.java
  3. +6 −6 test/langtools/jdk/javadoc/doclet/testDeprecatedDocs/TestDeprecatedDocs.java
  4. +29 −27 test/langtools/jdk/javadoc/doclet/testHtmlTableTags/TestHtmlTableTags.java
  5. +8 −8 test/langtools/jdk/javadoc/doclet/testInterface/TestInterface.java
  6. +27 −27 test/langtools/jdk/javadoc/doclet/testJavaFX/TestJavaFX.java
  7. +3 −3 test/langtools/jdk/javadoc/doclet/testLambdaFeature/TestLambdaFeature.java
  8. +12 −12 test/langtools/jdk/javadoc/doclet/testMemberInheritance/TestMemberInheritance.java
  9. +3 −3 test/langtools/jdk/javadoc/doclet/testMemberSummary/TestMemberSummary.java
  10. +7 −3 test/langtools/jdk/javadoc/doclet/testMethodTypes/TestMethodTypes.java
  11. +19 −19 test/langtools/jdk/javadoc/doclet/testModules/TestModulePackages.java
  12. +20 −20 test/langtools/jdk/javadoc/doclet/testModules/TestModules.java
  13. +14 −15 test/langtools/jdk/javadoc/doclet/testNewLanguageFeatures/TestNewLanguageFeatures.java
  14. +42 −21 test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestOverrideMethods.java
  15. +5 −5 test/langtools/jdk/javadoc/doclet/testProperty/TestProperty.java
  16. +29 −22 test/langtools/jdk/javadoc/doclet/testTypeAnnotations/TestTypeAnnotations.java
  17. +3 −3 test/langtools/jdk/javadoc/doclet/testTypeParams/TestTypeParameters.java
  18. +4 −4 test/langtools/jdk/javadoc/doclet/testUnnamedPackage/TestUnnamedPackage.java
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2021, 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
@@ -304,13 +304,12 @@ public void addRow(Element element, List<Content> contents) {
int rowIndex = bodyRows.size();
rowStyle = stripedStyles.get(rowIndex % 2);
}
Set<String> tabClasses = new HashSet<>(); // !! would be better as a List
List<String> tabClasses = new ArrayList<>();
if (tabMap != null) {
// Construct a series of CSS classes to add to the cells of this row,
// such that there is a default value and a value corresponding to each
// tab whose predicate matches the element. The classes correspond to
// the equivalent ids. The classes are used to determine the cells to
// make visible when a tab is selected.
// Construct a series of values to add to the HTML 'class' attribute for the cells of
// this row, such that there is a default value and a value corresponding to each tab
// whose predicate matches the element. The values correspond to the equivalent ids.
// The values are used to determine the cells to make visible when a tab is selected.
tabClasses.add(id.name());
int tabIndex = 1;
for (Map.Entry<String, Predicate<Element>> e : tabMap.entrySet()) {
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2021, 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
@@ -50,8 +50,8 @@ public void test() {

checkOutput("pkg/A.html", true,
"""
<div class="col-first even-row-color method-summary-table-tab2 method-summary-table-t\
ab5 method-summary-table"><code>default void</code></div>""",
<div class="col-first even-row-color method-summary-table method-summary-table-t\
ab2 method-summary-table-tab5"><code>default void</code></div>""",
"""
<div class="table-tabs" role="tablist" aria-orientation="horizontal">\
<button id="method-summary-table-tab0" role="tab" aria-selected="true" aria-cont\
@@ -93,8 +93,8 @@ public void test() {
able-tab">Concrete Methods</button>\
</div>""",
"""
<div class="col-first even-row-color method-summary-table-tab2 method-summary-ta\
ble method-summary-table-tab3"><code>abstract void</code></div>""");
<div class="col-first even-row-color method-summary-table method-summary-table-t\
ab2 method-summary-table-tab3"><code>abstract void</code></div>""");

checkOutput("pkg/C.html", true,
"""
@@ -172,22 +172,22 @@ public void test() {
</div>
</div>""",
"""
<div class="col-last even-row-color method-summary-table-tab2 method-summary-table-ta\
b6 method-summary-table-tab4 method-summary-table">
<div class="col-last even-row-color method-summary-table method-summary-table-ta\
b2 method-summary-table-tab4 method-summary-table-tab6">
<div class="block"><span class="deprecated-label">Deprecated.</span>
<div class="deprecation-comment">class_test5 passes.</div>
</div>
</div>""",
"""
<div class="col-last even-row-color method-summary-table-tab2 method-summary-table-ta\
b6 method-summary-table-tab4 method-summary-table">
<div class="col-last even-row-color method-summary-table method-summary-table-ta\
b2 method-summary-table-tab4 method-summary-table-tab6">
<div class="block"><span class="deprecated-label">Deprecated.</span>
<div class="deprecation-comment">class_test6 passes.</div>
</div>
</div>""",
"""
<div class="col-last odd-row-color method-summary-table-tab2 method-summary-table-ta\
b6 method-summary-table-tab4 method-summary-table">
<div class="col-last odd-row-color method-summary-table method-summary-table-tab\
2 method-summary-table-tab4 method-summary-table-tab6">
<div class="block"><span class="deprecated-label">Deprecated.</span>
<div class="deprecation-comment">class_test7 passes.</div>
</div>
@@ -23,7 +23,7 @@

/*
* @test
* @bug 6786688 8008164 8162363 8169819 8183037 8182765 8184205 8242649
* @bug 6786688 8008164 8162363 8169819 8183037 8182765 8184205 8242649 8259726
* @summary HTML tables should have table summary, caption and table headers.
* @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
@@ -577,13 +577,14 @@ void checkHtmlTableContents() {
<div class="block">Test field for class.</div>
</div>""",
"""
<div class="col-first even-row-color method-summary-table-tab2 method-summary-ta\
ble-tab4 method-summary-table"><code>void</code></div>
<div class="col-second even-row-color method-summary-table-tab2 method-summary-t\
able-tab4 method-summary-table"><code><span class="member-name-link"><a href="#m\
<div class="col-first even-row-color method-summary-table method-summary-table-t\
ab2 method-summary-table-tab4"><code>void</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-\
tab2 method-summary-table-tab4"><code><span class="member-name-link"><a href="#m\
ethod1(int,int)">method1</a></span>&#8203;(int&nbsp;a,
int&nbsp;b)</code></div>
<div class="col-last even-row-color method-summary-table-tab2 method-summary-table-tab4 method-summary-table">
<div class="col-last even-row-color method-summary-table method-summary-table-ta\
b2 method-summary-table-tab4">
<div class="block">Method that is implemented.</div>
</div>""");

@@ -595,15 +596,15 @@ void checkHtmlTableContents() {
<div class="block">A test field.</div>
</div>""",
"""
<div class="col-first even-row-color method-summary-table-tab2 method-summary-ta\
ble-tab4 method-summary-table"><code><a href="../pkg1/C1.html" title="class in p\
<div class="col-first even-row-color method-summary-table method-summary-table-t\
ab2 method-summary-table-tab4"><code><a href="../pkg1/C1.html" title="class in p\
kg1">C1</a></code></div>
<div class="col-second even-row-color method-summary-table-tab2 method-summary-t\
able-tab4 method-summary-table"><code><span class="member-name-link"><a href="#m\
<div class="col-second even-row-color method-summary-table method-summary-table-\
tab2 method-summary-table-tab4"><code><span class="member-name-link"><a href="#m\
ethod(pkg1.C1)">method</a></span>&#8203;(<a href="../pkg1/C1.html" title="class \
in pkg1">C1</a>&nbsp;param)</code></div>
<div class="col-last even-row-color method-summary-table-tab2 method-summary-tab\
le-tab4 method-summary-table">
<div class="col-last even-row-color method-summary-table method-summary-table-ta\
b2 method-summary-table-tab4">
<div class="block">A sample method.</div>
</div>""");

@@ -693,9 +694,9 @@ void checkHtmlTableContents() {
// Overview Summary
checkOutput("index.html", true,
"""
<div class="col-first even-row-color all-packages-table-tab1 all-packages-table"\
<div class="col-first even-row-color all-packages-table all-packages-table-tab1"\
><a href="pkg1/package-summary.html">pkg1</a></div>
<div class="col-last even-row-color all-packages-table-tab1 all-packages-table">
<div class="col-last even-row-color all-packages-table all-packages-table-tab1">
<div class="block">Test package 1 used to test table tags.</div>
</div>""");
}
@@ -728,29 +729,30 @@ void checkHtmlTableContentsNoComment() {
<div class="col-second odd-row-color"><code><span class="member-name-link"><a href="#field">field</a></span></code></div>
<div class="col-last odd-row-color"></div>""",
"""
<div class="col-first even-row-color method-summary-table-tab2 method-summary-ta\
ble-tab4 method-summary-table"><code>void</code></div>
<div class="col-second even-row-color method-summary-table-tab2 method-summary-t\
able-tab4 method-summary-table"><code><span class="member-name-link"><a href="#m\
<div class="col-first even-row-color method-summary-table method-summary-table-t\
ab2 method-summary-table-tab4"><code>void</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-\
tab2 method-summary-table-tab4"><code><span class="member-name-link"><a href="#m\
ethod1(int,int)">method1</a></span>&#8203;(int&nbsp;a,
int&nbsp;b)</code></div>
<div class="col-last even-row-color method-summary-table-tab2 method-summary-table-tab4 method-summary-table"></div>""");
<div class="col-last even-row-color method-summary-table method-summary-table-ta\
b2 method-summary-table-tab4"></div>""");

checkOutput("pkg2/C2.html", true,
"""
<div class="col-first even-row-color"><code><a href="../pkg1/C1.html" title="class in pkg1">C1</a></code></div>
<div class="col-second even-row-color"><code><span class="member-name-link"><a href="#field">field</a></span></code></div>
<div class="col-last even-row-color"></div>""",
"""
<div class="col-first even-row-color method-summary-table-tab2 method-summary-ta\
ble-tab4 method-summary-table"><code><a href="../pkg1/C1.html" title="class in p\
<div class="col-first even-row-color method-summary-table method-summary-table-t\
ab2 method-summary-table-tab4"><code><a href="../pkg1/C1.html" title="class in p\
kg1">C1</a></code></div>
<div class="col-second even-row-color method-summary-table-tab2 method-summary-t\
able-tab4 method-summary-table"><code><span class="member-name-link"><a href="#m\
<div class="col-second even-row-color method-summary-table method-summary-table-\
tab2 method-summary-table-tab4"><code><span class="member-name-link"><a href="#m\
ethod(pkg1.C1)">method</a></span>&#8203;(<a href="../pkg1/C1.html" title="class \
in pkg1">C1</a>&nbsp;param)</code></div>
<div class="col-last even-row-color method-summary-table-tab2 method-summary-tab\
le-tab4 method-summary-table"></div>""");
<div class="col-last even-row-color method-summary-table method-summary-table-ta\
b2 method-summary-table-tab4"></div>""");

checkOutput("pkg2/C2.ModalExclusionType.html", true,
"""
@@ -820,8 +822,8 @@ void checkHtmlTableContentsNoComment() {
// Overview Summary
checkOutput("index.html", true,
"""
<div class="col-first even-row-color all-packages-table-tab1 all-packages-table"\
<div class="col-first even-row-color all-packages-table all-packages-table-tab1"\
><a href="pkg1/package-summary.html">pkg1</a></div>
<div class="col-last even-row-color all-packages-table-tab1 all-packages-table"></div>""");
<div class="col-last even-row-color all-packages-table all-packages-table-tab1"></div>""");
}
}
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2021, 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
@@ -133,13 +133,13 @@ public void test() {
<div class="block">A hider field</div>""",

"""
<div class="col-first even-row-color method-summary-table-tab1 method-summary-table-t\
ab4 method-summary-table"><code>static void</code></div>
<div class="col-second even-row-color method-summary-table-tab1 method-summary-table-\
tab4 method-summary-table"><code><span class="member-name-link"><a href="#m()">m\
</a></span>()</code></div>
<div class="col-last even-row-color method-summary-table-tab1 method-summary-table-ta\
b4 method-summary-table">
<div class="col-first even-row-color method-summary-table method-summary-table-t\
ab1 method-summary-table-tab4"><code>static void</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-\
tab1 method-summary-table-tab4"><code><span class="member-name-link"><a href="#m\
()">m</a></span>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-ta\
b1 method-summary-table-tab4">
<div class="block">A hider method</div>
</div>
""",
Loading

1 comment on commit 982e42b

@openjdk-notifier

This comment has been minimized.

Copy link

@openjdk-notifier openjdk-notifier bot commented on 982e42b Jan 25, 2021

Please sign in to comment.