KEYCLOAK-12201 Use diamond operator for collections in module "saml-core"
This commit is contained in:
parent
bc7d7ad754
commit
ca46c7f718
8 changed files with 17 additions and 17 deletions
|
@ -66,7 +66,7 @@ public class SAMLParser extends AbstractParser {
|
|||
private interface ParserFactory {
|
||||
public StaxParser create();
|
||||
}
|
||||
private static final Map<QName, ParserFactory> PARSERS = new HashMap<QName, ParserFactory>();
|
||||
private static final Map<QName, ParserFactory> PARSERS = new HashMap<>();
|
||||
|
||||
static {
|
||||
PARSERS.put(SAML_11_ASSERTION, new ParserFactory() { @Override public StaxParser create() { return new SAML11AssertionParser(); }});
|
||||
|
|
|
@ -127,7 +127,7 @@ public enum X500SAMLProfileConstants {
|
|||
private String friendlyName = null;
|
||||
private String uri = null;
|
||||
|
||||
private static final Map<String, String> lookup = new HashMap<String, String>();
|
||||
private static final Map<String, String> lookup = new HashMap<>();
|
||||
|
||||
static {
|
||||
for (X500SAMLProfileConstants s : EnumSet.allOf(X500SAMLProfileConstants.class))
|
||||
|
|
|
@ -480,7 +480,7 @@ public class AssertionUtil {
|
|||
* @return
|
||||
*/
|
||||
public static List<String> getRoles(AssertionType assertion, List<String> roleKeys) {
|
||||
List<String> roles = new ArrayList<String>();
|
||||
List<String> roles = new ArrayList<>();
|
||||
Set<StatementAbstractType> statements = assertion.getStatements();
|
||||
for (StatementAbstractType statement : statements) {
|
||||
if (statement instanceof AttributeStatementType) {
|
||||
|
@ -519,7 +519,7 @@ public class AssertionUtil {
|
|||
* @return
|
||||
*/
|
||||
public static List<String> getRoles(SAML11AssertionType assertion, List<String> roleKeys) {
|
||||
List<String> roles = new ArrayList<String>();
|
||||
List<String> roles = new ArrayList<>();
|
||||
List<SAML11StatementAbstractType> statements = assertion.getStatements();
|
||||
for (SAML11StatementAbstractType statement : statements) {
|
||||
if (statement instanceof SAML11AttributeStatementType) {
|
||||
|
|
|
@ -192,10 +192,10 @@ public class StatementUtil {
|
|||
}
|
||||
|
||||
public static Map<String, Object> asMap(Set<AttributeStatementType> attributeStatementTypes) {
|
||||
Map<String, Object> attrMap = new HashMap<String, Object>();
|
||||
Map<String, Object> attrMap = new HashMap<>();
|
||||
|
||||
if (attributeStatementTypes != null && !attributeStatementTypes.isEmpty()) {
|
||||
attrMap = new HashMap<String, Object>();
|
||||
attrMap = new HashMap<>();
|
||||
|
||||
for (StatementAbstractType statement : attributeStatementTypes) {
|
||||
if (statement instanceof AttributeStatementType) {
|
||||
|
|
|
@ -155,7 +155,7 @@ public class BaseWriter {
|
|||
// Take care of other attributes such as x500:encoding
|
||||
Map<QName, String> otherAttribs = attributeType.getOtherAttributes();
|
||||
if (otherAttribs != null) {
|
||||
List<String> nameSpacesDealt = new ArrayList<String>();
|
||||
List<String> nameSpacesDealt = new ArrayList<>();
|
||||
|
||||
Iterator<QName> keySet = otherAttribs.keySet().iterator();
|
||||
while (keySet != null && keySet.hasNext()) {
|
||||
|
|
|
@ -109,7 +109,7 @@ public class IDFedLSInputResolver implements LSResourceResolver {
|
|||
}
|
||||
|
||||
public static Collection<String> schemas() {
|
||||
Collection<String> schemaValues = new HashSet<String>(schemaLocationMap.values());
|
||||
Collection<String> schemaValues = new HashSet<>(schemaLocationMap.values());
|
||||
schemaValues.remove("schema/w3c/xmlschema/datatypes.dtd");
|
||||
schemaValues.remove("schema/w3c/xmlschema/XMLSchema.dtd");
|
||||
logger.info("Considered the schemas:" + schemaValues);
|
||||
|
|
|
@ -36,7 +36,7 @@ import java.util.Map;
|
|||
|
||||
public class NamespaceContext implements javax.xml.namespace.NamespaceContext {
|
||||
|
||||
private Map<String, String> nsMap = new HashMap<String, String>();
|
||||
private Map<String, String> nsMap = new HashMap<>();
|
||||
|
||||
public NamespaceContext() {
|
||||
}
|
||||
|
|
|
@ -28,28 +28,28 @@ import java.util.List;
|
|||
public class SchemaManagerUtil {
|
||||
|
||||
public static List<String> getXMLSchemas() {
|
||||
List<String> list = new ArrayList<String>();
|
||||
List<String> list = new ArrayList<>();
|
||||
|
||||
list.add("schema/w3c/xmlschema/xml.xsd");
|
||||
return list;
|
||||
}
|
||||
|
||||
public static List<String> getXMLDSig() {
|
||||
List<String> list = new ArrayList<String>();
|
||||
List<String> list = new ArrayList<>();
|
||||
|
||||
list.add("schema/w3c/xmldsig/xmldsig-core-schema.xsd");
|
||||
return list;
|
||||
}
|
||||
|
||||
public static List<String> getXMLEnc() {
|
||||
List<String> list = new ArrayList<String>();
|
||||
List<String> list = new ArrayList<>();
|
||||
|
||||
list.add("schema/w3c/xmlenc/xenc-schema.xsd");
|
||||
return list;
|
||||
}
|
||||
|
||||
public static List<String> getXACMLSchemas() {
|
||||
List<String> list = new ArrayList<String>();
|
||||
List<String> list = new ArrayList<>();
|
||||
|
||||
list.add("schema/xacml/access_control-xacml-2.0-policy-schema-os.xsd");
|
||||
list.add("schema/xacml/access_control-xacml-2.0-context-schema-os.xsd");
|
||||
|
@ -57,7 +57,7 @@ public class SchemaManagerUtil {
|
|||
}
|
||||
|
||||
public static List<String> getSAML2Schemas() {
|
||||
List<String> list = new ArrayList<String>();
|
||||
List<String> list = new ArrayList<>();
|
||||
|
||||
list.add("schema/saml/v2/saml-schema-assertion-2.0.xsd");
|
||||
list.add("schema/saml/v2/saml-schema-protocol-2.0.xsd");
|
||||
|
@ -72,7 +72,7 @@ public class SchemaManagerUtil {
|
|||
}
|
||||
|
||||
public static List<String> getSAML11Schemas() {
|
||||
List<String> list = new ArrayList<String>();
|
||||
List<String> list = new ArrayList<>();
|
||||
|
||||
list.add("schema/saml/v1/saml-schema-assertion-1.0.xsd");
|
||||
list.add("schema/saml/v1/oasis-sstc-saml-schema-assertion-1.1.xsd");
|
||||
|
@ -81,7 +81,7 @@ public class SchemaManagerUtil {
|
|||
}
|
||||
|
||||
public static List<String> getWSTrustSchemas() {
|
||||
List<String> list = new ArrayList<String>();
|
||||
List<String> list = new ArrayList<>();
|
||||
|
||||
list.add("schema/wstrust/v1_3/ws-trust-1.3.xsd");
|
||||
list.add("schema/wstrust/v1_3/oasis-200401-wss-wssecurity-secext-1.0.xsd");
|
||||
|
@ -92,7 +92,7 @@ public class SchemaManagerUtil {
|
|||
}
|
||||
|
||||
public static List<String> getSchemas() {
|
||||
List<String> list = new ArrayList<String>();
|
||||
List<String> list = new ArrayList<>();
|
||||
list.addAll(getXMLSchemas());
|
||||
list.addAll(getXMLDSig());
|
||||
list.addAll(getXMLEnc());
|
||||
|
|
Loading…
Reference in a new issue