harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mloe...@apache.org
Subject svn commit: r512825 - /harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/org/apache/harmony/jndi/internal/parser/LdapRdnParser.java
Date Wed, 28 Feb 2007 16:18:49 GMT
Author: mloenko
Date: Wed Feb 28 08:18:48 2007
New Revision: 512825

URL: http://svn.apache.org/viewvc?view=rev&rev=512825
Log:
generification and style fix

Modified:
    harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/org/apache/harmony/jndi/internal/parser/LdapRdnParser.java

Modified: harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/org/apache/harmony/jndi/internal/parser/LdapRdnParser.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/org/apache/harmony/jndi/internal/parser/LdapRdnParser.java?view=diff&rev=512825&r1=512824&r2=512825
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/org/apache/harmony/jndi/internal/parser/LdapRdnParser.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/org/apache/harmony/jndi/internal/parser/LdapRdnParser.java
Wed Feb 28 08:18:48 2007
@@ -37,9 +37,9 @@
 
     LdapTypeAndValueList list = new LdapTypeAndValueList();
 
-    private List attrList;
+    private List<AttributeTypeAndValuePair> attrList;
 
-    private List listAll;
+    private List<AttributeTypeAndValuePair> listAll;
 
     private RelaxedDnParser parser = null;
 
@@ -67,10 +67,10 @@
                     .getString("ldap.17")
                     + name).initCause(e));
         }
+
         attrList = (List) listAll.get(0);
-        for (Iterator iter = attrList.iterator(); iter.hasNext();) {
-            AttributeTypeAndValuePair element = (AttributeTypeAndValuePair) iter
-                    .next();
+        for (Iterator<AttributeTypeAndValuePair> iter = attrList.iterator(); iter.hasNext();)
{
+            AttributeTypeAndValuePair element = iter.next();
             list.put(element.getType(), element.getValue());
         }
         return list.toAttributeList();
@@ -99,8 +99,8 @@
      */
     public static String escapeValue(Object obj) {
         if (obj instanceof String) {
-            String val = String.valueOf((String) obj);
-            return getEscaped(val.toCharArray().clone());
+            String val = String.valueOf(obj);
+            return getEscaped(val.toCharArray());
         } else if (obj instanceof byte[]) {
             return getHexValues((byte[]) obj);
         } else {
@@ -111,8 +111,9 @@
     private static String getEscaped(char[] chars) {
         StringBuffer sb = new StringBuffer();
         for (int i = 0; i < chars.length; i++) {
-            if (isSpecialChar(chars, i))
-                sb.append("\\");
+            if (isSpecialChar(chars, i)) {
+                sb.append('\\');
+            }
             sb.append(new Character(chars[i]));
         }
         return sb.toString();
@@ -124,7 +125,7 @@
             sb.append(Integer.toHexString(byteArray[i] >> 4 & 0x0F));
             sb.append(Integer.toHexString(byteArray[i] & 0x0F)); 
         }
-        return "#" + sb.toString();
+        return '#' + sb.toString();
     }
 
     /**
@@ -179,9 +180,7 @@
                         }
                     }
                 } catch (ArrayIndexOutOfBoundsException e) {
-
                 }
-
             }
         }
         return sb.toString();



Mime
View raw message