Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
a1eaf82e
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
a1eaf82e
编写于
5月 13, 2016
作者:
M
mcherkas
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8078268: javax.swing.text.html.parser.Parser parseScript incorrectly optimized
Reviewed-by: alexp, aivanov
上级
85355489
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
53 addition
and
41 deletion
+53
-41
src/share/classes/javax/swing/text/html/parser/Parser.java
src/share/classes/javax/swing/text/html/parser/Parser.java
+53
-41
test/javax/swing/text/html/parser/Parser/8078268/bug8078268.java
...vax/swing/text/html/parser/Parser/8078268/bug8078268.java
+0
-0
test/javax/swing/text/html/parser/Parser/8078268/slowparse.html
...avax/swing/text/html/parser/Parser/8078268/slowparse.html
+0
-0
未找到文件。
src/share/classes/javax/swing/text/html/parser/Parser.java
浏览文件 @
a1eaf82e
...
@@ -1986,57 +1986,69 @@ class Parser implements DTDConstants {
...
@@ -1986,57 +1986,69 @@ class Parser implements DTDConstants {
while
(
true
)
{
while
(
true
)
{
int
i
=
0
;
int
i
=
0
;
while
(!
insideComment
&&
i
<
SCRIPT_END_TAG
.
length
while
(!
insideComment
&&
i
<
SCRIPT_END_TAG
.
length
&&
(
SCRIPT_END_TAG
[
i
]
==
ch
&&
(
SCRIPT_END_TAG
[
i
]
==
ch
||
SCRIPT_END_TAG_UPPER_CASE
[
i
]
==
ch
))
{
||
SCRIPT_END_TAG_UPPER_CASE
[
i
]
==
ch
))
{
charsToAdd
[
i
]
=
(
char
)
ch
;
charsToAdd
[
i
]
=
(
char
)
ch
;
ch
=
readCh
();
ch
=
readCh
();
i
++;
i
++;
}
}
if
(
i
==
SCRIPT_END_TAG
.
length
)
{
if
(
i
==
SCRIPT_END_TAG
.
length
)
{
/* '</script>' tag detected */
/* Here, ch == the first character after </script> */
return
;
return
;
}
else
{
}
/* To account for extra read()'s that happened */
for
(
int
j
=
0
;
j
<
i
;
j
++)
{
addString
(
charsToAdd
[
j
]);
}
switch
(
ch
)
{
if
(!
insideComment
&&
i
==
1
&&
charsToAdd
[
0
]
==
START_COMMENT
.
charAt
(
0
))
{
case
-
1
:
// it isn't end script tag, but may be it's start comment tag?
error
(
"eof.script"
);
while
(
i
<
START_COMMENT
.
length
()
return
;
&&
START_COMMENT
.
charAt
(
i
)
==
ch
)
{
case
'\n'
:
charsToAdd
[
i
]
=
(
char
)
ch
;
ln
++;
ch
=
readCh
();
ch
=
readCh
();
lfCount
++;
i
++;
addString
(
'\n'
);
}
break
;
if
(
i
==
START_COMMENT
.
length
())
{
case
'\r'
:
insideComment
=
true
;
ln
++;
}
if
((
ch
=
readCh
())
==
'\n'
)
{
}
ch
=
readCh
();
if
(
insideComment
)
{
crlfCount
++;
while
(
i
<
END_COMMENT
.
length
()
}
else
{
&&
END_COMMENT
.
charAt
(
i
)
==
ch
)
{
crCount
++;
charsToAdd
[
i
]
=
(
char
)
ch
;
}
addString
(
'\n'
);
break
;
default
:
addString
(
ch
);
String
str
=
new
String
(
getChars
(
0
,
strpos
));
if
(!
insideComment
&&
str
.
endsWith
(
START_COMMENT
))
{
insideComment
=
true
;
}
if
(
insideComment
&&
str
.
endsWith
(
END_COMMENT
))
{
insideComment
=
false
;
}
ch
=
readCh
();
ch
=
readCh
();
break
;
i
++;
}
// switch
}
if
(
i
==
END_COMMENT
.
length
())
{
insideComment
=
false
;
}
}
/* To account for extra read()'s that happened */
for
(
int
j
=
0
;
j
<
i
;
j
++)
{
addString
(
charsToAdd
[
j
]);
}
}
switch
(
ch
)
{
case
-
1
:
error
(
"eof.script"
);
return
;
case
'\n'
:
ln
++;
ch
=
readCh
();
lfCount
++;
addString
(
'\n'
);
break
;
case
'\r'
:
ln
++;
if
((
ch
=
readCh
())
==
'\n'
)
{
ch
=
readCh
();
crlfCount
++;
}
else
{
crCount
++;
}
addString
(
'\n'
);
break
;
default
:
addString
(
ch
);
ch
=
readCh
();
break
;
}
// switch
}
// while
}
// while
}
}
...
...
test/javax/swing/text/html/parser/Parser/8078268/bug8078268.java
0 → 100644
浏览文件 @
a1eaf82e
test/javax/swing/text/html/parser/Parser/8078268/slowparse.html
0 → 100644
浏览文件 @
a1eaf82e
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录