Skip to content
Permalink
Browse files
Fixed some bugs found with find-bugs
  • Loading branch information
Don Samisa Abeysinghe committed Dec 22, 2010
1 parent e561049 commit fdfce9ca7ce9f6f91badb60273c31bce5765bbfe
Showing 16 changed files with 31 additions and 32 deletions.
@@ -42,8 +42,8 @@ public Assertion build(OMElement element, AssertionBuilderFactory factory) throw

OMAttribute isOptional = element.getAttribute(Constants.Q_ELEM_OPTIONAL_ATTR);
if (isOptional != null) {
signedEncryptedElements.setOptional((new Boolean(isOptional.getAttributeValue())
.booleanValue()));
signedEncryptedElements.setOptional(Boolean.valueOf(isOptional.getAttributeValue())
.booleanValue());
}

for (Iterator iterator = element.getChildElements(); iterator.hasNext();) {
@@ -52,8 +52,8 @@ public Assertion build(OMElement element, AssertionBuilderFactory factory) throw
OMAttribute isOptional = element
.getAttribute(Constants.Q_ELEM_OPTIONAL_ATTR);
if (isOptional != null) {
signedEncryptedParts.setOptional((new Boolean(isOptional
.getAttributeValue()).booleanValue()));
signedEncryptedParts.setOptional(Boolean.valueOf(isOptional
.getAttributeValue()).booleanValue());
}

return signedEncryptedParts;
@@ -43,8 +43,8 @@ public Assertion build(OMElement element, AssertionBuilderFactory factory) throw

OMAttribute isOptional = element.getAttribute(Constants.Q_ELEM_OPTIONAL_ATTR);
if (isOptional != null) {
signedEncryptedElements.setOptional((new Boolean(isOptional.getAttributeValue())
.booleanValue()));
signedEncryptedElements.setOptional(Boolean.valueOf(isOptional.getAttributeValue())
.booleanValue());
}

for (Iterator iterator = element.getChildElements(); iterator.hasNext();) {
@@ -36,8 +36,8 @@ public Assertion build(OMElement element, AssertionBuilderFactory factory) throw
SignedEncryptedParts signedEncryptedParts = new SignedEncryptedParts(true, SPConstants.SP_V11);
OMAttribute isOptional = element.getAttribute(Constants.Q_ELEM_OPTIONAL_ATTR);
if (isOptional != null) {
signedEncryptedParts.setOptional((new Boolean(isOptional.getAttributeValue())
.booleanValue()));
signedEncryptedParts.setOptional(Boolean.valueOf(isOptional.getAttributeValue())
.booleanValue());
}
for (Iterator iterator = element.getChildElements(); iterator.hasNext();) {
processElement((OMElement) iterator.next(), signedEncryptedParts);
@@ -55,8 +55,8 @@ public Assertion build(OMElement element, AssertionBuilderFactory factory)

OMAttribute isOptional = element.getAttribute(Constants.Q_ELEM_OPTIONAL_ATTR);
if (isOptional != null) {
supportingToken.setOptional((new Boolean(isOptional.getAttributeValue())
.booleanValue()));
supportingToken.setOptional(Boolean.valueOf(isOptional.getAttributeValue())
.booleanValue());
}

Policy policy = PolicyEngine.getPolicy(element.getFirstElement());
@@ -47,8 +47,8 @@ public Assertion build(OMElement element, AssertionBuilderFactory factory) throw

OMAttribute isOptional = element.getAttribute(Constants.Q_ELEM_OPTIONAL_ATTR);
if (isOptional != null) {
usernameToken.setOptional((new Boolean(isOptional.getAttributeValue())
.booleanValue()));
usernameToken.setOptional(Boolean.valueOf(isOptional.getAttributeValue())
.booleanValue());
}

OMElement policyElement = element.getFirstElement();
@@ -63,8 +63,8 @@ public Assertion build(OMElement element, AssertionBuilderFactory factory)

OMAttribute isOptional = element.getAttribute(Constants.Q_ELEM_OPTIONAL_ATTR);
if (isOptional != null) {
x509Token.setOptional((new Boolean(isOptional.getAttributeValue())
.booleanValue()));
x509Token.setOptional(Boolean.valueOf(isOptional.getAttributeValue())
.booleanValue());
}


@@ -47,8 +47,8 @@ public Assertion build(OMElement element, AssertionBuilderFactory factory) throw
OMAttribute isOptional = element
.getAttribute(Constants.Q_ELEM_OPTIONAL_ATTR);
if (isOptional != null) {
signedEncryptedElements.setOptional((new Boolean(isOptional
.getAttributeValue()).booleanValue()));
signedEncryptedElements.setOptional(Boolean.valueOf(isOptional
.getAttributeValue()).booleanValue());
}

return signedEncryptedElements;
@@ -52,8 +52,8 @@ public Assertion build(OMElement element, AssertionBuilderFactory factory) throw
OMAttribute isOptional = element
.getAttribute(Constants.Q_ELEM_OPTIONAL_ATTR);
if (isOptional != null) {
signedEncryptedParts.setOptional((new Boolean(isOptional
.getAttributeValue()).booleanValue()));
signedEncryptedParts.setOptional(Boolean.valueOf(isOptional
.getAttributeValue()).booleanValue());
}

return signedEncryptedParts;
@@ -44,8 +44,8 @@ public Assertion build(OMElement element, AssertionBuilderFactory factory) throw

OMAttribute isOptional = element.getAttribute(Constants.Q_ELEM_OPTIONAL_ATTR);
if (isOptional != null) {
signedEncryptedElements.setOptional((new Boolean(isOptional.getAttributeValue())
.booleanValue()));
signedEncryptedElements.setOptional(Boolean.valueOf(isOptional.getAttributeValue())
.booleanValue());
}

for (Iterator iterator = element.getChildElements(); iterator.hasNext();) {
@@ -41,8 +41,8 @@ public Assertion build(OMElement element, AssertionBuilderFactory factory) throw

OMAttribute isOptional = element.getAttribute(Constants.Q_ELEM_OPTIONAL_ATTR);
if (isOptional != null) {
signedEncryptedParts.setOptional((new Boolean(isOptional.getAttributeValue())
.booleanValue()));
signedEncryptedParts.setOptional(Boolean.valueOf(isOptional.getAttributeValue())
.booleanValue());
}

//presense of <sp:SignedParts/> enforces the requirement for sign body and all the header blocks
@@ -71,8 +71,8 @@ public Assertion build(OMElement element, AssertionBuilderFactory factory)

OMAttribute isOptional = element.getAttribute(Constants.Q_ELEM_OPTIONAL_ATTR);
if (isOptional != null) {
supportingToken.setOptional((new Boolean(isOptional.getAttributeValue())
.booleanValue()));
supportingToken.setOptional(Boolean.valueOf(isOptional.getAttributeValue())
.booleanValue());
}

Policy policy = PolicyEngine.getPolicy(element.getFirstElement());
@@ -47,8 +47,8 @@ public Assertion build(OMElement element, AssertionBuilderFactory factory) throw

OMAttribute isOptional = element.getAttribute(Constants.Q_ELEM_OPTIONAL_ATTR);
if (isOptional != null) {
usernameToken.setOptional((new Boolean(isOptional.getAttributeValue())
.booleanValue()));
usernameToken.setOptional(Boolean.valueOf(isOptional.getAttributeValue())
.booleanValue());
}

OMElement policyElement = element.getFirstElement();
@@ -62,8 +62,8 @@ public Assertion build(OMElement element, AssertionBuilderFactory factory)

OMAttribute isOptional = element.getAttribute(Constants.Q_ELEM_OPTIONAL_ATTR);
if (isOptional != null) {
x509Token.setOptional((new Boolean(isOptional.getAttributeValue())
.booleanValue()));
x509Token.setOptional(Boolean.valueOf(isOptional.getAttributeValue())
.booleanValue());
}

if (policyElement != null) {
@@ -917,7 +917,7 @@ public void setRstTemplate(OMElement rstTemplate) {
this.rstTemplate = rstTemplate;
}

private class CBHandler implements CallbackHandler {
private static class CBHandler implements CallbackHandler {

private String passwd;

@@ -456,10 +456,9 @@ private Subject createSubject(SAMLTokenIssuerConfig config,
x509CertElem.appendChild(base64CertText);
Element x509DataElem = doc.createElementNS(WSConstants.SIG_NS,
"ds:X509Data");
x509DataElem.appendChild(x509CertElem);



if (x509DataElem != null) {
x509DataElem.appendChild(x509CertElem);
keyInfoElem = doc.createElementNS(WSConstants.SIG_NS, "ds:KeyInfo");
((OMElement) x509DataElem).declareNamespace(
WSConstants.SIG_NS, WSConstants.SIG_PREFIX);

0 comments on commit fdfce9c

Please sign in to comment.