Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_langtools
提交
4377aaa0
D
dragonwell8_langtools
项目概览
openanolis
/
dragonwell8_langtools
通知
0
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_langtools
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
4377aaa0
编写于
4月 16, 2014
作者:
K
ksrini
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8038976: javadoc requires a trailing / for links where java 7's javadoc didn't
Reviewed-by: jjg
上级
a68f108c
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
41 addition
and
6 deletion
+41
-6
src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Extern.java
...s/com/sun/tools/doclets/internal/toolkit/util/Extern.java
+2
-2
test/com/sun/javadoc/testLinkOption/TestLinkOption.java
test/com/sun/javadoc/testLinkOption/TestLinkOption.java
+39
-4
未找到文件。
src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Extern.java
浏览文件 @
4377aaa0
/*
* Copyright (c) 1998, 201
2
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 201
4
, 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
...
...
@@ -177,7 +177,7 @@ public class Extern {
try
{
url
=
adjustEndFileSeparator
(
url
);
if
(
isUrl
(
pkglisturl
))
{
readPackageListFromURL
(
url
,
toURL
(
pkglisturl
));
readPackageListFromURL
(
url
,
toURL
(
adjustEndFileSeparator
(
pkglisturl
)
));
}
else
{
readPackageListFromFile
(
url
,
DocFile
.
createFileForInput
(
configuration
,
pkglisturl
));
}
...
...
test/com/sun/javadoc/testLinkOption/TestLinkOption.java
浏览文件 @
4377aaa0
...
...
@@ -23,18 +23,20 @@
/*
* @test
* @bug 4720957 5020118 8026567
* @bug 4720957 5020118 8026567
8038976
* @summary Test to make sure that -link and -linkoffline link to
* right files.
* right files
, and URLs with and without trailing slash are accepted
.
* @author jamieh
* @library ../lib/
* @build JavadocTester TestLinkOption
* @run main TestLinkOption
*/
import
java.io.File
;
public
class
TestLinkOption
extends
JavadocTester
{
private
static
final
String
BUG_ID
=
"4720957-5020118"
;
private
static
final
String
BUG_ID
=
"4720957-5020118
-8038976
"
;
//Generate the documentation using -linkoffline and a URL as the first parameter.
private
static
final
String
[]
ARGS1
=
new
String
[]
{
...
...
@@ -83,7 +85,34 @@ public class TestLinkOption extends JavadocTester {
}
};
private
static
final
String
[][]
NEGATED_TEST2
=
NO_TEST
;
/*
* Create the documentation using the -link option, vary the behavior with
* both trailing and no trailing slash. We are only interested in ensuring
* that the command executes with no errors or related warnings.
*/
static
String
[]
createArguments
(
boolean
withTrailingSlash
)
{
String
packagePath
=
new
File
(
BUG_ID
+
"-1"
).
getAbsolutePath
();
String
outputDirName
=
BUG_ID
;
if
(
withTrailingSlash
)
{
// add the trailing slash, if it is not present!
if
(!
packagePath
.
endsWith
(
FS
))
{
packagePath
=
packagePath
+
FS
;
}
outputDirName
=
outputDirName
+
"-3"
;
}
else
{
// remove the trailing slash, if it is present!
if
(
packagePath
.
endsWith
(
FS
))
{
packagePath
=
packagePath
.
substring
(
0
,
packagePath
.
length
()
-
1
);
}
outputDirName
=
outputDirName
+
"-4"
;
}
String
args
[]
=
{
"-d"
,
outputDirName
,
"-sourcepath"
,
SRC_DIR
,
"-link"
,
"file:///"
+
packagePath
,
"-package"
,
"pkg2"
};
System
.
out
.
println
(
"packagePath: "
+
packagePath
);
return
args
;
}
/**
* The entry point of the test.
* @param args the array of command line arguments.
...
...
@@ -92,6 +121,12 @@ public class TestLinkOption extends JavadocTester {
TestLinkOption
tester
=
new
TestLinkOption
();
run
(
tester
,
ARGS1
,
TEST1
,
NEGATED_TEST1
);
run
(
tester
,
ARGS2
,
TEST2
,
NEGATED_TEST2
);
tester
.
runJavadoc
(
createArguments
(
true
));
// with trailing slash
tester
.
runJavadoc
(
createArguments
(
false
));
// without trailing slash
tester
.
printSummary
();
if
(
tester
.
getWarningOutput
().
contains
(
"warning - Error fetching URL"
))
{
throw
new
Error
(
"URL rejected ?"
);
}
tester
.
printSummary
();
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录