Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
75ee28e4
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看板
提交
75ee28e4
编写于
12月 08, 2011
作者:
S
smarks
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7118546: fix warnings in javax.xml.crypto, javax.script
Reviewed-by: mullan
上级
322c6102
变更
21
隐藏空白更改
内联
并排
Showing
21 changed file
with
92 addition
and
36 deletion
+92
-36
src/share/classes/javax/script/ScriptException.java
src/share/classes/javax/script/ScriptException.java
+2
-0
src/share/classes/javax/xml/crypto/NodeSetData.java
src/share/classes/javax/xml/crypto/NodeSetData.java
+1
-0
src/share/classes/javax/xml/crypto/dom/DOMCryptoContext.java
src/share/classes/javax/xml/crypto/dom/DOMCryptoContext.java
+8
-7
src/share/classes/javax/xml/crypto/dsig/Manifest.java
src/share/classes/javax/xml/crypto/dsig/Manifest.java
+1
-0
src/share/classes/javax/xml/crypto/dsig/Reference.java
src/share/classes/javax/xml/crypto/dsig/Reference.java
+1
-0
src/share/classes/javax/xml/crypto/dsig/SignatureProperties.java
...re/classes/javax/xml/crypto/dsig/SignatureProperties.java
+1
-0
src/share/classes/javax/xml/crypto/dsig/SignatureProperty.java
...hare/classes/javax/xml/crypto/dsig/SignatureProperty.java
+1
-0
src/share/classes/javax/xml/crypto/dsig/SignedInfo.java
src/share/classes/javax/xml/crypto/dsig/SignedInfo.java
+1
-0
src/share/classes/javax/xml/crypto/dsig/TransformService.java
...share/classes/javax/xml/crypto/dsig/TransformService.java
+8
-8
src/share/classes/javax/xml/crypto/dsig/XMLObject.java
src/share/classes/javax/xml/crypto/dsig/XMLObject.java
+1
-0
src/share/classes/javax/xml/crypto/dsig/XMLSignature.java
src/share/classes/javax/xml/crypto/dsig/XMLSignature.java
+1
-0
src/share/classes/javax/xml/crypto/dsig/XMLSignatureFactory.java
...re/classes/javax/xml/crypto/dsig/XMLSignatureFactory.java
+11
-0
src/share/classes/javax/xml/crypto/dsig/keyinfo/KeyInfo.java
src/share/classes/javax/xml/crypto/dsig/keyinfo/KeyInfo.java
+1
-0
src/share/classes/javax/xml/crypto/dsig/keyinfo/KeyInfoFactory.java
...classes/javax/xml/crypto/dsig/keyinfo/KeyInfoFactory.java
+6
-0
src/share/classes/javax/xml/crypto/dsig/keyinfo/PGPData.java
src/share/classes/javax/xml/crypto/dsig/keyinfo/PGPData.java
+1
-0
src/share/classes/javax/xml/crypto/dsig/keyinfo/RetrievalMethod.java
...lasses/javax/xml/crypto/dsig/keyinfo/RetrievalMethod.java
+1
-0
src/share/classes/javax/xml/crypto/dsig/keyinfo/X509Data.java
...share/classes/javax/xml/crypto/dsig/keyinfo/X509Data.java
+1
-0
src/share/classes/javax/xml/crypto/dsig/spec/ExcC14NParameterSpec.java
...sses/javax/xml/crypto/dsig/spec/ExcC14NParameterSpec.java
+12
-6
src/share/classes/javax/xml/crypto/dsig/spec/XPathFilter2ParameterSpec.java
...javax/xml/crypto/dsig/spec/XPathFilter2ParameterSpec.java
+9
-3
src/share/classes/javax/xml/crypto/dsig/spec/XPathFilterParameterSpec.java
.../javax/xml/crypto/dsig/spec/XPathFilterParameterSpec.java
+12
-6
src/share/classes/javax/xml/crypto/dsig/spec/XPathType.java
src/share/classes/javax/xml/crypto/dsig/spec/XPathType.java
+12
-6
未找到文件。
src/share/classes/javax/script/ScriptException.java
浏览文件 @
75ee28e4
...
...
@@ -36,6 +36,8 @@ package javax.script;
*/
public
class
ScriptException
extends
Exception
{
private
static
final
long
serialVersionUID
=
8265071037049225001L
;
private
String
fileName
;
private
int
lineNumber
;
private
int
columnNumber
;
...
...
src/share/classes/javax/xml/crypto/NodeSetData.java
浏览文件 @
75ee28e4
...
...
@@ -52,5 +52,6 @@ public interface NodeSetData extends Data {
* @return an <code>Iterator</code> over the nodes in this
* <code>NodeSetData</code> in document order
*/
@SuppressWarnings
(
"rawtypes"
)
Iterator
iterator
();
}
src/share/classes/javax/xml/crypto/dom/DOMCryptoContext.java
浏览文件 @
75ee28e4
...
...
@@ -47,13 +47,13 @@ import org.w3c.dom.Element;
*/
public
class
DOMCryptoContext
implements
XMLCryptoContext
{
private
HashMap
nsMap
=
new
HashMap
();
private
HashMap
idMap
=
new
HashMap
();
private
HashMap
objMap
=
new
HashMap
();
private
HashMap
<
String
,
String
>
nsMap
=
new
HashMap
<>
();
private
HashMap
<
String
,
Element
>
idMap
=
new
HashMap
<>
();
private
HashMap
<
Object
,
Object
>
objMap
=
new
HashMap
<>
();
private
String
baseURI
;
private
KeySelector
ks
;
private
URIDereferencer
dereferencer
;
private
HashMap
propMap
=
new
HashMap
();
private
HashMap
<
String
,
Object
>
propMap
=
new
HashMap
<>
();
private
String
defaultPrefix
;
/**
...
...
@@ -73,7 +73,7 @@ public class DOMCryptoContext implements XMLCryptoContext {
if
(
namespaceURI
==
null
)
{
throw
new
NullPointerException
(
"namespaceURI cannot be null"
);
}
String
prefix
=
(
String
)
nsMap
.
get
(
namespaceURI
);
String
prefix
=
nsMap
.
get
(
namespaceURI
);
return
(
prefix
!=
null
?
prefix
:
defaultPrefix
);
}
...
...
@@ -87,7 +87,7 @@ public class DOMCryptoContext implements XMLCryptoContext {
if
(
namespaceURI
==
null
)
{
throw
new
NullPointerException
(
"namespaceURI is null"
);
}
return
(
String
)
nsMap
.
put
(
namespaceURI
,
prefix
);
return
nsMap
.
put
(
namespaceURI
,
prefix
);
}
public
String
getDefaultNamespacePrefix
()
{
...
...
@@ -170,7 +170,7 @@ public class DOMCryptoContext implements XMLCryptoContext {
if
(
idValue
==
null
)
{
throw
new
NullPointerException
(
"idValue is null"
);
}
return
(
Element
)
idMap
.
get
(
idValue
);
return
idMap
.
get
(
idValue
);
}
/**
...
...
@@ -219,6 +219,7 @@ public class DOMCryptoContext implements XMLCryptoContext {
*
* @return a read-only iterator over the set of mappings
*/
@SuppressWarnings
(
"rawtypes"
)
public
Iterator
iterator
()
{
return
Collections
.
unmodifiableMap
(
idMap
).
entrySet
().
iterator
();
}
...
...
src/share/classes/javax/xml/crypto/dsig/Manifest.java
浏览文件 @
75ee28e4
...
...
@@ -86,5 +86,6 @@ public interface Manifest extends XMLStructure {
*
* @return an unmodifiable list of one or more <code>Reference</code>s
*/
@SuppressWarnings
(
"rawtypes"
)
List
getReferences
();
}
src/share/classes/javax/xml/crypto/dsig/Reference.java
浏览文件 @
75ee28e4
...
...
@@ -85,6 +85,7 @@ public interface Reference extends URIReference, XMLStructure {
* @return an unmodifiable list of <code>Transform</code>s
* (may be empty but never <code>null</code>)
*/
@SuppressWarnings
(
"rawtypes"
)
List
getTransforms
();
/**
...
...
src/share/classes/javax/xml/crypto/dsig/SignatureProperties.java
浏览文件 @
75ee28e4
...
...
@@ -87,5 +87,6 @@ public interface SignatureProperties extends XMLStructure {
* @return an unmodifiable list of one or more
* <code>SignatureProperty</code>s
*/
@SuppressWarnings
(
"rawtypes"
)
List
getProperties
();
}
src/share/classes/javax/xml/crypto/dsig/SignatureProperty.java
浏览文件 @
75ee28e4
...
...
@@ -91,5 +91,6 @@ public interface SignatureProperty extends XMLStructure {
*
* @return an unmodifiable list of one or more <code>XMLStructure</code>s
*/
@SuppressWarnings
(
"rawtypes"
)
List
getContent
();
}
src/share/classes/javax/xml/crypto/dsig/SignedInfo.java
浏览文件 @
75ee28e4
...
...
@@ -80,6 +80,7 @@ public interface SignedInfo extends XMLStructure {
*
* @return an unmodifiable list of one or more {@link Reference}s
*/
@SuppressWarnings
(
"rawtypes"
)
List
getReferences
();
/**
...
...
src/share/classes/javax/xml/crypto/dsig/TransformService.java
浏览文件 @
75ee28e4
...
...
@@ -157,9 +157,9 @@ public abstract class TransformService implements Transform {
if
(
mechanismType
.
equals
(
"DOM"
))
{
dom
=
true
;
}
List
services
=
GetInstance
.
getServices
(
"TransformService"
,
algorithm
);
for
(
Iterator
t
=
services
.
iterator
();
t
.
hasNext
();
)
{
Service
s
=
(
Service
)
t
.
next
();
List
<
Service
>
services
=
GetInstance
.
getServices
(
"TransformService"
,
algorithm
);
for
(
Iterator
<
Service
>
t
=
services
.
iterator
();
t
.
hasNext
();
)
{
Service
s
=
t
.
next
();
String
value
=
s
.
getAttribute
(
"MechanismType"
);
if
((
value
==
null
&&
dom
)
||
(
value
!=
null
&&
value
.
equals
(
mechanismType
)))
{
...
...
@@ -277,7 +277,7 @@ public abstract class TransformService implements Transform {
+
" mechanism not available"
);
}
private
static
class
MechanismMapEntry
implements
Map
.
Entry
{
private
static
class
MechanismMapEntry
implements
Map
.
Entry
<
String
,
String
>
{
private
final
String
mechanism
;
private
final
String
algorithm
;
private
final
String
key
;
...
...
@@ -290,19 +290,19 @@ public abstract class TransformService implements Transform {
if
(!(
o
instanceof
Map
.
Entry
))
{
return
false
;
}
Map
.
Entry
e
=
(
Map
.
Entry
)
o
;
Map
.
Entry
<?,?>
e
=
(
Map
.
Entry
<?,?>
)
o
;
return
(
getKey
()==
null
?
e
.
getKey
()==
null
:
getKey
().
equals
(
e
.
getKey
()))
&&
(
getValue
()==
null
?
e
.
getValue
()==
null
:
getValue
().
equals
(
e
.
getValue
()));
}
public
Object
getKey
()
{
public
String
getKey
()
{
return
key
;
}
public
Object
getValue
()
{
public
String
getValue
()
{
return
mechanism
;
}
public
Object
setValue
(
Object
value
)
{
public
String
setValue
(
String
value
)
{
throw
new
UnsupportedOperationException
();
}
public
int
hashCode
()
{
...
...
src/share/classes/javax/xml/crypto/dsig/XMLObject.java
浏览文件 @
75ee28e4
...
...
@@ -100,6 +100,7 @@ public interface XMLObject extends XMLStructure {
* @return an unmodifiable list of <code>XMLStructure</code>s (may be empty
* but never <code>null</code>)
*/
@SuppressWarnings
(
"rawtypes"
)
List
getContent
();
/**
...
...
src/share/classes/javax/xml/crypto/dsig/XMLSignature.java
浏览文件 @
75ee28e4
...
...
@@ -136,6 +136,7 @@ public interface XMLSignature extends XMLStructure {
* @return an unmodifiable list of <code>XMLObject</code>s (may be empty
* but never <code>null</code>)
*/
@SuppressWarnings
(
"rawtypes"
)
List
getObjects
();
/**
...
...
src/share/classes/javax/xml/crypto/dsig/XMLSignatureFactory.java
浏览文件 @
75ee28e4
...
...
@@ -365,6 +365,7 @@ public abstract class XMLSignatureFactory {
* @throws ClassCastException if any of the <code>objects</code> are not of
* type <code>XMLObject</code>
*/
@SuppressWarnings
(
"rawtypes"
)
public
abstract
XMLSignature
newXMLSignature
(
SignedInfo
si
,
KeyInfo
ki
,
List
objects
,
String
id
,
String
signatureValueId
);
...
...
@@ -398,6 +399,7 @@ public abstract class XMLSignatureFactory {
* compliant
* @throws NullPointerException if <code>dm</code> is <code>null</code>
*/
@SuppressWarnings
(
"rawtypes"
)
public
abstract
Reference
newReference
(
String
uri
,
DigestMethod
dm
,
List
transforms
,
String
type
,
String
id
);
...
...
@@ -428,6 +430,7 @@ public abstract class XMLSignatureFactory {
* @throws NullPointerException if <code>dm</code> or
* <code>digestValue</code> is <code>null</code>
*/
@SuppressWarnings
(
"rawtypes"
)
public
abstract
Reference
newReference
(
String
uri
,
DigestMethod
dm
,
List
transforms
,
String
type
,
String
id
,
byte
[]
digestValue
);
...
...
@@ -470,6 +473,7 @@ public abstract class XMLSignatureFactory {
* <code>appliedTransforms</code> or <code>result</code> is
* <code>null</code>
*/
@SuppressWarnings
(
"rawtypes"
)
public
abstract
Reference
newReference
(
String
uri
,
DigestMethod
dm
,
List
appliedTransforms
,
Data
result
,
List
transforms
,
String
type
,
String
id
);
...
...
@@ -489,6 +493,7 @@ public abstract class XMLSignatureFactory {
* @throws NullPointerException if any of the parameters
* are <code>null</code>
*/
@SuppressWarnings
(
"rawtypes"
)
public
abstract
SignedInfo
newSignedInfo
(
CanonicalizationMethod
cm
,
SignatureMethod
sm
,
List
references
);
...
...
@@ -507,6 +512,7 @@ public abstract class XMLSignatureFactory {
* @throws NullPointerException if <code>cm</code>, <code>sm</code>, or
* <code>references</code> are <code>null</code>
*/
@SuppressWarnings
(
"rawtypes"
)
public
abstract
SignedInfo
newSignedInfo
(
CanonicalizationMethod
cm
,
SignatureMethod
sm
,
List
references
,
String
id
);
...
...
@@ -524,6 +530,7 @@ public abstract class XMLSignatureFactory {
* @throws ClassCastException if <code>content</code> contains any
* entries that are not of type {@link XMLStructure}
*/
@SuppressWarnings
(
"rawtypes"
)
public
abstract
XMLObject
newXMLObject
(
List
content
,
String
id
,
String
mimeType
,
String
encoding
);
...
...
@@ -540,6 +547,7 @@ public abstract class XMLSignatureFactory {
* @throws ClassCastException if <code>references</code> contains any
* entries that are not of type {@link Reference}
*/
@SuppressWarnings
(
"rawtypes"
)
public
abstract
Manifest
newManifest
(
List
references
);
/**
...
...
@@ -556,6 +564,7 @@ public abstract class XMLSignatureFactory {
* @throws ClassCastException if <code>references</code> contains any
* entries that are not of type {@link Reference}
*/
@SuppressWarnings
(
"rawtypes"
)
public
abstract
Manifest
newManifest
(
List
references
,
String
id
);
/**
...
...
@@ -574,6 +583,7 @@ public abstract class XMLSignatureFactory {
* @throws ClassCastException if <code>content</code> contains any
* entries that are not of type {@link XMLStructure}
*/
@SuppressWarnings
(
"rawtypes"
)
public
abstract
SignatureProperty
newSignatureProperty
(
List
content
,
String
target
,
String
id
);
...
...
@@ -592,6 +602,7 @@ public abstract class XMLSignatureFactory {
* @throws ClassCastException if <code>properties</code> contains any
* entries that are not of type {@link SignatureProperty}
*/
@SuppressWarnings
(
"rawtypes"
)
public
abstract
SignatureProperties
newSignatureProperties
(
List
properties
,
String
id
);
...
...
src/share/classes/javax/xml/crypto/dsig/keyinfo/KeyInfo.java
浏览文件 @
75ee28e4
...
...
@@ -94,6 +94,7 @@ public interface KeyInfo extends XMLStructure {
* in this <code>KeyInfo</code>. Never returns <code>null</code> or an
* empty list.
*/
@SuppressWarnings
(
"rawtypes"
)
List
getContent
();
/**
...
...
src/share/classes/javax/xml/crypto/dsig/keyinfo/KeyInfoFactory.java
浏览文件 @
75ee28e4
...
...
@@ -305,6 +305,7 @@ public abstract class KeyInfoFactory {
* @throws ClassCastException if <code>content</code> contains any entries
* that are not of type {@link XMLStructure}
*/
@SuppressWarnings
(
"rawtypes"
)
public
abstract
KeyInfo
newKeyInfo
(
List
content
);
/**
...
...
@@ -324,6 +325,7 @@ public abstract class KeyInfoFactory {
* @throws ClassCastException if <code>content</code> contains any entries
* that are not of type {@link XMLStructure}
*/
@SuppressWarnings
(
"rawtypes"
)
public
abstract
KeyInfo
newKeyInfo
(
List
content
,
String
id
);
/**
...
...
@@ -385,6 +387,7 @@ public abstract class KeyInfoFactory {
* @throws ClassCastException if <code>other</code> contains any
* entries that are not of type {@link XMLStructure}
*/
@SuppressWarnings
(
"rawtypes"
)
public
abstract
PGPData
newPGPData
(
byte
[]
keyId
,
byte
[]
keyPacket
,
List
other
);
...
...
@@ -408,6 +411,7 @@ public abstract class KeyInfoFactory {
* @throws ClassCastException if <code>other</code> contains any
* entries that are not of type {@link XMLStructure}
*/
@SuppressWarnings
(
"rawtypes"
)
public
abstract
PGPData
newPGPData
(
byte
[]
keyPacket
,
List
other
);
/**
...
...
@@ -439,6 +443,7 @@ public abstract class KeyInfoFactory {
* @throws ClassCastException if <code>transforms</code> contains any
* entries that are not of type {@link Transform}
*/
@SuppressWarnings
(
"rawtypes"
)
public
abstract
RetrievalMethod
newRetrievalMethod
(
String
uri
,
String
type
,
List
transforms
);
...
...
@@ -464,6 +469,7 @@ public abstract class KeyInfoFactory {
* @throws ClassCastException if <code>content</code> contains any entries
* that are not of one of the valid types mentioned above
*/
@SuppressWarnings
(
"rawtypes"
)
public
abstract
X509Data
newX509Data
(
List
content
);
/**
...
...
src/share/classes/javax/xml/crypto/dsig/keyinfo/PGPData.java
浏览文件 @
75ee28e4
...
...
@@ -112,5 +112,6 @@ public interface PGPData extends XMLStructure {
* @return an unmodifiable list of <code>XMLStructure</code>s (may be
* empty, but never <code>null</code>)
*/
@SuppressWarnings
(
"rawtypes"
)
List
getExternalElements
();
}
src/share/classes/javax/xml/crypto/dsig/keyinfo/RetrievalMethod.java
浏览文件 @
75ee28e4
...
...
@@ -80,6 +80,7 @@ public interface RetrievalMethod extends URIReference, XMLStructure {
* @return an unmodifiable list of <code>Transform</code> objects (may be
* empty but never <code>null</code>).
*/
@SuppressWarnings
(
"rawtypes"
)
List
getTransforms
();
/**
...
...
src/share/classes/javax/xml/crypto/dsig/keyinfo/X509Data.java
浏览文件 @
75ee28e4
...
...
@@ -109,5 +109,6 @@ public interface X509Data extends XMLStructure {
* @return an unmodifiable list of the content in this <code>X509Data</code>
* (never <code>null</code> or empty)
*/
@SuppressWarnings
(
"rawtypes"
)
List
getContent
();
}
src/share/classes/javax/xml/crypto/dsig/spec/ExcC14NParameterSpec.java
浏览文件 @
75ee28e4
...
...
@@ -59,7 +59,7 @@ import java.util.List;
*/
public
final
class
ExcC14NParameterSpec
implements
C14NMethodParameterSpec
{
private
List
preList
;
private
List
<
String
>
preList
;
/**
* Indicates the default namespace ("#default").
...
...
@@ -71,7 +71,7 @@ public final class ExcC14NParameterSpec implements C14NMethodParameterSpec {
* list.
*/
public
ExcC14NParameterSpec
()
{
preList
=
Collections
.
EMPTY_LIST
;
preList
=
Collections
.
emptyList
()
;
}
/**
...
...
@@ -86,17 +86,22 @@ public final class ExcC14NParameterSpec implements C14NMethodParameterSpec {
* @throws ClassCastException if any of the entries in the list are not
* of type <code>String</code>
*/
@SuppressWarnings
(
"rawtypes"
)
public
ExcC14NParameterSpec
(
List
prefixList
)
{
if
(
prefixList
==
null
)
{
throw
new
NullPointerException
(
"prefixList cannot be null"
);
}
this
.
preList
=
new
ArrayList
(
prefixList
);
for
(
int
i
=
0
,
size
=
preList
.
size
();
i
<
size
;
i
++)
{
if
(!(
preList
.
get
(
i
)
instanceof
String
))
{
List
<?>
copy
=
new
ArrayList
<>((
List
<?>)
prefixList
);
for
(
int
i
=
0
,
size
=
copy
.
size
();
i
<
size
;
i
++)
{
if
(!(
copy
.
get
(
i
)
instanceof
String
))
{
throw
new
ClassCastException
(
"not a String"
);
}
}
preList
=
Collections
.
unmodifiableList
(
preList
);
@SuppressWarnings
(
"unchecked"
)
List
<
String
>
temp
=
(
List
<
String
>)
copy
;
preList
=
Collections
.
unmodifiableList
(
temp
);
}
/**
...
...
@@ -109,6 +114,7 @@ public final class ExcC14NParameterSpec implements C14NMethodParameterSpec {
* @return the inclusive namespace prefix list (may be empty but never
* <code>null</code>)
*/
@SuppressWarnings
(
"rawtypes"
)
public
List
getPrefixList
()
{
return
preList
;
}
...
...
src/share/classes/javax/xml/crypto/dsig/spec/XPathFilter2ParameterSpec.java
浏览文件 @
75ee28e4
...
...
@@ -46,7 +46,7 @@ import javax.xml.crypto.dsig.Transform;
*/
public
final
class
XPathFilter2ParameterSpec
implements
TransformParameterSpec
{
private
final
List
xPathList
;
private
final
List
<
XPathType
>
xPathList
;
/**
* Creates an <code>XPathFilter2ParameterSpec</code>.
...
...
@@ -59,11 +59,12 @@ public final class XPathFilter2ParameterSpec implements TransformParameterSpec {
* @throws NullPointerException if <code>xPathList</code> is
* <code>null</code>
*/
@SuppressWarnings
(
"rawtypes"
)
public
XPathFilter2ParameterSpec
(
List
xPathList
)
{
if
(
xPathList
==
null
)
{
throw
new
NullPointerException
(
"xPathList cannot be null"
);
}
List
xPathListCopy
=
new
ArrayList
(
xPathList
);
List
<?>
xPathListCopy
=
new
ArrayList
<>((
List
<?>)
xPathList
);
if
(
xPathListCopy
.
isEmpty
())
{
throw
new
IllegalArgumentException
(
"xPathList cannot be empty"
);
}
...
...
@@ -74,7 +75,11 @@ public final class XPathFilter2ParameterSpec implements TransformParameterSpec {
(
"xPathList["
+
i
+
"] is not a valid type"
);
}
}
this
.
xPathList
=
Collections
.
unmodifiableList
(
xPathListCopy
);
@SuppressWarnings
(
"unchecked"
)
List
<
XPathType
>
temp
=
(
List
<
XPathType
>)
xPathListCopy
;
this
.
xPathList
=
Collections
.
unmodifiableList
(
temp
);
}
/**
...
...
@@ -86,6 +91,7 @@ public final class XPathFilter2ParameterSpec implements TransformParameterSpec {
* @return a <code>List</code> of <code>XPathType</code> objects
* (never <code>null</code> or empty)
*/
@SuppressWarnings
(
"rawtypes"
)
public
List
getXPathList
()
{
return
xPathList
;
}
...
...
src/share/classes/javax/xml/crypto/dsig/spec/XPathFilterParameterSpec.java
浏览文件 @
75ee28e4
...
...
@@ -52,7 +52,7 @@ import java.util.Map.Entry;
public
final
class
XPathFilterParameterSpec
implements
TransformParameterSpec
{
private
String
xPath
;
private
Map
nsMap
;
private
Map
<
String
,
String
>
nsMap
;
/**
* Creates an <code>XPathFilterParameterSpec</code> with the specified
...
...
@@ -66,7 +66,7 @@ public final class XPathFilterParameterSpec implements TransformParameterSpec {
throw
new
NullPointerException
();
}
this
.
xPath
=
xPath
;
this
.
nsMap
=
Collections
.
EMPTY_MAP
;
this
.
nsMap
=
Collections
.
emptyMap
()
;
}
/**
...
...
@@ -83,21 +83,26 @@ public final class XPathFilterParameterSpec implements TransformParameterSpec {
* @throws ClassCastException if any of the map's keys or entries are not
* of type <code>String</code>
*/
@SuppressWarnings
(
"rawtypes"
)
public
XPathFilterParameterSpec
(
String
xPath
,
Map
namespaceMap
)
{
if
(
xPath
==
null
||
namespaceMap
==
null
)
{
throw
new
NullPointerException
();
}
this
.
xPath
=
xPath
;
nsMap
=
new
HashMap
(
namespaceMap
);
Iterator
entries
=
nsMap
.
entrySet
().
iterator
();
Map
<?,?>
copy
=
new
HashMap
<>((
Map
<?,?>)
namespaceMap
);
Iterator
<?
extends
Map
.
Entry
<?,?>>
entries
=
copy
.
entrySet
().
iterator
();
while
(
entries
.
hasNext
())
{
Map
.
Entry
me
=
(
Map
.
Entry
)
entries
.
next
();
Map
.
Entry
<?,?>
me
=
entries
.
next
();
if
(!(
me
.
getKey
()
instanceof
String
)
||
!(
me
.
getValue
()
instanceof
String
))
{
throw
new
ClassCastException
(
"not a String"
);
}
}
nsMap
=
Collections
.
unmodifiableMap
(
nsMap
);
@SuppressWarnings
(
"unchecked"
)
Map
<
String
,
String
>
temp
=
(
Map
<
String
,
String
>)
copy
;
nsMap
=
Collections
.
unmodifiableMap
(
temp
);
}
/**
...
...
@@ -120,6 +125,7 @@ public final class XPathFilterParameterSpec implements TransformParameterSpec {
* @return a <code>Map</code> of namespace prefixes to namespace URIs (may
* be empty, but never <code>null</code>)
*/
@SuppressWarnings
(
"rawtypes"
)
public
Map
getNamespaceMap
()
{
return
nsMap
;
}
...
...
src/share/classes/javax/xml/crypto/dsig/spec/XPathType.java
浏览文件 @
75ee28e4
...
...
@@ -106,7 +106,7 @@ public class XPathType {
private
final
String
expression
;
private
final
Filter
filter
;
private
Map
nsMap
;
private
Map
<
String
,
String
>
nsMap
;
/**
* Creates an <code>XPathType</code> instance with the specified XPath
...
...
@@ -127,7 +127,7 @@ public class XPathType {
}
this
.
expression
=
expression
;
this
.
filter
=
filter
;
this
.
nsMap
=
Collections
.
EMPTY_MAP
;
this
.
nsMap
=
Collections
.
emptyMap
()
;
}
/**
...
...
@@ -147,21 +147,26 @@ public class XPathType {
* @throws ClassCastException if any of the map's keys or entries are
* not of type <code>String</code>
*/
@SuppressWarnings
(
"rawtypes"
)
public
XPathType
(
String
expression
,
Filter
filter
,
Map
namespaceMap
)
{
this
(
expression
,
filter
);
if
(
namespaceMap
==
null
)
{
throw
new
NullPointerException
(
"namespaceMap cannot be null"
);
}
nsMap
=
new
HashMap
(
namespaceMap
);
Iterator
entries
=
nsMap
.
entrySet
().
iterator
();
Map
<?,?>
copy
=
new
HashMap
<>((
Map
<?,?>)
namespaceMap
);
Iterator
<?
extends
Map
.
Entry
<?,?>>
entries
=
copy
.
entrySet
().
iterator
();
while
(
entries
.
hasNext
())
{
Map
.
Entry
me
=
(
Map
.
Entry
)
entries
.
next
();
Map
.
Entry
<?,?>
me
=
entries
.
next
();
if
(!(
me
.
getKey
()
instanceof
String
)
||
!(
me
.
getValue
()
instanceof
String
))
{
throw
new
ClassCastException
(
"not a String"
);
}
}
nsMap
=
Collections
.
unmodifiableMap
(
nsMap
);
@SuppressWarnings
(
"unchecked"
)
Map
<
String
,
String
>
temp
=
(
Map
<
String
,
String
>)
copy
;
nsMap
=
Collections
.
unmodifiableMap
(
temp
);
}
/**
...
...
@@ -193,6 +198,7 @@ public class XPathType {
* @return a <code>Map</code> of namespace prefixes to namespace URIs
* (may be empty, but never <code>null</code>)
*/
@SuppressWarnings
(
"rawtypes"
)
public
Map
getNamespaceMap
()
{
return
nsMap
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录