mirror of
https://github.com/keycloak/keycloak.git
synced 2026-04-28 02:55:54 -05:00
Adjusted null checks
Closes #40061 Signed-off-by: Anchels <mishtitov@gmail.com> Signed-off-by: Alexander Schwartz <aschwart@redhat.com> Co-authored-by: Alexander Schwartz <aschwart@redhat.com>
This commit is contained in:
+2
-2
@@ -252,7 +252,7 @@ public enum JBossSAMLConstants {
|
||||
String key = c.get();
|
||||
if ((old = m.put(key, c)) != null) {
|
||||
// System.out.println("WARNING: " + old);
|
||||
if (old != null && c.getAsQName().equals(old.getAsQName())) {
|
||||
if (c.getAsQName().equals(old.getAsQName())) {
|
||||
throw new IllegalStateException("Same name " + key + " used for two distinct constants: " + c + ", " + old);
|
||||
}
|
||||
m.put(key, null);
|
||||
@@ -322,4 +322,4 @@ public enum JBossSAMLConstants {
|
||||
final JBossSAMLConstants res = REVERSE_LOOKUP.from(name);
|
||||
return res == null ? UNKNOWN_VALUE : res;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -385,7 +385,7 @@ public class TransformerUtil {
|
||||
if (prefix != null && ! prefix.isEmpty())
|
||||
qual = (localPart != null && ! localPart.isEmpty()) ? prefix + ":" + localPart : prefix;
|
||||
|
||||
if (qual.equals("xmlns"))
|
||||
if ("xmlns".equals(qual))
|
||||
continue;
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("Set Attribute Namespace=" + name.getNamespaceURI() + "::Qual=:" + qual + "::Value="
|
||||
|
||||
+1
-1
@@ -229,11 +229,11 @@ public class BaseWriter {
|
||||
|
||||
StaxUtil.writeNameSpace(writer, JBossSAMLURIConstants.XSI_PREFIX.get(), JBossSAMLURIConstants.XSI_NSURI.get());
|
||||
StaxUtil.writeNameSpace(writer, "xs", JBossSAMLURIConstants.XMLSCHEMA_NSURI.get());
|
||||
StaxUtil.writeAttribute(writer, "xsi", JBossSAMLURIConstants.XSI_NSURI.get(), "type", "xs:" + attributeValue.getXMLSchemaType().getLocalPart());
|
||||
|
||||
if (attributeValue == null) {
|
||||
StaxUtil.writeAttribute(writer, "xsi", JBossSAMLURIConstants.XSI_NSURI.get(), "nil", "true");
|
||||
} else {
|
||||
StaxUtil.writeAttribute(writer, "xsi", JBossSAMLURIConstants.XSI_NSURI.get(), "type", "xs:" + attributeValue.getXMLSchemaType().getLocalPart());
|
||||
StaxUtil.writeCharacters(writer, attributeValue.toString());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user