You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by vi...@apache.org on 2013/03/13 16:31:24 UTC

svn commit: r1456005 - in /accumulo/trunk/core: ./ src/main/java/org/apache/accumulo/core/security/handler/Authenticator.java src/main/java/org/apache/accumulo/core/security/handler/ZKAuthenticator.java

Author: vines
Date: Wed Mar 13 15:31:24 2013
New Revision: 1456005

URL: http://svn.apache.org/r1456005
Log:
ACCUMULO-1159 - Fixes exception on all token prompts



Modified:
    accumulo/trunk/core/   (props changed)
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/security/handler/Authenticator.java
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/security/handler/ZKAuthenticator.java

Propchange: accumulo/trunk/core/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5/core:r1455321-1455613,1455615-1455640,1455642-1455983,1455985-1456003

Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/security/handler/Authenticator.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/security/handler/Authenticator.java?rev=1456005&r1=1456004&r2=1456005&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/security/handler/Authenticator.java (original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/security/handler/Authenticator.java Wed Mar 13 15:31:24 2013
@@ -28,7 +28,7 @@ public interface Authenticator {
   
   public List<Set<AuthProperty>> getProperties();
   
-  public class AuthProperty {
+  public class AuthProperty implements Comparable<AuthProperty>{
     private String key, description;
     private boolean masked;
     
@@ -53,5 +53,20 @@ public interface Authenticator {
     public boolean getMask() {
       return this.masked;
     }
+    
+    public int hashCode() {
+      return key.hashCode();
+    }
+    
+    public boolean equals(Object o) {
+      if (o instanceof AuthProperty)
+        return ((AuthProperty) o).key.equals(key);
+      return false;
+    }
+
+    @Override
+    public int compareTo(AuthProperty o) {
+      return key.compareTo(o.key);
+    }
   }
 }

Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/security/handler/ZKAuthenticator.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/security/handler/ZKAuthenticator.java?rev=1456005&r1=1456004&r2=1456005&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/security/handler/ZKAuthenticator.java (original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/security/handler/ZKAuthenticator.java Wed Mar 13 15:31:24 2013
@@ -16,11 +16,11 @@
  */
 package org.apache.accumulo.core.security.handler;
 
+import java.util.LinkedHashSet;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Properties;
 import java.util.Set;
-import java.util.TreeSet;
 
 import org.apache.accumulo.core.client.AccumuloSecurityException;
 import org.apache.accumulo.core.client.impl.thrift.SecurityErrorCode;
@@ -45,7 +45,7 @@ public class ZKAuthenticator implements 
   @Override
   public List<Set<AuthProperty>> getProperties() {
     List<Set<AuthProperty>> toRet = new LinkedList<Set<AuthProperty>>();
-    Set<AuthProperty> internal = new TreeSet<AuthProperty>();
+    Set<AuthProperty> internal = new LinkedHashSet<AuthProperty>();
     internal.add(new AuthProperty("password", "the password for the principal", true));
     internal.add(new AuthProperty("principal", "option field to provide the principal, mostly used for better debug statements", false));
     toRet.add(internal);