RFR: 8179370: Replace use of <tt>, <center> and <font> tags in java.base

Jonathan Gibbons jonathan.gibbons at oracle.com
Thu Apr 27 01:49:11 UTC 2017


Updated webrev to address Joe's suggestion to try harder to use {@code} 
as a substitute for <tt>.

http://cr.openjdk.java.net/~jjg/8179370/webrev.01

The modified sed script has a new first line:

s|<tt>\([^&<>]*\)</tt>|{@code \1}|g
s|<tt>|<code>|g
s|</tt>|</code>|g
s|<\\/tt>|<\\/code>|g
s|\(<td[^>]*\)><center>\([^<]*\)</center>|\1 style="text-align:center">\2|
s|<center><table |<div style="text-align:center"><table style="margin:0 
auto" |
s|</center>|</div>|
s|<font |<span |
s|</font>|</span>|

Also note that there is a small visible bug in webrev. If you look at 
ServiceLoader.java:133,
the second instance of <tt> is not converted to {@code} because the 
embedded '\' is actually
an entity in the source file ... and so it is inappropriate to use 
{@code} for that instance.

-- Jon



On 04/26/2017 06:09 PM, Jonathan Gibbons wrote:
> Joe,
>
> Yes, there are occurrences here that require <code> instead of 
> {@code}, because of the presence of HTML entities. It's about 50/50.
>
> I'd prefer to stay with mechanical updates as much as possible for 
> these bulk updates, as compared to manual updates, but I may be able 
> to improve the sed script for this case.
>
> -- Jon
>
> On 04/26/2017 05:55 PM, Joseph D. Darcy wrote:
>> Hi Jon,
>>
>> I'd prefer if the "<tt>foo</tt>" were replaced with "{@code tt}" 
>> rather than "<code>foo</code>"- none of the tricky cases which 
>> preclude use of {@code } use seem to be present here - but will 
>> approve the changeset in its current form too.
>>
>> Cheers,
>>
>> -Joe
>>
>> On 4/26/2017 5:50 PM, Jonathan Gibbons wrote:
>>> Please review these mostly simple changes to replace HTML tags which 
>>> are not valid in HTML 5 in public doc comments in java.base.
>>>
>>> As with the previous changes, the changes were done mechanically, 
>>> using the following sed script:
>>>
>>> s|<tt>|<code>|g
>>> s|</tt>|</code>|g
>>> s|<\\/tt>|<\\/code>|g
>>> s|\(<td[^>]*\)><center>\([^<]*\)</center>|\1 
>>> style="text-align:center">\2|
>>> s|<center><table |<div style="text-align:center"><table 
>>> style="margin:0 auto" |
>>> s|</center>|</div>|
>>> s|<font |<span |
>>> s|</font>|</span>|
>>>
>>> The unusual form of the 3rd line was to cover the occurrence in a 
>>> makefile.
>>>
>>> The 4th line is specific for DataInput.java, and replaces <center> 
>>> within a <td> with a style on the <td> element itself.
>>>
>>> The 5th and 6th lines are specific to URLConnection. The use of the 
>>> table itself and the ASCII art that follows it are questionable, but 
>>> the intent here is just to update the HTML and not to rework the 
>>> visual appearance of the generated documentation.
>>>
>>> The changes cover files in the following packages:
>>>
>>> java.base java/io
>>> java.base java/net
>>> java.base java/util
>>> java.base javax/net/ssl
>>>
>>>
>>> JBS: https://bugs.openjdk.java.net/browse/JDK-8179370
>>> Webrev: http://cr.openjdk.java.net/~jjg/8179370/webrev/
>>>
>>> -- Jon
>>
>




More information about the security-dev mailing list