You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ak...@apache.org on 2011/01/24 00:23:25 UTC
svn commit: r1062573 -
/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/ldif/LdifReader.java
Author: akarasulu
Date: Sun Jan 23 23:23:25 2011
New Revision: 1062573
URL: http://svn.apache.org/viewvc?rev=1062573&view=rev
Log:
added changes from elecharny which produced conflict
Modified:
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/ldif/LdifReader.java
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/ldif/LdifReader.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/ldif/LdifReader.java?rev=1062573&r1=1062572&r2=1062573&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/ldif/LdifReader.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/ldif/LdifReader.java Sun Jan 23 23:23:25 2011
@@ -491,7 +491,7 @@ public class LdifReader implements Itera
*/
private String parseDn( String line ) throws LdapLdifException
{
- String dn = null;
+ String dn;
String lowerLine = line.toLowerCase();
@@ -666,7 +666,10 @@ public class LdifReader implements Itera
{
try
{
- inf.close();
+ if ( inf != null )
+ {
+ inf.close();
+ }
}
catch ( IOException ioe )
{
@@ -775,7 +778,7 @@ public class LdifReader implements Itera
// Check if we have a "true" or a "false"
int criticalPos = lowerLine.indexOf( ':' );
- int criticalLength = 0;
+ int criticalLength;
if ( criticalPos == -1 )
{
@@ -1018,7 +1021,6 @@ public class LdifReader implements Itera
state = MOD_SPEC;
isEmptyValue = true;
- continue;
}
}
else if ( lowerLine.startsWith( "add:" ) )
@@ -1272,8 +1274,8 @@ public class LdifReader implements Itera
boolean changeTypeSeen = false;
ChangeType operation = ChangeType.Add;
- String lowerLine = null;
- Control control = null;
+ String lowerLine;
+ Control control;
while ( iter.hasNext() )
{
@@ -1402,7 +1404,7 @@ public class LdifReader implements Itera
// <ldif-file> ::= "version:" <fill> <number>
char[] document = line.toCharArray();
- String versionNumber = null;
+ String versionNumber;
if ( line.startsWith( "version:" ) )
{
@@ -1453,7 +1455,7 @@ public class LdifReader implements Itera
* gets a line from the underlying data store
*
* @return a line of characters or null if EOF reached
- * @throws IOException
+ * @throws IOException on read failure
*/
protected String getLine() throws IOException
{
@@ -1471,7 +1473,7 @@ public class LdifReader implements Itera
*/
protected void readLines() throws LdapLdifException
{
- String line = null;
+ String line;
boolean insideComment = true;
boolean isFirstLine = true;
@@ -1674,10 +1676,7 @@ public class LdifReader implements Itera
// Close the reader
try
{
- if ( reader != null )
- {
- reader.close();
- }
+ reader.close();
}
catch ( IOException ioe )
{