diff --git a/core/src/main/java/org/keycloak/KeycloakPrincipal.java b/core/src/main/java/org/keycloak/KeycloakPrincipal.java index e4aab9c71f..00848a2bc2 100755 --- a/core/src/main/java/org/keycloak/KeycloakPrincipal.java +++ b/core/src/main/java/org/keycloak/KeycloakPrincipal.java @@ -8,8 +8,8 @@ import java.security.Principal; * @version $Revision: 1 $ */ public class KeycloakPrincipal implements Principal, Serializable { - protected String name; - protected String surrogate; + protected final String name; + protected final String surrogate; public KeycloakPrincipal(String name, String surrogate) { this.name = name; diff --git a/core/src/main/java/org/keycloak/provider/ProviderFactoryLoader.java b/core/src/main/java/org/keycloak/provider/ProviderFactoryLoader.java index 798a88cc7c..8c3f62a262 100644 --- a/core/src/main/java/org/keycloak/provider/ProviderFactoryLoader.java +++ b/core/src/main/java/org/keycloak/provider/ProviderFactoryLoader.java @@ -11,7 +11,7 @@ import java.util.Set; */ public class ProviderFactoryLoader implements Iterable> { - private Map> factories = new HashMap>(); + private final Map> factories = new HashMap>(); private ProviderFactoryLoader(ServiceLoader serviceLoader) { for (ProviderFactory p : serviceLoader) { @@ -59,9 +59,9 @@ public class ProviderFactoryLoader implements Iterable implements ProviderFactory { - private volatile boolean initialized = false; + private final ProviderFactory factory; - private ProviderFactory factory; + private volatile boolean initialized = false; private LazyProviderFactory(ProviderFactory factory) { this.factory = factory; diff --git a/core/src/main/java/org/keycloak/util/ProviderLoader.java b/core/src/main/java/org/keycloak/util/ProviderLoader.java index 3685b4f89f..bed3304154 100644 --- a/core/src/main/java/org/keycloak/util/ProviderLoader.java +++ b/core/src/main/java/org/keycloak/util/ProviderLoader.java @@ -8,7 +8,7 @@ import java.util.ServiceLoader; */ public class ProviderLoader implements Iterable { - private ServiceLoader serviceLoader; + private final ServiceLoader serviceLoader; public static Iterable load(Class service) { ServiceLoader providers = ServiceLoader.load(service); @@ -26,7 +26,7 @@ public class ProviderLoader implements Iterable { private static class ProviderIterator implements Iterator { - private Iterator itr; + private final Iterator itr; private T next;