jira-importer commented on issue #696:
URL: 
https://github.com/apache/maven-javadoc-plugin/issues/696#issuecomment-2957346668

   **[Uwe 
Schindler](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=thetaphi)**
 commented
   
   Hi,
   I did some investigations on the tool as provided by Oracle:
   - It uses platform default encoding to patch the files. If you created your 
javadocs properly (as we do in lucene) by specifying `-docencoding UTF-8`, the 
patch tool corrupts them when patching (e.g. if you have special characters in 
your title tag which are e.g. not in your platform's encoding (all get replaced 
by ?). This happens when you regenerate e.g. on Windows with windows-1252 
default charset. So the Oracle patch tool should at least be fixed to also 
allow to specify `-docencoding`
   - The patch tool is very simple at all, it just does two things: It looks 
for all files with the ANT/Maven-like pattern (case insensitive): 
`\*\*/index.htm*,\*\*/toc.htm*` that do not contain the validURL() javascript 
function. In ANT this can be achieved by a simple `<fileset/>` with a 
`<restrict><not><contains .../></not></restrict>` around. The patching at all 
is just a search/replace on all files found by this fileset, which can be 
realized on ANT using a `<replace/>` task. If you do all this in ANT, you can 
of course specify the correct encoding.
   
   I propose to not use Oracle's code at all (which uses plain JDK core libs, 
no helper tools for replacing available in plexus-utils) and implement it 
directly in the javadoc tool using DirectoryScanner and some simple file 
replace.
   
   For all that are interested, the ANT-based solution can be found on the 
Lucene project: 
[LUCENE-5072](https://issues.apache.org/jira/browse/LUCENE-5072?focusedCommentId=13691419&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13691419)
   
   Two notes:
   - the "quickfix" also done in the original Oracle tool can be left out for 
patching Maven Javadoc output. It is just there to fix patched javadocs that 
were done with an earlier buggy version of the fix tool. If you apply the patch 
(without the quickfix) on the output of the javadoc tool, you are fine. The 
quickfix is only useful for website administrators who patched before and 
introduced the javascript string length bug and want to fix their javadocs 
again.
   - The question is about the **javascript code** thats patched into the file. 
What is its license? It is definitely not the license of the updater tool! 
Oracle puts this javascript code in every index.html/toc.html file of any 
generated javado automatically. And these files are not haing any license 
header at all (what's the license of autogenerated code in produced javadoc 
HTML?). So I assume it is license-free (public domian).
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to