directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject [3/5] directory-kerby git commit: Checkstyle: fix ConstantName check
Date Sat, 04 Jul 2015 12:08:36 GMT
Checkstyle: fix ConstantName check


Project: http://git-wip-us.apache.org/repos/asf/directory-kerby/repo
Commit: http://git-wip-us.apache.org/repos/asf/directory-kerby/commit/10bc3af2
Tree: http://git-wip-us.apache.org/repos/asf/directory-kerby/tree/10bc3af2
Diff: http://git-wip-us.apache.org/repos/asf/directory-kerby/diff/10bc3af2

Branch: refs/heads/master
Commit: 10bc3af2bb374eaf1bb40f58dc0d1da4dcd0b2be
Parents: 7cbd366
Author: Stefan Seelmann <mail@stefan-seelmann.de>
Authored: Sat Jul 4 00:59:31 2015 +0200
Committer: Stefan Seelmann <mail@stefan-seelmann.de>
Committed: Sat Jul 4 14:06:04 2015 +0200

----------------------------------------------------------------------
 .../kerby/kerberos/kerb/client/ClientUtil.java    | 12 ++++++------
 .../kerberos/kerb/common/EncryptionUtil.java      | 18 +++++++++---------
 .../kerb/identity/backend/BackendTest.java        |  4 ++--
 .../kerby/kerberos/kerb/server/KdcTestBase.java   |  4 ++--
 .../kerby/kerberos/kerb/server/TestKdcServer.java |  8 ++++----
 .../main/java/org/apache/kerby/config/Conf.java   |  4 ++--
 .../org/apache/kerby/config/XmlConfigLoader.java  |  6 +++---
 7 files changed, 28 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/10bc3af2/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/ClientUtil.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/ClientUtil.java
