Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
LinuxSuRen
Dragonwell11
提交
886efc87
D
Dragonwell11
项目概览
LinuxSuRen
/
Dragonwell11
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Dragonwell11
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
886efc87
编写于
2月 12, 2020
作者:
J
joehw
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8232014: Expand DTD support
Reviewed-by: lancea, dfuchs, mschoene, rhalade, aefimov
上级
6155ce48
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
21 addition
and
20 deletion
+21
-20
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/XMLDTDScannerImpl.java
...un/org/apache/xerces/internal/impl/XMLDTDScannerImpl.java
+8
-10
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/XMLScanner.java
...s/com/sun/org/apache/xerces/internal/impl/XMLScanner.java
+5
-5
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/DTDGrammar.java
...m/sun/org/apache/xerces/internal/impl/dtd/DTDGrammar.java
+8
-5
未找到文件。
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/XMLDTDScannerImpl.java
浏览文件 @
886efc87
/*
/*
* Copyright (c) 2003, 20
17
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 20
20
, Oracle and/or its affiliates. All rights reserved.
*/
*/
/*
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* Licensed to the Apache Software Foundation (ASF) under one or more
...
@@ -63,7 +63,7 @@ import java.io.IOException;
...
@@ -63,7 +63,7 @@ import java.io.IOException;
* @author Glenn Marcy, IBM
* @author Glenn Marcy, IBM
* @author Eric Ye, IBM
* @author Eric Ye, IBM
*
*
* @LastModified:
Nov 2017
* @LastModified:
Feb 2020
*/
*/
public
class
XMLDTDScannerImpl
public
class
XMLDTDScannerImpl
extends
XMLScanner
extends
XMLScanner
...
@@ -608,6 +608,7 @@ implements XMLDTDScanner, XMLComponent, XMLEntityHandler {
...
@@ -608,6 +608,7 @@ implements XMLDTDScanner, XMLComponent, XMLEntityHandler {
if
(
fScannerState
==
SCANNER_STATE_END_OF_INPUT
)
if
(
fScannerState
==
SCANNER_STATE_END_OF_INPUT
)
return
;
return
;
boolean
dtdEntity
=
name
.
equals
(
"[dtd]"
);
// Handle end of PE
// Handle end of PE
boolean
reportEntity
=
fReportEntity
;
boolean
reportEntity
=
fReportEntity
;
if
(
name
.
startsWith
(
"%"
))
{
if
(
name
.
startsWith
(
"%"
))
{
...
@@ -616,8 +617,7 @@ implements XMLDTDScanner, XMLComponent, XMLEntityHandler {
...
@@ -616,8 +617,7 @@ implements XMLDTDScanner, XMLComponent, XMLEntityHandler {
int
startMarkUpDepth
=
popPEStack
();
int
startMarkUpDepth
=
popPEStack
();
// throw fatalError if this entity was incomplete and
// throw fatalError if this entity was incomplete and
// was a freestanding decl
// was a freestanding decl
if
(
startMarkUpDepth
==
0
&&
if
(
startMarkUpDepth
==
0
&&
startMarkUpDepth
<
fMarkUpDepth
)
{
startMarkUpDepth
<
fMarkUpDepth
)
{
fErrorReporter
.
reportError
(
XMLMessageFormatter
.
XML_DOMAIN
,
fErrorReporter
.
reportError
(
XMLMessageFormatter
.
XML_DOMAIN
,
"ILL_FORMED_PARAMETER_ENTITY_WHEN_USED_IN_DECL"
,
"ILL_FORMED_PARAMETER_ENTITY_WHEN_USED_IN_DECL"
,
new
Object
[]{
fEntityManager
.
fCurrentEntity
.
name
},
new
Object
[]{
fEntityManager
.
fCurrentEntity
.
name
},
...
@@ -637,12 +637,10 @@ implements XMLDTDScanner, XMLComponent, XMLEntityHandler {
...
@@ -637,12 +637,10 @@ implements XMLDTDScanner, XMLComponent, XMLEntityHandler {
if
(
fEntityScanner
.
isExternal
())
{
if
(
fEntityScanner
.
isExternal
())
{
fExtEntityDepth
--;
fExtEntityDepth
--;
}
}
}
// call handler
if
(
fDTDHandler
!=
null
&&
reportEntity
)
{
// call handler
fDTDHandler
.
endParameterEntity
(
name
,
null
);
boolean
dtdEntity
=
name
.
equals
(
"[dtd]"
);
}
if
(
fDTDHandler
!=
null
&&
!
dtdEntity
&&
reportEntity
)
{
fDTDHandler
.
endParameterEntity
(
name
,
null
);
}
}
// end DTD
// end DTD
...
...
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/XMLScanner.java
浏览文件 @
886efc87
/*
/*
* Copyright (c) 2003, 20
17
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 20
20
, Oracle and/or its affiliates. All rights reserved.
*/
*/
/*
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* Licensed to the Apache Software Foundation (ASF) under one or more
...
@@ -67,7 +67,7 @@ import com.sun.xml.internal.stream.Entity;
...
@@ -67,7 +67,7 @@ import com.sun.xml.internal.stream.Entity;
* @author Eric Ye, IBM
* @author Eric Ye, IBM
* @author K.Venugopal SUN Microsystems
* @author K.Venugopal SUN Microsystems
* @author Sunitha Reddy, SUN Microsystems
* @author Sunitha Reddy, SUN Microsystems
* @LastModified:
Nov 2017
* @LastModified:
Feb 2020
*/
*/
public
abstract
class
XMLScanner
public
abstract
class
XMLScanner
implements
XMLComponent
{
implements
XMLComponent
{
...
@@ -1239,10 +1239,10 @@ public abstract class XMLScanner
...
@@ -1239,10 +1239,10 @@ public abstract class XMLScanner
* @throws XNIException Thrown by handler to signal an error.
* @throws XNIException Thrown by handler to signal an error.
*/
*/
public
void
endEntity
(
String
name
,
Augmentations
augs
)
throws
IOException
,
XNIException
{
public
void
endEntity
(
String
name
,
Augmentations
augs
)
throws
IOException
,
XNIException
{
// keep track of the entity depth
// keep track of the entity depth
fEntityDepth
--;
if
(
fEntityDepth
>
0
)
{
fEntityDepth
--;
}
}
// endEntity(String)
}
// endEntity(String)
/**
/**
...
...
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/DTDGrammar.java
浏览文件 @
886efc87
/*
/*
* Copyright (c) 2015, 20
17
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 20
20
, Oracle and/or its affiliates. All rights reserved.
*/
*/
/*
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* Licensed to the Apache Software Foundation (ASF) under one or more
...
@@ -62,7 +62,7 @@ import java.util.Random;
...
@@ -62,7 +62,7 @@ import java.util.Random;
* @author Andy Clark, IBM
* @author Andy Clark, IBM
* @author Neil Graham, IBM
* @author Neil Graham, IBM
*
*
* @LastModified:
Oct 2017
* @LastModified:
Feb 2020
*/
*/
public
class
DTDGrammar
public
class
DTDGrammar
implements
XMLDTDHandler
,
XMLDTDContentModelHandler
,
EntityState
,
Grammar
{
implements
XMLDTDHandler
,
XMLDTDContentModelHandler
,
EntityState
,
Grammar
{
...
@@ -447,9 +447,12 @@ public class DTDGrammar
...
@@ -447,9 +447,12 @@ public class DTDGrammar
* @throws XNIException Thrown by handler to signal an error.
* @throws XNIException Thrown by handler to signal an error.
*/
*/
public
void
endParameterEntity
(
String
name
,
Augmentations
augs
)
throws
XNIException
{
public
void
endParameterEntity
(
String
name
,
Augmentations
augs
)
throws
XNIException
{
// redundant check as this method can only be called after parsing a PE
fPEDepth
--;
// incomplete or truncated DTD get caught before reaching this method
fReadingExternalDTD
=
fPEntityStack
[
fPEDepth
];
if
(
fPEDepth
>
0
)
{
fPEDepth
--;
fReadingExternalDTD
=
fPEntityStack
[
fPEDepth
];
}
}
// endParameterEntity(String,Augmentations)
}
// endParameterEntity(String,Augmentations)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录