directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r566926 - in /directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/ldif: Entry.java LdifReader.java
Date Fri, 17 Aug 2007 05:42:06 GMT
Author: akarasulu
Date: Thu Aug 16 22:42:05 2007
New Revision: 566926

URL: http://svn.apache.org/viewvc?view=rev&rev=566926
Log:
added some generics to make things clear and avoid warnings

Modified:
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/Entry.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/LdifReader.java

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/Entry.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/Entry.java?view=diff&rev=566926&r1=566925&r2=566926
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/Entry.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/Entry.java
Thu Aug 16 22:42:05 2007
@@ -625,6 +625,7 @@
         return sb.toString();
     }
     
+    
     /**
      * Return a String representing the Entry
      */

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/LdifReader.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/LdifReader.java?view=diff&rev=566926&r1=566925&r2=566926
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/LdifReader.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/LdifReader.java
Thu Aug 16 22:42:05 2007
@@ -150,7 +150,7 @@
  *  single space before the continued value.
  * </pre>
  */
-public class LdifReader implements Iterator
+public class LdifReader implements Iterator<Entry>
 {
     /** A logger */
     private static final Logger log = LoggerFactory.getLogger( LdifReader.class );
@@ -882,13 +882,13 @@
      * @throws NamingException
      *             If anything goes wrong
      */
-    private void parseModRdn( Entry entry, Iterator iter ) throws NamingException
+    private void parseModRdn( Entry entry, Iterator<String> iter ) throws NamingException
     {
         // We must have two lines : one starting with "newrdn:" or "newrdn::",
         // and the second starting with "deleteoldrdn:"
         if ( iter.hasNext() )
         {
-            String line = (String) iter.next();
+            String line = iter.next();
             String lowerLine = line.toLowerCase();
 
             if ( lowerLine.startsWith( "newrdn::" ) || lowerLine.startsWith( "newrdn:" )
)
@@ -913,7 +913,7 @@
 
         if ( iter.hasNext() )
         {
-            String line = (String) iter.next();
+            String line = iter.next();
             String lowerLine = line.toLowerCase();
 
             if ( lowerLine.startsWith( "deleteoldrdn:" ) )
@@ -953,7 +953,7 @@
      * @param iter
      *            The lines
      */
-    private void parseModify( Entry entry, Iterator iter ) throws NamingException
+    private void parseModify( Entry entry, Iterator<String> iter ) throws NamingException
     {
         int state = MOD_SPEC;
         String modified = null;
@@ -964,7 +964,7 @@
 
         while ( iter.hasNext() )
         {
-            String line = (String) iter.next();
+            String line = iter.next();
             String lowerLine = line.toLowerCase();
 
             if ( lowerLine.startsWith( "-" ) )
@@ -1094,7 +1094,7 @@
      *            The associated control, if any
      * @return A modification entry
      */
-    private void parseChange( Entry entry, Iterator iter, int operation, Control control
) throws NamingException
+    private void parseChange( Entry entry, Iterator<String> iter, int operation, Control
control ) throws NamingException
     {
         // The changetype and operation has already been parsed.
         entry.setChangeType( operation );
@@ -1110,7 +1110,7 @@
                 // We will iterate through all attribute/value pairs
                 while ( iter.hasNext() )
                 {
-                    String line = (String) iter.next();
+                    String line = iter.next();
                     String lowerLine = line.toLowerCase();
                     parseAttributeValue( entry, line, lowerLine );
                 }
@@ -1129,7 +1129,7 @@
                 // The next line should be the new superior
                 if ( iter.hasNext() )
                 {
-                    String line = (String) iter.next();
+                    String line = iter.next();
                     String lowerLine = line.toLowerCase();
 
                     if ( lowerLine.startsWith( "newsuperior:" ) )
@@ -1197,7 +1197,7 @@
         lines.remove( 0 );
 
         // Now, let's iterate through the other lines
-        Iterator iter = lines.iterator();
+        Iterator<String> iter = lines.iterator();
 
         // This flag is used to distinguish between an entry and a change
         int type = UNKNOWN;
@@ -1218,7 +1218,7 @@
         {
             // Each line could start either with an OID, an attribute type, with
             // "control:" or with "changetype:"
-            line = (String) iter.next();
+            line = iter.next();
             lowerLine = line.toLowerCase();
 
             // We have three cases :
@@ -1592,7 +1592,7 @@
      * 
      * @return the next LDIF as a String.
      */
-    public Object next() throws NoSuchElementException
+    public Entry next() throws NoSuchElementException
     {
         try
         {
@@ -1647,7 +1647,7 @@
     /**
      * @return An iterator on the file
      */
-    public Iterator iterator()
+    public Iterator<Entry> iterator()
     {
         return this;
     }



Mime
View raw message