b/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/ClientUtil.java
index cface81..97d51fe 100644
--- a/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/ClientUtil.java
+++ b/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/ClientUtil.java
@@ -30,16 +30,16 @@ import java.util.Map;
 public final class ClientUtil {
     private ClientUtil() {}
 
-    private final static String krb5FileName = "krb5.conf";
-    private final static String krb5EnvName = "KRB5_CONFIG";
+    private final static String KRB5_FILE_NAME = "krb5.conf";
+    private final static String KRB5_ENV_NAME = "KRB5_CONFIG";
 
     /**
      * Load krb5.conf from specified conf dir.
      */
     public static KrbConfig getConfig(File confDir) throws KrbException {
-        File confFile = new File(confDir, krb5FileName);
+        File confFile = new File(confDir, KRB5_FILE_NAME);
         if (!confFile.exists()) {
-            throw new KrbException(krb5FileName + " not found");
+            throw new KrbException(KRB5_FILE_NAME + " not found");
         }
 
         if (confFile != null && confFile.exists()) {
@@ -66,7 +66,7 @@ public final class ClientUtil {
 
         try {
             Map<String, String> mapEnv = System.getenv();
-            tmpEnv = mapEnv.get(krb5EnvName);
+            tmpEnv = mapEnv.get(KRB5_ENV_NAME);
         } catch (SecurityException e) {
             tmpEnv = null;
         }
@@ -74,7 +74,7 @@ public final class ClientUtil {
             confFile = new File(tmpEnv);
             if (!confFile.exists()) {
                 throw new KrbException("krb5 conf not found. Invalid env "
-                        + krb5EnvName);
+                        + KRB5_ENV_NAME);
             }
         } else {
             confDir = new File("/etc/"); // for Linux. TODO: fix for Win etc.

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/10bc3af2/kerby-kerb/kerb-common/src/main/java/org/apache/kerby/kerberos/kerb/common/EncryptionUtil.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-common/src/main/java/org/apache/kerby/kerberos/kerb/common/EncryptionUtil.java
b/kerby-kerb/kerb-common/src/main/java/org/apache/kerby/kerberos/kerb/common/EncryptionUtil.java
index 9fa41ff..bb81227 100644
--- a/kerby-kerb/kerb-common/src/main/java/org/apache/kerby/kerberos/kerb/common/EncryptionUtil.java
+++ b/kerby-kerb/kerb-common/src/main/java/org/apache/kerby/kerberos/kerb/common/EncryptionUtil.java
@@ -41,22 +41,22 @@ public class EncryptionUtil {
      * an order preserved map containing cipher names to the corresponding algorithm
      * names in the descending order of strength
      */
-    private static final Map<String, String> cipherAlgoMap = new LinkedHashMap<String,
String>();
+    private static final Map<String, String> CIPHER_ALGO_MAP = new LinkedHashMap<String,
String>();
 
     static {
-        cipherAlgoMap.put("rc4", "ArcFourHmac");
-        cipherAlgoMap.put("aes256", "AES256");
-        cipherAlgoMap.put("aes128", "AES128");
-        cipherAlgoMap.put("des3", "DESede");
-        cipherAlgoMap.put("des", "DES");
+        CIPHER_ALGO_MAP.put("rc4", "ArcFourHmac");
+        CIPHER_ALGO_MAP.put("aes256", "AES256");
+        CIPHER_ALGO_MAP.put("aes128", "AES128");
+        CIPHER_ALGO_MAP.put("des3", "DESede");
+        CIPHER_ALGO_MAP.put("des", "DES");
     }
 
     public static String getAlgoNameFromEncType(EncryptionType encType) {
         String cipherName = encType.getName().toLowerCase();
 
-        for (String c : cipherAlgoMap.keySet()) {
+        for (String c : CIPHER_ALGO_MAP.keySet()) {
             if (cipherName.startsWith(c)) {
-                return cipherAlgoMap.get(c);
+                return CIPHER_ALGO_MAP.get(c);
             }
         }
 
@@ -72,7 +72,7 @@ public class EncryptionUtil {
     public static List<EncryptionType> orderEtypesByStrength(List<EncryptionType>
etypes) {
         List<EncryptionType> ordered = new ArrayList<>(etypes.size());
 
-        for (String algo : cipherAlgoMap.values()) {
+        for (String algo : CIPHER_ALGO_MAP.values()) {
             for (EncryptionType encType : etypes) {
                 String foundAlgo = getAlgoNameFromEncType(encType);
 

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/10bc3af2/kerby-kerb/kerb-identity-test/src/test/java/org/apache/kerby/kerberos/kerb/identity/backend/BackendTest.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-identity-test/src/test/java/org/apache/kerby/kerberos/kerb/identity/backend/BackendTest.java
b/kerby-kerb/kerb-identity-test/src/test/java/org/apache/kerby/kerberos/kerb/identity/backend/BackendTest.java
index 8361eac..0dc6035 100644
--- a/kerby-kerb/kerb-identity-test/src/test/java/org/apache/kerby/kerberos/kerb/identity/backend/BackendTest.java
+++ b/kerby-kerb/kerb-identity-test/src/test/java/org/apache/kerby/kerberos/kerb/identity/backend/BackendTest.java
@@ -39,7 +39,7 @@ public abstract class BackendTest {
 
     static final String TEST_PRINCIPAL = "test@EXAMPLE.COM";
 
-    static final EncryptionType[] encTypes = new EncryptionType[]{
+    static final EncryptionType[] ENC_TYPES = new EncryptionType[]{
             EncryptionType.AES128_CTS,
             EncryptionType.DES3_CBC_SHA1_KD
     };
@@ -173,7 +173,7 @@ public abstract class BackendTest {
     }
 
     protected List<EncryptionType> getEncryptionTypes() {
-        return Arrays.asList(encTypes);
+        return Arrays.asList(ENC_TYPES);
     }
 
     protected void cleanIdentities(IdentityBackend backend) {

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/10bc3af2/kerby-kerb/kerb-kdc-test/src/test/java/org/apache/kerby/kerberos/kerb/server/KdcTestBase.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-kdc-test/src/test/java/org/apache/kerby/kerberos/kerb/server/KdcTestBase.java
b/kerby-kerb/kerb-kdc-test/src/test/java/org/apache/kerby/kerberos/kerb/server/KdcTestBase.java
index 06fd502..65d9d07 100644
--- a/kerby-kerb/kerb-kdc-test/src/test/java/org/apache/kerby/kerberos/kerb/server/KdcTestBase.java
+++ b/kerby-kerb/kerb-kdc-test/src/test/java/org/apache/kerby/kerberos/kerb/server/KdcTestBase.java
@@ -36,10 +36,10 @@ public abstract class KdcTestBase {
     private final String hostname = "localhost";
     private final String clientPrincipalName = "drankye";
     private final String clientPrincipal =
-            clientPrincipalName + "@" + TestKdcServer.kdcRealm;
+            clientPrincipalName + "@" + TestKdcServer.KDC_REALM;
     private final String serverPrincipalName = "test-service";
     private final String serverPrincipal =
-            serverPrincipalName + "/" + hostname + "@" + TestKdcServer.kdcRealm;
+            serverPrincipalName + "/" + hostname + "@" + TestKdcServer.KDC_REALM;
 
     private SimpleKdcServer kdcServer;
 

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/10bc3af2/kerby-kerb/kerb-kdc-test/src/test/java/org/apache/kerby/kerberos/kerb/server/TestKdcServer.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-kdc-test/src/test/java/org/apache/kerby/kerberos/kerb/server/TestKdcServer.java
b/kerby-kerb/kerb-kdc-test/src/test/java/org/apache/kerby/kerberos/kerb/server/TestKdcServer.java
index 4395f4b..54fbcae 100644
--- a/kerby-kerb/kerb-kdc-test/src/test/java/org/apache/kerby/kerberos/kerb/server/TestKdcServer.java
+++ b/kerby-kerb/kerb-kdc-test/src/test/java/org/apache/kerby/kerberos/kerb/server/TestKdcServer.java
@@ -26,14 +26,14 @@ import org.apache.kerby.kerberos.kerb.client.KrbConfigKey;
 import org.apache.kerby.util.NetworkUtil;
 
 public class TestKdcServer extends SimpleKdcServer {
-    public final static String kdcRealm = "TEST.COM";
-    public final static String hostname = "localhost";
+    public final static String KDC_REALM = "TEST.COM";
+    public final static String HOSTNAME = "localhost";
 
     public TestKdcServer(boolean allowTcp, boolean allowUdp) throws KrbException {
         super();
 
-        setKdcRealm(kdcRealm);
-        setKdcHost(hostname);
+        setKdcRealm(KDC_REALM);
+        setKdcHost(HOSTNAME);
         setAllowTcp(allowTcp);
         setAllowUdp(allowUdp);
 

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/10bc3af2/lib/kerby-config/src/main/java/org/apache/kerby/config/Conf.java
----------------------------------------------------------------------
diff --git a/lib/kerby-config/src/main/java/org/apache/kerby/config/Conf.java b/lib/kerby-config/src/main/java/org/apache/kerby/config/Conf.java
index 6e2a004..7edfdef 100644
--- a/lib/kerby-config/src/main/java/org/apache/kerby/config/Conf.java
+++ b/lib/kerby-config/src/main/java/org/apache/kerby/config/Conf.java
@@ -27,7 +27,7 @@ import java.io.IOException;
 import java.util.*;
 
 public class Conf implements Config {
-    private static final Logger logger = LoggerFactory.getLogger(Conf.class);
+    private static final Logger LOGGER = LoggerFactory.getLogger(Conf.class);
 
     private List<ConfigLoader> resourceConfigs;
     private final ConfigImpl config;
@@ -80,7 +80,7 @@ public class Conf implements Config {
         try {
             loader = loaderClass.newInstance();
         } catch (Exception e) {
-            logger.error("Failed to create " + Conf.class.getPackage().getName() + " for
" + loaderClass.getName(), e);
+            LOGGER.error("Failed to create " + Conf.class.getPackage().getName() + " for
" + loaderClass.getName(), e);
             throw new RuntimeException("Failed to create " + Conf.class.getPackage().getName()
+ " for " + loaderClass.getName(), e);
         }
         loader.setResource(resource);

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/10bc3af2/lib/kerby-config/src/main/java/org/apache/kerby/config/XmlConfigLoader.java
----------------------------------------------------------------------
diff --git a/lib/kerby-config/src/main/java/org/apache/kerby/config/XmlConfigLoader.java b/lib/kerby-config/src/main/java/org/apache/kerby/config/XmlConfigLoader.java
index 786ac1d..feab854 100644
--- a/lib/kerby-config/src/main/java/org/apache/kerby/config/XmlConfigLoader.java
+++ b/lib/kerby-config/src/main/java/org/apache/kerby/config/XmlConfigLoader.java
@@ -30,7 +30,7 @@ import java.util.ArrayList;
 import java.util.List;
 
 public class XmlConfigLoader extends ConfigLoader {
-    private static final Logger logger = LoggerFactory.getLogger(Config.class);
+    private static final Logger LOGGER = LoggerFactory.getLogger(Config.class);
 
     @Override
     protected void loadConfig(ConfigImpl config, Resource resource) throws Exception {
@@ -46,7 +46,7 @@ public class XmlConfigLoader extends ConfigLoader {
         try {
             docBuilderFactory.setXIncludeAware(true);
         } catch (UnsupportedOperationException e) {
-            logger.error("Failed to set setXIncludeAware(true) for parser", e);
+            LOGGER.error("Failed to set setXIncludeAware(true) for parser", e);
         }
         DocumentBuilder builder = docBuilderFactory.newDocumentBuilder();
         InputStream is = (InputStream) resource.getResource();
@@ -69,7 +69,7 @@ public class XmlConfigLoader extends ConfigLoader {
         if ("config".equals(root.getTagName())) {
             valid = true;
         } else {
-            logger.error("bad conf element: top-level element not <configuration>");
+            LOGGER.error("bad conf element: top-level element not <configuration>");
         }
 
         return valid;


Mime
View raw message