mirror of
https://github.com/openjdk/jdk8u.git
synced 2025-12-10 09:17:33 -06:00
8248001: javadoc generates invalid HTML pages whose ftp:// links are broken
Reviewed-by: phh Backport-of: bb95dda0ac5032e4df582f2903dcbbbbaef9e8c4
This commit is contained in:
parent
1304a9b0c7
commit
73dca05a92
@ -1725,7 +1725,8 @@ public class HtmlDocletWriter extends HtmlDocWriter {
|
||||
if (!(relativeLinkLowerCase.startsWith("mailto:") ||
|
||||
relativeLinkLowerCase.startsWith("http:") ||
|
||||
relativeLinkLowerCase.startsWith("https:") ||
|
||||
relativeLinkLowerCase.startsWith("file:"))) {
|
||||
relativeLinkLowerCase.startsWith("file:") ||
|
||||
relativeLinkLowerCase.startsWith("ftp:"))) {
|
||||
relativeLink = "{@"+(new DocRootTaglet()).getName() + "}/"
|
||||
+ redirectPathFromRoot.resolve(relativeLink).getPath();
|
||||
textBuff.replace(begin, end, relativeLink);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2002, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -23,7 +23,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 4638015
|
||||
* @bug 4638015 8248001
|
||||
* @summary Determine if Hrefs are processed properly when they
|
||||
* appear in doc comments.
|
||||
* @author jamieh
|
||||
|
||||
@ -0,0 +1,75 @@
|
||||
/*
|
||||
* Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package pkg;
|
||||
|
||||
/**
|
||||
*This class has <a href="{@docRoot}/pkg/J1.html#functions">various functions</a>,
|
||||
* see <a href="ftp://www.example.com/">FTP Site</a>,
|
||||
* <a href="file:///path/to/somefile">file service</a> for further information
|
||||
*<a id="functions">various functions</a>
|
||||
*<ul>
|
||||
*<li>function1</li>
|
||||
*<li>function2</li>
|
||||
*<li>function3</li>
|
||||
*</ul>
|
||||
*<a id="methods">special methods</a>
|
||||
*<ul>
|
||||
*<li>method1</li>
|
||||
*<li>method2</li>
|
||||
*<li>method3</li>
|
||||
*</ul>
|
||||
*/
|
||||
public class J1 {
|
||||
/**
|
||||
*fields.
|
||||
*/
|
||||
protected Object field1;
|
||||
|
||||
/**
|
||||
*<a href="{@docRoot}/pkg/J1.html#functions">Creates an instance which has various functions.</a>
|
||||
*/
|
||||
public J1(){
|
||||
}
|
||||
|
||||
/**
|
||||
*This is a<a href="#methods">special method</a>.
|
||||
*@param p1 arg1
|
||||
*/
|
||||
public void method1(int p1){
|
||||
}
|
||||
|
||||
/**
|
||||
*See <a href="ftp://www.example.com/">FTP Site</a> for more information.
|
||||
*@param p1 arg1
|
||||
*/
|
||||
public void method2(int p1){
|
||||
}
|
||||
|
||||
/**
|
||||
*See <a href="file:///path/to/somefile">file service</a> for more information.
|
||||
*@param p1 arg1
|
||||
*/
|
||||
public void method3(int p1){
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user