Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 7951 invoked from network); 17 Aug 2007 05:42:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Aug 2007 05:42:27 -0000 Received: (qmail 32294 invoked by uid 500); 17 Aug 2007 05:42:24 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 32248 invoked by uid 500); 17 Aug 2007 05:42:24 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 32237 invoked by uid 99); 17 Aug 2007 05:42:24 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Aug 2007 22:42:24 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Aug 2007 05:42:26 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 37D191A981A; Thu, 16 Aug 2007 22:42:06 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@directory.apache.org From: akarasulu@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070817054206.37D191A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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. * */ -public class LdifReader implements Iterator +public class LdifReader implements Iterator { /** 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 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 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 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 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 iterator() { return this; }