Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_langtools
提交
ace9fd90
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看板
提交
ace9fd90
编写于
12月 13, 2010
作者:
B
bpatel
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7006270: Several javadoc regression tests are failing on windows
Reviewed-by: jjg
上级
3e973d62
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
81 addition
and
52 deletion
+81
-52
src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java
...s/com/sun/tools/doclets/formats/html/ClassWriterImpl.java
+2
-2
src/share/classes/com/sun/tools/doclets/formats/html/HtmlDoclet.java
...lasses/com/sun/tools/doclets/formats/html/HtmlDoclet.java
+3
-2
src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java
.../com/sun/tools/doclets/formats/html/HtmlDocletWriter.java
+9
-9
src/share/classes/com/sun/tools/doclets/formats/html/markup/Comment.java
...es/com/sun/tools/doclets/formats/html/markup/Comment.java
+2
-2
src/share/classes/com/sun/tools/doclets/formats/html/markup/DocType.java
...es/com/sun/tools/doclets/formats/html/markup/DocType.java
+1
-1
src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTree.java
...s/com/sun/tools/doclets/formats/html/markup/HtmlTree.java
+2
-2
src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java
...com/sun/tools/doclets/formats/html/markup/HtmlWriter.java
+14
-14
src/share/classes/com/sun/tools/doclets/internal/toolkit/Content.java
...asses/com/sun/tools/doclets/internal/toolkit/Content.java
+1
-1
src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Util.java
...ses/com/sun/tools/doclets/internal/toolkit/util/Util.java
+35
-12
test/com/sun/javadoc/testHtmlDocument/TestHtmlDocument.java
test/com/sun/javadoc/testHtmlDocument/TestHtmlDocument.java
+12
-7
未找到文件。
src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java
浏览文件 @
ace9fd90
...
@@ -239,7 +239,7 @@ public class ClassWriterImpl extends SubWriterHolderWriter
...
@@ -239,7 +239,7 @@ public class ClassWriterImpl extends SubWriterHolderWriter
Type
superclass
=
Util
.
getFirstVisibleSuperClass
(
classDoc
,
Type
superclass
=
Util
.
getFirstVisibleSuperClass
(
classDoc
,
configuration
());
configuration
());
if
(
superclass
!=
null
)
{
if
(
superclass
!=
null
)
{
pre
.
addContent
(
"\n"
);
pre
.
addContent
(
DocletConstants
.
NL
);
pre
.
addContent
(
"extends "
);
pre
.
addContent
(
"extends "
);
Content
link
=
new
RawHtml
(
getLink
(
new
LinkInfoImpl
(
Content
link
=
new
RawHtml
(
getLink
(
new
LinkInfoImpl
(
LinkInfoImpl
.
CONTEXT_CLASS_SIGNATURE_PARENT_NAME
,
LinkInfoImpl
.
CONTEXT_CLASS_SIGNATURE_PARENT_NAME
,
...
@@ -257,7 +257,7 @@ public class ClassWriterImpl extends SubWriterHolderWriter
...
@@ -257,7 +257,7 @@ public class ClassWriterImpl extends SubWriterHolderWriter
continue
;
continue
;
}
}
if
(
counter
==
0
)
{
if
(
counter
==
0
)
{
pre
.
addContent
(
"\n"
);
pre
.
addContent
(
DocletConstants
.
NL
);
pre
.
addContent
(
isInterface
?
"extends "
:
"implements "
);
pre
.
addContent
(
isInterface
?
"extends "
:
"implements "
);
}
else
{
}
else
{
pre
.
addContent
(
", "
);
pre
.
addContent
(
", "
);
...
...
src/share/classes/com/sun/tools/doclets/formats/html/HtmlDoclet.java
浏览文件 @
ace9fd90
...
@@ -144,11 +144,12 @@ public class HtmlDoclet extends AbstractDoclet {
...
@@ -144,11 +144,12 @@ public class HtmlDoclet extends AbstractDoclet {
!
configuration
.
nohelp
)
{
!
configuration
.
nohelp
)
{
HelpWriter
.
generate
(
configuration
);
HelpWriter
.
generate
(
configuration
);
}
}
// If a stylesheet file is not specified, copy the default stylesheet.
// If a stylesheet file is not specified, copy the default stylesheet
// and replace newline with platform-specific newline.
if
(
configuration
.
stylesheetfile
.
length
()
==
0
)
{
if
(
configuration
.
stylesheetfile
.
length
()
==
0
)
{
Util
.
copyFile
(
configuration
,
"stylesheet.css"
,
Util
.
RESOURCESDIR
,
Util
.
copyFile
(
configuration
,
"stylesheet.css"
,
Util
.
RESOURCESDIR
,
(
configdestdir
.
isEmpty
())
?
(
configdestdir
.
isEmpty
())
?
System
.
getProperty
(
"user.dir"
)
:
configdestdir
,
false
);
System
.
getProperty
(
"user.dir"
)
:
configdestdir
,
false
,
true
);
}
}
}
}
...
...
src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java
浏览文件 @
ace9fd90
...
@@ -216,15 +216,15 @@ public class HtmlDocletWriter extends HtmlDocWriter {
...
@@ -216,15 +216,15 @@ public class HtmlDocletWriter extends HtmlDocWriter {
public
Content
getAllClassesLinkScript
(
String
id
)
{
public
Content
getAllClassesLinkScript
(
String
id
)
{
HtmlTree
script
=
new
HtmlTree
(
HtmlTag
.
SCRIPT
);
HtmlTree
script
=
new
HtmlTree
(
HtmlTag
.
SCRIPT
);
script
.
addAttr
(
HtmlAttr
.
TYPE
,
"text/javascript"
);
script
.
addAttr
(
HtmlAttr
.
TYPE
,
"text/javascript"
);
String
scriptCode
=
"<!--
\n"
+
String
scriptCode
=
"<!--
"
+
DocletConstants
.
NL
+
" allClassesLink = document.getElementById(\""
+
id
+
"\");
\n"
+
" allClassesLink = document.getElementById(\""
+
id
+
"\");
"
+
DocletConstants
.
NL
+
" if(window==top) {
\n"
+
" if(window==top) {
"
+
DocletConstants
.
NL
+
" allClassesLink.style.display = \"block\";
\n"
+
" allClassesLink.style.display = \"block\";
"
+
DocletConstants
.
NL
+
" }
\n"
+
" }
"
+
DocletConstants
.
NL
+
" else {
\n"
+
" else {
"
+
DocletConstants
.
NL
+
" allClassesLink.style.display = \"none\";
\n"
+
" allClassesLink.style.display = \"none\";
"
+
DocletConstants
.
NL
+
" }
\n"
+
" }
"
+
DocletConstants
.
NL
+
" //-->
\n"
;
" //-->
"
+
DocletConstants
.
NL
;
Content
scriptContent
=
new
RawHtml
(
scriptCode
);
Content
scriptContent
=
new
RawHtml
(
scriptCode
);
script
.
addContent
(
scriptContent
);
script
.
addContent
(
scriptContent
);
Content
div
=
HtmlTree
.
DIV
(
script
);
Content
div
=
HtmlTree
.
DIV
(
script
);
...
...
src/share/classes/com/sun/tools/doclets/formats/html/markup/Comment.java
浏览文件 @
ace9fd90
...
@@ -82,9 +82,9 @@ public class Comment extends Content{
...
@@ -82,9 +82,9 @@ public class Comment extends Content{
*/
*/
public
void
write
(
StringBuilder
contentBuilder
)
{
public
void
write
(
StringBuilder
contentBuilder
)
{
if
(!
endsWithNewLine
(
contentBuilder
))
if
(!
endsWithNewLine
(
contentBuilder
))
contentBuilder
.
append
(
"\n"
);
contentBuilder
.
append
(
DocletConstants
.
NL
);
contentBuilder
.
append
(
"<!-- "
);
contentBuilder
.
append
(
"<!-- "
);
contentBuilder
.
append
(
commentText
);
contentBuilder
.
append
(
commentText
);
contentBuilder
.
append
(
" -->
\n"
);
contentBuilder
.
append
(
" -->
"
+
DocletConstants
.
NL
);
}
}
}
}
src/share/classes/com/sun/tools/doclets/formats/html/markup/DocType.java
浏览文件 @
ace9fd90
...
@@ -48,7 +48,7 @@ public class DocType extends Content{
...
@@ -48,7 +48,7 @@ public class DocType extends Content{
*/
*/
private
DocType
(
String
type
,
String
dtd
)
{
private
DocType
(
String
type
,
String
dtd
)
{
docType
=
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 "
+
type
+
docType
=
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 "
+
type
+
"//EN\" \""
+
dtd
+
"\">
\n"
;
"//EN\" \""
+
dtd
+
"\">
"
+
DocletConstants
.
NL
;
}
}
/**
/**
...
...
src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTree.java
浏览文件 @
ace9fd90
...
@@ -753,7 +753,7 @@ public class HtmlTree extends Content {
...
@@ -753,7 +753,7 @@ public class HtmlTree extends Content {
*/
*/
public
void
write
(
StringBuilder
contentBuilder
)
{
public
void
write
(
StringBuilder
contentBuilder
)
{
if
(!
isInline
()
&&
!
endsWithNewLine
(
contentBuilder
))
if
(!
isInline
()
&&
!
endsWithNewLine
(
contentBuilder
))
contentBuilder
.
append
(
"\n"
);
contentBuilder
.
append
(
DocletConstants
.
NL
);
String
tagString
=
htmlTag
.
toString
();
String
tagString
=
htmlTag
.
toString
();
contentBuilder
.
append
(
"<"
+
tagString
);
contentBuilder
.
append
(
"<"
+
tagString
);
Iterator
<
HtmlAttr
>
iterator
=
attrs
.
keySet
().
iterator
();
Iterator
<
HtmlAttr
>
iterator
=
attrs
.
keySet
().
iterator
();
...
@@ -772,6 +772,6 @@ public class HtmlTree extends Content {
...
@@ -772,6 +772,6 @@ public class HtmlTree extends Content {
if
(
htmlTag
.
endTagRequired
())
if
(
htmlTag
.
endTagRequired
())
contentBuilder
.
append
(
"</"
+
tagString
+
">"
);
contentBuilder
.
append
(
"</"
+
tagString
+
">"
);
if
(!
isInline
())
if
(!
isInline
())
contentBuilder
.
append
(
"\n"
);
contentBuilder
.
append
(
DocletConstants
.
NL
);
}
}
}
}
src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java
浏览文件 @
ace9fd90
...
@@ -287,11 +287,11 @@ public class HtmlWriter extends PrintWriter {
...
@@ -287,11 +287,11 @@ public class HtmlWriter extends PrintWriter {
HtmlTree
script
=
new
HtmlTree
(
HtmlTag
.
SCRIPT
);
HtmlTree
script
=
new
HtmlTree
(
HtmlTag
.
SCRIPT
);
if
(
winTitle
!=
null
&&
winTitle
.
length
()
>
0
)
{
if
(
winTitle
!=
null
&&
winTitle
.
length
()
>
0
)
{
script
.
addAttr
(
HtmlAttr
.
TYPE
,
"text/javascript"
);
script
.
addAttr
(
HtmlAttr
.
TYPE
,
"text/javascript"
);
String
scriptCode
=
"<!--
\n"
+
String
scriptCode
=
"<!--
"
+
DocletConstants
.
NL
+
" if (location.href.indexOf('is-external=true') == -1) {
\n"
+
" if (location.href.indexOf('is-external=true') == -1) {
"
+
DocletConstants
.
NL
+
" parent.document.title=\""
+
winTitle
+
"\";
\n"
+
" parent.document.title=\""
+
winTitle
+
"\";
"
+
DocletConstants
.
NL
+
" }
\n"
+
" }
"
+
DocletConstants
.
NL
+
"//-->
\n"
;
"//-->
"
+
DocletConstants
.
NL
;
RawHtml
scriptContent
=
new
RawHtml
(
scriptCode
);
RawHtml
scriptContent
=
new
RawHtml
(
scriptCode
);
script
.
addContent
(
scriptContent
);
script
.
addContent
(
scriptContent
);
}
}
...
@@ -306,15 +306,15 @@ public class HtmlWriter extends PrintWriter {
...
@@ -306,15 +306,15 @@ public class HtmlWriter extends PrintWriter {
protected
Content
getFramesetJavaScript
(){
protected
Content
getFramesetJavaScript
(){
HtmlTree
script
=
new
HtmlTree
(
HtmlTag
.
SCRIPT
);
HtmlTree
script
=
new
HtmlTree
(
HtmlTag
.
SCRIPT
);
script
.
addAttr
(
HtmlAttr
.
TYPE
,
"text/javascript"
);
script
.
addAttr
(
HtmlAttr
.
TYPE
,
"text/javascript"
);
String
scriptCode
=
"\n targetPage = \"\" + window.location.search;\n"
+
String
scriptCode
=
DocletConstants
.
NL
+
" targetPage = \"\" + window.location.search;"
+
DocletConstants
.
NL
+
" if (targetPage != \"\" && targetPage != \"undefined\")
\n"
+
" if (targetPage != \"\" && targetPage != \"undefined\")
"
+
DocletConstants
.
NL
+
" targetPage = targetPage.substring(1);
\n"
+
" targetPage = targetPage.substring(1);
"
+
DocletConstants
.
NL
+
" if (targetPage.indexOf(\":\") != -1)
\n"
+
" if (targetPage.indexOf(\":\") != -1)
"
+
DocletConstants
.
NL
+
" targetPage = \"undefined\";
\n"
+
" targetPage = \"undefined\";
"
+
DocletConstants
.
NL
+
" function loadFrames() {
\n"
+
" function loadFrames() {
"
+
DocletConstants
.
NL
+
" if (targetPage != \"\" && targetPage != \"undefined\")
\n"
+
" if (targetPage != \"\" && targetPage != \"undefined\")
"
+
DocletConstants
.
NL
+
" top.classFrame.location = top.targetPage;
\n"
+
" top.classFrame.location = top.targetPage;
"
+
DocletConstants
.
NL
+
" }
\n"
;
" }
"
+
DocletConstants
.
NL
;
RawHtml
scriptContent
=
new
RawHtml
(
scriptCode
);
RawHtml
scriptContent
=
new
RawHtml
(
scriptCode
);
script
.
addContent
(
scriptContent
);
script
.
addContent
(
scriptContent
);
return
script
;
return
script
;
...
...
src/share/classes/com/sun/tools/doclets/internal/toolkit/Content.java
浏览文件 @
ace9fd90
...
@@ -101,6 +101,6 @@ public abstract class Content {
...
@@ -101,6 +101,6 @@ public abstract class Content {
*/
*/
public
boolean
endsWithNewLine
(
StringBuilder
contentBuilder
)
{
public
boolean
endsWithNewLine
(
StringBuilder
contentBuilder
)
{
return
((
contentBuilder
.
length
()
==
0
)
||
return
((
contentBuilder
.
length
()
==
0
)
||
(
contentBuilder
.
substring
(
contentBuilder
.
length
()
-
1
).
equals
(
"\n"
)));
(
contentBuilder
.
toString
().
endsWith
(
DocletConstants
.
NL
)));
}
}
}
}
src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Util.java
浏览文件 @
ace9fd90
...
@@ -211,14 +211,14 @@ public class Util {
...
@@ -211,14 +211,14 @@ public class Util {
try
{
try
{
while
((
len
=
input
.
read
(
bytearr
))
!=
-
1
)
{
while
((
len
=
input
.
read
(
bytearr
))
!=
-
1
)
{
output
.
write
(
bytearr
,
0
,
len
);
output
.
write
(
bytearr
,
0
,
len
);
}
}
}
catch
(
FileNotFoundException
exc
)
{
}
catch
(
FileNotFoundException
exc
)
{
}
catch
(
SecurityException
exc
)
{
}
catch
(
SecurityException
exc
)
{
}
finally
{
}
finally
{
input
.
close
();
input
.
close
();
output
.
close
();
output
.
close
();
}
}
}
}
/**
/**
* Copy the given directory contents from the source package directory
* Copy the given directory contents from the source package directory
...
@@ -330,7 +330,7 @@ public class Util {
...
@@ -330,7 +330,7 @@ public class Util {
String
resourcefile
,
boolean
overwrite
)
{
String
resourcefile
,
boolean
overwrite
)
{
String
destresourcesdir
=
configuration
.
destDirName
+
RESOURCESDIR
;
String
destresourcesdir
=
configuration
.
destDirName
+
RESOURCESDIR
;
copyFile
(
configuration
,
resourcefile
,
RESOURCESDIR
,
destresourcesdir
,
copyFile
(
configuration
,
resourcefile
,
RESOURCESDIR
,
destresourcesdir
,
overwrite
);
overwrite
,
false
);
}
}
/**
/**
...
@@ -345,23 +345,46 @@ public class Util {
...
@@ -345,23 +345,46 @@ public class Util {
* @param overwrite A flag to indicate whether the file in the
* @param overwrite A flag to indicate whether the file in the
* destination directory will be overwritten if
* destination directory will be overwritten if
* it already exists.
* it already exists.
* @param replaceNewLine true if the newline needs to be replaced with platform-
* specific newline.
*/
*/
public
static
void
copyFile
(
Configuration
configuration
,
String
file
,
String
source
,
public
static
void
copyFile
(
Configuration
configuration
,
String
file
,
String
source
,
String
destination
,
boolean
overwrite
)
{
String
destination
,
boolean
overwrite
,
boolean
replaceNewLine
)
{
DirectoryManager
.
createDirectory
(
configuration
,
destination
);
DirectoryManager
.
createDirectory
(
configuration
,
destination
);
File
destfile
=
new
File
(
destination
,
file
);
File
destfile
=
new
File
(
destination
,
file
);
if
(
destfile
.
exists
()
&&
(!
overwrite
))
return
;
if
(
destfile
.
exists
()
&&
(!
overwrite
))
return
;
try
{
try
{
InputStream
in
=
Configuration
.
class
.
getResourceAsStream
(
InputStream
in
=
Configuration
.
class
.
getResourceAsStream
(
source
+
DirectoryManager
.
URL_FILE_SEPARATOR
+
file
);
source
+
DirectoryManager
.
URL_FILE_SEPARATOR
+
file
);
if
(
in
==
null
)
return
;
if
(
in
==
null
)
return
;
OutputStream
out
=
new
FileOutputStream
(
destfile
);
OutputStream
out
=
new
FileOutputStream
(
destfile
);
byte
[]
buf
=
new
byte
[
2048
];
try
{
int
n
;
if
(!
replaceNewLine
)
{
while
((
n
=
in
.
read
(
buf
))>
0
)
out
.
write
(
buf
,
0
,
n
);
byte
[]
buf
=
new
byte
[
2048
];
in
.
close
();
int
n
;
out
.
close
();
while
((
n
=
in
.
read
(
buf
))>
0
)
out
.
write
(
buf
,
0
,
n
);
}
catch
(
Throwable
t
)
{}
}
else
{
BufferedReader
reader
=
new
BufferedReader
(
new
InputStreamReader
(
in
));
BufferedWriter
writer
=
new
BufferedWriter
(
new
OutputStreamWriter
(
out
));
try
{
String
line
;
while
((
line
=
reader
.
readLine
())
!=
null
)
{
writer
.
write
(
line
);
writer
.
write
(
DocletConstants
.
NL
);
}
}
finally
{
reader
.
close
();
writer
.
close
();
}
}
}
finally
{
in
.
close
();
out
.
close
();
}
}
catch
(
IOException
ie
)
{
ie
.
printStackTrace
();
throw
new
DocletAbortException
();
}
}
}
/**
/**
...
...
test/com/sun/javadoc/testHtmlDocument/TestHtmlDocument.java
浏览文件 @
ace9fd90
...
@@ -44,6 +44,7 @@ public class TestHtmlDocument {
...
@@ -44,6 +44,7 @@ public class TestHtmlDocument {
private
static
final
String
BUGID
=
"6851834"
;
private
static
final
String
BUGID
=
"6851834"
;
private
static
final
String
BUGNAME
=
"TestHtmlDocument"
;
private
static
final
String
BUGNAME
=
"TestHtmlDocument"
;
private
static
final
String
FS
=
System
.
getProperty
(
"file.separator"
);
private
static
final
String
FS
=
System
.
getProperty
(
"file.separator"
);
private
static
final
String
LS
=
System
.
getProperty
(
"line.separator"
);
private
static
String
srcdir
=
System
.
getProperty
(
"test.src"
,
"."
);
private
static
String
srcdir
=
System
.
getProperty
(
"test.src"
,
"."
);
// Entry point
// Entry point
...
@@ -143,13 +144,17 @@ public class TestHtmlDocument {
...
@@ -143,13 +144,17 @@ public class TestHtmlDocument {
System
.
out
.
println
(
"\nFILE DOES NOT EXIST: "
+
filename
);
System
.
out
.
println
(
"\nFILE DOES NOT EXIST: "
+
filename
);
}
}
BufferedReader
in
=
new
BufferedReader
(
new
FileReader
(
file
));
BufferedReader
in
=
new
BufferedReader
(
new
FileReader
(
file
));
StringBuilder
fileString
=
new
StringBuilder
();
// Create an array of characters the size of the file
// Create an array of characters the size of the file
char
[]
allChars
=
new
char
[(
int
)
file
.
length
()];
try
{
// Read the characters into the allChars array
String
line
;
in
.
read
(
allChars
,
0
,
(
int
)
file
.
length
());
while
((
line
=
in
.
readLine
())
!=
null
)
{
in
.
close
();
fileString
.
append
(
line
);
// Convert to a string
fileString
.
append
(
LS
);
String
allCharsString
=
new
String
(
allChars
);
}
return
allCharsString
;
}
finally
{
in
.
close
();
}
return
fileString
.
toString
();
}
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录