mirror of
https://github.com/openjdk/jdk.git
synced 2026-02-10 10:28:37 +00:00
8017191: Javadoc is confused by @link to imported classes outside of the set of generated packages
Reviewed-by: bpatel
This commit is contained in:
parent
ce4eb93249
commit
43991d588a
@ -109,7 +109,7 @@ public class LinkFactoryImpl extends LinkFactory {
|
||||
}
|
||||
}
|
||||
// Can't link so just write label.
|
||||
link.addContent(label.toString());
|
||||
link.addContent(label);
|
||||
if (noLabel && !classLinkInfo.excludeTypeParameterLinks) {
|
||||
link.addContent(getTypeParameterLinks(linkInfo));
|
||||
}
|
||||
|
||||
@ -70,6 +70,7 @@ public class StringContent extends Content {
|
||||
* DocletAbortException because it
|
||||
* is not supported.
|
||||
*/
|
||||
@Override
|
||||
public void addContent(Content content) {
|
||||
throw new DocletAbortException();
|
||||
}
|
||||
@ -80,6 +81,7 @@ public class StringContent extends Content {
|
||||
*
|
||||
* @param strContent string content to be added
|
||||
*/
|
||||
@Override
|
||||
public void addContent(String strContent) {
|
||||
appendChars(strContent);
|
||||
}
|
||||
@ -87,10 +89,12 @@ public class StringContent extends Content {
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public boolean isEmpty() {
|
||||
return (stringContent.length() == 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int charCount() {
|
||||
return RawHtml.charCount(stringContent.toString());
|
||||
}
|
||||
@ -98,6 +102,7 @@ public class StringContent extends Content {
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return stringContent.toString();
|
||||
}
|
||||
|
||||
80
langtools/test/com/sun/javadoc/testSeeTag/TestSeeTag.java
Normal file
80
langtools/test/com/sun/javadoc/testSeeTag/TestSeeTag.java
Normal file
@ -0,0 +1,80 @@
|
||||
/*
|
||||
* Copyright (c) 2002, 2013, 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 8017191
|
||||
* @summary Javadoc is confused by at-link to imported classes outside of the set of generated packages
|
||||
* @author jjg
|
||||
* @library ../lib/
|
||||
* @build JavadocTester TestSeeTag
|
||||
* @run main TestSeeTag
|
||||
*/
|
||||
|
||||
public class TestSeeTag extends JavadocTester {
|
||||
|
||||
//Test information.
|
||||
private static final String BUG_ID = "8017191";
|
||||
private static final String OUTPUT_DIR = BUG_ID;
|
||||
|
||||
//Javadoc arguments.
|
||||
private static final String[] ARGS = new String[] {
|
||||
"-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg"
|
||||
};
|
||||
|
||||
//Input for string search tests.
|
||||
private static final String[][] TEST = {
|
||||
{ OUTPUT_DIR + FS + "pkg" + FS + "Test.html",
|
||||
"<code>List</code>"
|
||||
}
|
||||
};
|
||||
private static final String[][] NEGATED_TEST = {
|
||||
{ OUTPUT_DIR + FS + "pkg" + FS + "Test.html",
|
||||
"<code>List</code>"
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* The entry point of the test.
|
||||
* @param args the array of command line arguments.
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
TestSeeTag tester = new TestSeeTag();
|
||||
run(tester, ARGS, TEST, NEGATED_TEST);
|
||||
tester.printSummary();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public String getBugId() {
|
||||
return BUG_ID;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public String getBugName() {
|
||||
return getClass().getName();
|
||||
}
|
||||
}
|
||||
29
langtools/test/com/sun/javadoc/testSeeTag/pkg/Test.java
Normal file
29
langtools/test/com/sun/javadoc/testSeeTag/pkg/Test.java
Normal file
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright (c) 2013, 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;
|
||||
import java.util.List;
|
||||
|
||||
/** @see List */
|
||||
public class Test { }
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user