java-topology/test/langtools/tools/doclint/anchorTests/p/Test.java
russell@unturf.com 0a580b313d undefect. CWE-407 — 63 sites patched across 27 ecosystems
Authors: russell@unturf.com · brackishbert@gmail.com · foxhop.net · TimeHexOn.com

Patches, unit tests, benchmarks, whitepaper, and outreach briefs.
Public domain — no copyright claimed. Use freely.
2026-03-26 17:11:57 -04:00

60 lines
1.5 KiB
Java

/* @test /nodynamiccopyright/
* @bug 8025246 8247957
* @summary doclint is showing error on anchor already defined when it's not
* @library ../..
* @modules jdk.javadoc/jdk.javadoc.internal.doclint
* @build DocLintTester
* @run main DocLintTester -ref Test.out Test.java
* @compile/fail/ref=Test.javac.out -XDrawDiagnostics -Werror -Xdoclint:all Test.java
*/
package p;
/**
* <a id="dupTest">dupTest</a>
* <a id="dupTest">dupTest again</a>
*
* <a id="dupTestField">dupTestField</a>
* <a id="dupTestMethod">dupTestMethod</a>
* <a id="okClass">okClass</a>
* <a id="okField">okField</a>
* <a id="okMethod">okMethod</a>
*/
public class Test {
/** <a id="dupTestField">dupTestField again</a> */
public int f;
/** <a id="dupTestMethod">dupTestMethod again</a> */
public void m() { }
/**
* <a id="dupNested">dupNested</a>
* <a id="dupNested">dupNested again</a>
* <a id="dupNestedField">dupNestedField</a>
* <a id="dupNestedMethod">dupNestedMethod</a>
*
* <a id="okClass">okClass again</a>
*/
public class Nested {
/**
* <a id="dupNestedField">dupNestedField</a>
*
* <a id="okField">okField again</a>
*/
public int f;
/**
* <a id="dupNestedMethod">dupNestedMethod</a>
*
* <a id="okMethod">okMethod again</a>
*/
public void m() { }
/** . */
private Nested() { }
}
/** . */
private Test() { }
}