See test test/langtools/jdk/javadoc/doclet/testAnchorNames/TestAnchorNames.java
When using JavadocTester.checkLinks, it shows that references are not correctly being encoded.
Starting subtest 3.1: Check links
out-html4/pkg1/RegClass.html:538: id not found: out-html4/constant-values.html#pkg1.RegClass.S_$$$$$INT
The constant_values page has the correctly encoded declaration:
<tbody>
<tr class="altColor">
<td class="colFirst"><a name="pkg1.RegClass.S_:D:D:D:D:DINT">
<!-- -->
</a><code>public static final int</code></td>
<th class="colSecond" scope="row"><code><a href="pkg1/RegClass.html#S_:D:D:D:D:DINT">S_$$$$$INT</a></code></th>
<td class="colLast"><code>0</code></td>
</tr>
</tbody>