Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_langtools
提交
771569ad
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看板
提交
771569ad
编写于
6月 03, 2013
作者:
L
lana
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
e3ff55b4
c4323b9a
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
30 addition
and
27 deletion
+30
-27
src/share/classes/com/sun/tools/doclint/Checker.java
src/share/classes/com/sun/tools/doclint/Checker.java
+13
-0
src/share/classes/com/sun/tools/doclint/HtmlTag.java
src/share/classes/com/sun/tools/doclint/HtmlTag.java
+3
-1
src/share/classes/com/sun/tools/doclint/resources/doclint.properties
...lasses/com/sun/tools/doclint/resources/doclint.properties
+1
-0
test/tools/doclint/html/ListTagsTest.java
test/tools/doclint/html/ListTagsTest.java
+6
-26
test/tools/doclint/html/ListTagsTest.out
test/tools/doclint/html/ListTagsTest.out
+7
-0
未找到文件。
src/share/classes/com/sun/tools/doclint/Checker.java
浏览文件 @
771569ad
...
@@ -531,6 +531,17 @@ public class Checker extends DocTreePathScanner<Void, Void> {
...
@@ -531,6 +531,17 @@ public class Checker extends DocTreePathScanner<Void, Void> {
}
}
}
}
break
;
break
;
case
VALUE:
if
(
currTag
==
HtmlTag
.
LI
)
{
String
v
=
getAttrValue
(
tree
);
if
(
v
==
null
||
v
.
isEmpty
())
{
env
.
messages
.
error
(
HTML
,
tree
,
"dc.attr.lacks.value"
);
}
else
if
(!
validNumber
.
matcher
(
v
).
matches
())
{
env
.
messages
.
error
(
HTML
,
tree
,
"dc.attr.not.number"
);
}
}
break
;
}
}
}
}
}
}
...
@@ -543,6 +554,8 @@ public class Checker extends DocTreePathScanner<Void, Void> {
...
@@ -543,6 +554,8 @@ public class Checker extends DocTreePathScanner<Void, Void> {
// http://www.w3.org/TR/html401/types.html#type-name
// http://www.w3.org/TR/html401/types.html#type-name
private
static
final
Pattern
validName
=
Pattern
.
compile
(
"[A-Za-z][A-Za-z0-9-_:.]*"
);
private
static
final
Pattern
validName
=
Pattern
.
compile
(
"[A-Za-z][A-Za-z0-9-_:.]*"
);
private
static
final
Pattern
validNumber
=
Pattern
.
compile
(
"-?[0-9]+"
);
// pattern to remove leading {@docRoot}/?
// pattern to remove leading {@docRoot}/?
private
static
final
Pattern
docRoot
=
Pattern
.
compile
(
"(?i)(\\{@docRoot *\\}/?)?(.*)"
);
private
static
final
Pattern
docRoot
=
Pattern
.
compile
(
"(?i)(\\{@docRoot *\\}/?)?(.*)"
);
...
...
src/share/classes/com/sun/tools/doclint/HtmlTag.java
浏览文件 @
771569ad
...
@@ -131,7 +131,8 @@ public enum HtmlTag {
...
@@ -131,7 +131,8 @@ public enum HtmlTag {
attrs
(
AttrKind
.
USE_CSS
,
ALIGN
,
HSPACE
,
VSPACE
,
BORDER
)),
attrs
(
AttrKind
.
USE_CSS
,
ALIGN
,
HSPACE
,
VSPACE
,
BORDER
)),
LI
(
BlockType
.
LIST_ITEM
,
EndKind
.
OPTIONAL
,
LI
(
BlockType
.
LIST_ITEM
,
EndKind
.
OPTIONAL
,
EnumSet
.
of
(
Flag
.
ACCEPTS_BLOCK
,
Flag
.
ACCEPTS_INLINE
)),
EnumSet
.
of
(
Flag
.
ACCEPTS_BLOCK
,
Flag
.
ACCEPTS_INLINE
),
attrs
(
AttrKind
.
OK
,
VALUE
)),
LINK
(
BlockType
.
OTHER
,
EndKind
.
NONE
),
LINK
(
BlockType
.
OTHER
,
EndKind
.
NONE
),
...
@@ -339,6 +340,7 @@ public enum HtmlTag {
...
@@ -339,6 +340,7 @@ public enum HtmlTag {
TARGET
,
TARGET
,
TYPE
,
TYPE
,
VALIGN
,
VALIGN
,
VALUE
,
VSPACE
,
VSPACE
,
WIDTH
;
WIDTH
;
...
...
src/share/classes/com/sun/tools/doclint/resources/doclint.properties
浏览文件 @
771569ad
...
@@ -26,6 +26,7 @@
...
@@ -26,6 +26,7 @@
dc.anchor.already.defined
=
anchor already defined: {0}
dc.anchor.already.defined
=
anchor already defined: {0}
dc.anchor.value.missing
=
no value given for anchor
dc.anchor.value.missing
=
no value given for anchor
dc.attr.lacks.value
=
attribute lacks value
dc.attr.lacks.value
=
attribute lacks value
dc.attr.not.number
=
attribute value is not a number
dc.attr.obsolete
=
attribute obsolete: {0}
dc.attr.obsolete
=
attribute obsolete: {0}
dc.attr.obsolete.use.css
=
attribute obsolete, use CSS instead: {0}
dc.attr.obsolete.use.css
=
attribute obsolete, use CSS instead: {0}
dc.attr.repeated
=
repeated attribute: {0}
dc.attr.repeated
=
repeated attribute: {0}
...
...
test/tools/doclint/html/ListTagsTest.java
浏览文件 @
771569ad
/*
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* @test /nodynamiccopyright/
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* @bug 8006251 8013405
*
* 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 8006251
* @summary test list tags
* @summary test list tags
* @library ..
* @library ..
* @build DocLintTester
* @build DocLintTester
* @run main DocLintTester -Xmsgs ListTagsTest.java
* @run main DocLintTester -Xmsgs
-ref ListTagsTest.out
ListTagsTest.java
*/
*/
/** */
/** */
...
@@ -35,6 +12,9 @@ public class ListTagsTest {
...
@@ -35,6 +12,9 @@ public class ListTagsTest {
/**
/**
* <dl> <dt> abc <dd> def </dl>
* <dl> <dt> abc <dd> def </dl>
* <ol> <li> abc </ol>
* <ol> <li> abc </ol>
* <ol> <li value="1"> abc </ol>
* <ol> <li value> bad </ol>
* <ol> <li value="a"> bad </ol>
* <ul> <li> abc </ul>
* <ul> <li> abc </ul>
*/
*/
public
void
supportedTags
()
{
}
public
void
supportedTags
()
{
}
...
...
test/tools/doclint/html/ListTagsTest.out
0 → 100644
浏览文件 @
771569ad
ListTagsTest.java:16: error: attribute lacks value
* <ol> <li value> bad </ol>
^
ListTagsTest.java:17: error: attribute value is not a number
* <ol> <li value="a"> bad </ol>
^
2 errors
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录