directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r614026 - /directory/studio/trunk/studio-ldif-parser/src/main/java/org/apache/directory/studio/ldifparser/parser/LdifScanner.java
Date Mon, 21 Jan 2008 21:59:00 GMT
Author: seelmann
Date: Mon Jan 21 13:58:59 2008
New Revision: 614026

URL: http://svn.apache.org/viewvc?rev=614026&view=rev
Log:
Fix for DIRSTUDIO-264 (ldif parser doesn't accept attributes with empty values)

Modified:
    directory/studio/trunk/studio-ldif-parser/src/main/java/org/apache/directory/studio/ldifparser/parser/LdifScanner.java

Modified: directory/studio/trunk/studio-ldif-parser/src/main/java/org/apache/directory/studio/ldifparser/parser/LdifScanner.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldif-parser/src/main/java/org/apache/directory/studio/ldifparser/parser/LdifScanner.java?rev=614026&r1=614025&r2=614026&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldif-parser/src/main/java/org/apache/directory/studio/ldifparser/parser/LdifScanner.java
(original)
+++ directory/studio/trunk/studio-ldif-parser/src/main/java/org/apache/directory/studio/ldifparser/parser/LdifScanner.java
Mon Jan 21 13:58:59 2008
@@ -408,7 +408,7 @@
         String s1 = this.getWord( start );
         if ( s1 != null )
         {
-            String s2 = getContent();
+            String s2 = getContent( false );
             return s2 != null ? s1 + s2 : s1;
         }
         else
@@ -418,7 +418,7 @@
     }
 
 
-    private String getContent()
+    private String getContent( boolean allowEmptyContent )
     {
 
         StringBuffer sb = new StringBuffer( 256 );
@@ -437,7 +437,7 @@
         {
         }
 
-        return sb.length() > 0 ? sb.toString() : null;
+        return sb.length() > 0 || allowEmptyContent ? sb.toString() : null;
     }
 
 
@@ -568,7 +568,7 @@
     {
         this.flushBuffer();
 
-        String line = getContent();
+        String line = getContent( false );
         LdifToken sep = matchSep();
 
         if ( line != null || sep != null )
@@ -590,7 +590,7 @@
     {
         this.flushBuffer();
 
-        String line = getContent();
+        String line = getContent( false );
         if ( line != null )
         {
             LdifToken sep = matchSep();
@@ -1046,7 +1046,7 @@
     {
         this.flushBuffer();
 
-        String line = getContent();
+        String line = getContent( true );
         if ( line != null )
         {
             return new LdifToken( LdifToken.VALUE, line, pos - line.length() + 1 );



Mime
View raw message