hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From szets...@apache.org
Subject svn commit: r1163456 - in /hadoop/common/trunk/hadoop-common-project: hadoop-auth/src/main/java/org/apache/hadoop/alfredo/client/ hadoop-auth/src/main/java/org/apache/hadoop/alfredo/server/ hadoop-auth/src/test/java/org/apache/hadoop/alfredo/client/ ha...
Date Wed, 31 Aug 2011 00:18:56 GMT
Author: szetszwo
Date: Wed Aug 31 00:18:55 2011
New Revision: 1163456

URL: http://svn.apache.org/viewvc?rev=1163456&view=rev
Log:
HADOOP-7576. Fix findbugs warnings and javac warnings in hadoop-auth.

Modified:
    hadoop/common/trunk/hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/alfredo/client/KerberosAuthenticator.java
    hadoop/common/trunk/hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/alfredo/server/AuthenticationFilter.java
    hadoop/common/trunk/hadoop-common-project/hadoop-auth/src/test/java/org/apache/hadoop/alfredo/client/AuthenticatorTestCase.java
    hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt

Modified: hadoop/common/trunk/hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/alfredo/client/KerberosAuthenticator.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/alfredo/client/KerberosAuthenticator.java?rev=1163456&r1=1163455&r2=1163456&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/alfredo/client/KerberosAuthenticator.java
(original)
+++ hadoop/common/trunk/hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/alfredo/client/KerberosAuthenticator.java
Wed Aug 31 00:18:55 2011
@@ -48,17 +48,17 @@ public class KerberosAuthenticator imple
   /**
    * HTTP header used by the SPNEGO server endpoint during an authentication sequence.
    */
-  public static String WWW_AUTHENTICATE = "WWW-Authenticate";
+  public static final String WWW_AUTHENTICATE = "WWW-Authenticate";
 
   /**
    * HTTP header used by the SPNEGO client endpoint during an authentication sequence.
    */
-  public static String AUTHORIZATION = "Authorization";
+  public static final String AUTHORIZATION = "Authorization";
 
   /**
    * HTTP header prefix used by the SPNEGO client/server endpoints during an authentication
sequence.
    */
-  public static String NEGOTIATE = "Negotiate";
+  public static final String NEGOTIATE = "Negotiate";
 
   private static final String AUTH_HTTP_METHOD = "OPTIONS";
 

Modified: hadoop/common/trunk/hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/alfredo/server/AuthenticationFilter.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/alfredo/server/AuthenticationFilter.java?rev=1163456&r1=1163455&r2=1163456&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/alfredo/server/AuthenticationFilter.java
(original)
+++ hadoop/common/trunk/hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/alfredo/server/AuthenticationFilter.java
Wed Aug 31 00:18:55 2011
@@ -103,6 +103,8 @@ public class AuthenticationFilter implem
    */
   public static final String COOKIE_PATH = "cookie.path";
 
+  private static final Random RAN = new Random();
+
   private Signer signer;
   private AuthenticationHandler authHandler;
   private boolean randomSecret;
@@ -139,7 +141,7 @@ public class AuthenticationFilter implem
     }
 
     try {
-      Class klass = Thread.currentThread().getContextClassLoader().loadClass(authHandlerClassName);
+      Class<?> klass = Thread.currentThread().getContextClassLoader().loadClass(authHandlerClassName);
       authHandler = (AuthenticationHandler) klass.newInstance();
       authHandler.init(config);
     } catch (ClassNotFoundException ex) {
@@ -151,7 +153,7 @@ public class AuthenticationFilter implem
     }
     String signatureSecret = config.getProperty(configPrefix + SIGNATURE_SECRET);
     if (signatureSecret == null) {
-      signatureSecret = Long.toString(new Random(System.currentTimeMillis()).nextLong());
+      signatureSecret = Long.toString(RAN.nextLong());
       randomSecret = true;
       LOG.warn("'signature.secret' configuration not set, using a random value as secret");
     }
@@ -237,7 +239,7 @@ public class AuthenticationFilter implem
    */
   protected Properties getConfiguration(String configPrefix, FilterConfig filterConfig) throws
ServletException {
     Properties props = new Properties();
-    Enumeration names = filterConfig.getInitParameterNames();
+    Enumeration<?> names = filterConfig.getInitParameterNames();
     while (names.hasMoreElements()) {
       String name = (String) names.nextElement();
       if (name.startsWith(configPrefix)) {

Modified: hadoop/common/trunk/hadoop-common-project/hadoop-auth/src/test/java/org/apache/hadoop/alfredo/client/AuthenticatorTestCase.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-common-project/hadoop-auth/src/test/java/org/apache/hadoop/alfredo/client/AuthenticatorTestCase.java?rev=1163456&r1=1163455&r2=1163456&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-common-project/hadoop-auth/src/test/java/org/apache/hadoop/alfredo/client/AuthenticatorTestCase.java
(original)
+++ hadoop/common/trunk/hadoop-common-project/hadoop-auth/src/test/java/org/apache/hadoop/alfredo/client/AuthenticatorTestCase.java
Wed Aug 31 00:18:55 2011
@@ -57,6 +57,7 @@ public abstract class AuthenticatorTestC
     }
   }
 
+  @SuppressWarnings("serial")
   public static class TestServlet extends HttpServlet {
 
     @Override

Modified: hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt?rev=1163456&r1=1163455&r2=1163456&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt (original)
+++ hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt Wed Aug 31 00:18:55
2011
@@ -533,6 +533,9 @@ Release 0.23.0 - Unreleased
     HADOOP-7560. Change src layout to be heirarchical. (Alejandro Abdelnur
     via acmurthy)
 
+    HADOOP-7576. Fix findbugs warnings and javac warnings in hadoop-auth.
+    (szetszwo)
+
 Release 0.22.0 - Unreleased
 
   INCOMPATIBLE CHANGES



Mime
View raw message