Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_langtools
提交
a23eee2f
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看板
提交
a23eee2f
编写于
10月 10, 2012
作者:
J
jjg
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8000418: javadoc should used a standard "generated by javadoc" string
Reviewed-by: bpatel
上级
acd19510
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
149 addition
and
92 deletion
+149
-92
src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java
.../com/sun/tools/doclets/formats/html/HtmlDocletWriter.java
+1
-62
src/share/classes/com/sun/tools/doclets/formats/html/SerializedFormWriterImpl.java
.../tools/doclets/formats/html/SerializedFormWriterImpl.java
+0
-17
src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocWriter.java
.../sun/tools/doclets/formats/html/markup/HtmlDocWriter.java
+5
-11
test/com/sun/javadoc/VersionNumber/VersionNumber.java
test/com/sun/javadoc/VersionNumber/VersionNumber.java
+2
-2
test/com/sun/javadoc/testGeneratedBy/TestGeneratedBy.java
test/com/sun/javadoc/testGeneratedBy/TestGeneratedBy.java
+112
-0
test/com/sun/javadoc/testGeneratedBy/pkg/MyClass.java
test/com/sun/javadoc/testGeneratedBy/pkg/MyClass.java
+29
-0
未找到文件。
src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java
浏览文件 @
a23eee2f
...
...
@@ -350,66 +350,6 @@ public class HtmlDocletWriter extends HtmlDocWriter {
return
getHyperLink
(
pathString
(
pd
,
"package-summary.html"
),
""
,
label
,
""
,
target
);
}
/**
* Print the html file header. Also print Html page title and stylesheet
* default properties.
*
* @param title String window title to go in the <TITLE> tag
* @param metakeywords Array of String keywords for META tag. Each element
* of the array is assigned to a separate META tag.
* Pass in null for no array.
* @param includeScript boolean true if printing windowtitle script.
* False for files that appear in the left-hand frames.
*/
public
void
printHtmlHeader
(
String
title
,
String
[]
metakeywords
,
boolean
includeScript
)
{
println
(
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 "
+
"Transitional//EN\" "
+
"\"http://www.w3.org/TR/html4/loose.dtd\">"
);
println
(
"<!--NewPage-->"
);
html
();
head
();
if
(!
configuration
.
notimestamp
)
{
print
(
"<!-- Generated by javadoc (build "
+
ConfigurationImpl
.
BUILD_DATE
+
") on "
);
print
(
today
());
println
(
" -->"
);
}
if
(
configuration
.
charset
.
length
()
>
0
)
{
println
(
"<META http-equiv=\"Content-Type\" content=\"text/html; "
+
"charset="
+
configuration
.
charset
+
"\">"
);
}
if
(
configuration
.
windowtitle
.
length
()
>
0
)
{
title
+=
" ("
+
configuration
.
windowtitle
+
")"
;
}
title
(
title
);
println
(
title
);
titleEnd
();
println
(
""
);
if
(!
configuration
.
notimestamp
)
{
SimpleDateFormat
dateFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
println
(
"<META NAME=\"date\" "
+
"CONTENT=\""
+
dateFormat
.
format
(
new
Date
())
+
"\">"
);
}
if
(
metakeywords
!=
null
)
{
for
(
int
i
=
0
;
i
<
metakeywords
.
length
;
i
++
)
{
println
(
"<META NAME=\"keywords\" "
+
"CONTENT=\""
+
metakeywords
[
i
]
+
"\">"
);
}
}
println
(
""
);
printStyleSheetProperties
();
println
(
""
);
// Don't print windowtitle script for overview-frame, allclasses-frame
// and package-frame
if
(
includeScript
)
{
printWinTitleScript
(
title
);
}
println
(
""
);
headEnd
();
println
(
""
);
body
(
"white"
,
includeScript
);
}
/**
* Generates the HTML document tree and prints it out.
*
...
...
@@ -426,8 +366,7 @@ public class HtmlDocletWriter extends HtmlDocWriter {
Content
htmlComment
=
new
Comment
(
configuration
.
getText
(
"doclet.New_Page"
));
Content
head
=
new
HtmlTree
(
HtmlTag
.
HEAD
);
if
(!
configuration
.
notimestamp
)
{
Content
headComment
=
new
Comment
(
"Generated by javadoc (version "
+
ConfigurationImpl
.
BUILD_DATE
+
") on "
+
today
());
Content
headComment
=
new
Comment
(
getGeneratedByString
());
head
.
addContent
(
headComment
);
}
if
(
configuration
.
charset
.
length
()
>
0
)
{
...
...
src/share/classes/com/sun/tools/doclets/formats/html/SerializedFormWriterImpl.java
浏览文件 @
a23eee2f
...
...
@@ -54,23 +54,6 @@ public class SerializedFormWriterImpl extends SubWriterHolderWriter
super
(
ConfigurationImpl
.
getInstance
(),
FILE_NAME
);
}
/**
* Writes the given header.
*
* @param header the header to write.
*/
public
void
writeHeader
(
String
header
)
{
printHtmlHeader
(
header
,
null
,
true
);
printTop
();
navLinks
(
true
);
hr
();
center
();
h1
();
print
(
header
);
h1End
();
centerEnd
();
}
/**
* Get the given header.
*
...
...
src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocWriter.java
浏览文件 @
a23eee2f
...
...
@@ -29,6 +29,7 @@ import java.io.*;
import
java.util.*
;
import
com.sun.javadoc.*
;
import
com.sun.tools.doclets.formats.html.ConfigurationImpl
;
import
com.sun.tools.doclets.internal.toolkit.*
;
...
...
@@ -329,7 +330,7 @@ public abstract class HtmlDocWriter extends HtmlWriter {
Content
htmlComment
=
new
Comment
(
configuration
.
getText
(
"doclet.New_Page"
));
Content
head
=
new
HtmlTree
(
HtmlTag
.
HEAD
);
if
(!
noTimeStamp
)
{
Content
headComment
=
new
Comment
(
"Generated by javadoc on "
+
today
());
Content
headComment
=
new
Comment
(
getGeneratedByString
());
head
.
addContent
(
headComment
);
}
if
(
configuration
.
charset
.
length
()
>
0
)
{
...
...
@@ -391,16 +392,9 @@ public abstract class HtmlDocWriter extends HtmlWriter {
print
(
" "
);
}
/**
* Get the day and date information for today, depending upon user option.
*
* @return String Today.
* @see java.util.Calendar
* @see java.util.GregorianCalendar
* @see java.util.TimeZone
*/
public
String
today
()
{
protected
String
getGeneratedByString
()
{
Calendar
calendar
=
new
GregorianCalendar
(
TimeZone
.
getDefault
());
return
calendar
.
getTime
().
toString
();
Date
today
=
calendar
.
getTime
();
return
"Generated by javadoc ("
+
ConfigurationImpl
.
BUILD_DATE
+
") on "
+
today
;
}
}
test/com/sun/javadoc/VersionNumber/VersionNumber.java
浏览文件 @
a23eee2f
/*
* Copyright (c) 2002, 201
0
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 201
2
, 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
...
...
@@ -84,7 +84,7 @@ public class VersionNumber {
// Test the proper DOCTYPE element is present:
{
"<!-- Generated by javadoc (
version
"
,
"<!-- Generated by javadoc ("
,
TMPDEST_DIR1
+
"p1"
+
FS
+
"C.html"
},
};
...
...
test/com/sun/javadoc/testGeneratedBy/TestGeneratedBy.java
0 → 100644
浏览文件 @
a23eee2f
/*
* Copyright (c) 2012, 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 8000418
* @summary Verify that files use a common Generated By string
* @library ../lib/
* @build JavadocTester TestGeneratedBy
* @run main TestGeneratedBy
*/
public
class
TestGeneratedBy
extends
JavadocTester
{
private
static
final
String
OUTPUT_DIR
=
"tmp"
;
private
static
final
String
[]
FILES
=
{
"pkg/MyClass.html"
,
"pkg/package-summary.html"
,
"pkg/package-frame.html"
,
"pkg/package-tree.html"
,
"allclasses-noframe.html"
,
"constant-values.html"
,
"allclasses-frame.html"
,
"overview-tree.html"
,
"deprecated-list.html"
,
"serialized-form.html"
,
"help-doc.html"
,
"index-all.html"
,
"index.html"
};
private
static
final
String
[]
ARGS
=
new
String
[]
{
"-d"
,
OUTPUT_DIR
,
"-sourcepath"
,
SRC_DIR
,
"pkg"
};
private
static
final
String
BUG_ID
=
"8000418"
;
private
static
String
[][]
getTests
()
{
String
version
=
System
.
getProperty
(
"java.version"
);
String
[][]
tests
=
new
String
[
FILES
.
length
][];
for
(
int
i
=
0
;
i
<
FILES
.
length
;
i
++)
{
tests
[
i
]
=
new
String
[]
{
OUTPUT_DIR
+
FS
+
FILES
[
i
],
"Generated by javadoc ("
+
version
+
") on "
};
}
return
tests
;
}
private
static
String
[][]
getNegatedTests
()
{
String
[][]
tests
=
new
String
[
FILES
.
length
][];
for
(
int
i
=
0
;
i
<
FILES
.
length
;
i
++)
{
tests
[
i
]
=
new
String
[]
{
OUTPUT_DIR
+
FS
+
FILES
[
i
],
"Generated by javadoc (version"
,
"Generated by javadoc on"
};
}
return
tests
;
}
/**
* The entry point of the test.
* @param args the array of command line arguments.
*/
public
static
void
main
(
String
[]
args
)
{
TestGeneratedBy
tester
=
new
TestGeneratedBy
();
int
exitCode
=
run
(
tester
,
ARGS
,
getTests
(),
getNegatedTests
());
tester
.
printSummary
();
if
(
exitCode
!=
0
)
{
throw
new
Error
(
"Error found while executing Javadoc"
);
}
}
/**
* {@inheritDoc}
*/
public
String
getBugId
()
{
return
BUG_ID
;
}
/**
* {@inheritDoc}
*/
public
String
getBugName
()
{
return
getClass
().
getName
();
}
}
test/com/sun/javadoc/testGeneratedBy/pkg/MyClass.java
0 → 100644
浏览文件 @
a23eee2f
/*
* Copyright (c) 2012, 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.io.Serializable
;
public
class
MyClass
implements
Serializable
{
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录