RFR: 8176453: Javadoc search: there are issues with generics in parameters

Hannes Wallnöfer hannes.wallnoefer at oracle.com
Thu Aug 9 16:14:06 UTC 2018


Sundar, Jon: thanks for the reviews, and sorry for the late reply (I was on vacation last week).

As suggested I went ahead and wrote some Selenium tests for this and the previous search bug I fixed, along with a simple Ant build file to run them. I included this in the webrev in test/langtools/jdk/javadoc/doclet/seleniumTests - not sure if this a proper location. It includes its own test sources for generating API docs.

http://cr.openjdk.java.net/~hannesw/8176453/webrev.01/

Instructions for running the tests are included as comment in the main test class (JavaDocSearchTest.java). Unfortunately browser drivers still require manual configuration as these are highly platform specific.

Some additional comments:

- I’m pretty sure that ‚&‘ will not occur in search results as type parameters are not displayed and wildcards cannot have multiple bounds. We could still escape it to be sure, but I thought it was more important to keep the overhead to a minimum and so kept it at just ‚<‚ and ‚>'.

- The ant task to download the Selenium jar file uses the HTTP URL instead of secure HTTPS. This is because HTTPS fails for me, probably because I did not include closed sources.

Let me know if you think this is the way to go.

Hannes



> Am 31.07.2018 um 00:39 schrieb Jonathan Gibbons <jonathan.gibbons at oracle.com>:
> 
> While parameterized types typically just contain < and >, the bounds may sometimes include &, so I tend to agree with Sundar that if you need to escape < > you probably need to escape & as well.
> 
> Even if we can't automate tests (yet?) I think it would be good for you to set up test cases for manual tests that allow us to check the behavior on the OS and browser of our choice.  Simply asking us to test this is not enough.
> 
> If you can find test cases that leverage the latest JDK API, then you could point at that. Otherwise you could construct test cases and post them near the webrev on your account as cr.ojn.  Sometimes I will just build the latest JDK API and post that on cr.ojn.
> 
> -- Jon
> 
> 
> On 07/30/2018 07:19 AM, Sundararajan Athijegannathan wrote:
>> Don't you also need ".replace(/&/g,'&')"?
>> 
>> PS. Isn't there a standard way to escape HTML in JS?
>> 
>> 
>> -Sundar
>> 
>> On 27/07/18, 7:51 PM, Hannes Wallnöfer wrote:
>>> Please review and test this patch to escape < and > characters in search results to HTML < and > entities.
>>> 
>>> Issue: 
>>> https://bugs.openjdk.java.net/browse/JDK-8176453
>>> 
>>> Webrev: 
>>> http://cr.openjdk.java.net/~hannesw/8176453/webrev.00/
>>> 
>>> 
>>> This fixes rendering of search results for search terms containing generics such as „map<str“.
>>> 
>>> Thanks,
>>> Hannes
>>> 
>>> 
> 



More information about the javadoc-dev mailing list