You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2005/10/30 20:59:56 UTC

svn commit: r329619 - /directory/shared/ldap/branches/shared-ldap-utf8/common/src/java/org/apache/ldap/common/filter/SimpleNode.java

Author: elecharny
Date: Sun Oct 30 11:59:53 2005
New Revision: 329619

URL: http://svn.apache.org/viewcvs?rev=329619&view=rev
Log:
The SimpleNode is supposed to accept only String value.

Modified:
    directory/shared/ldap/branches/shared-ldap-utf8/common/src/java/org/apache/ldap/common/filter/SimpleNode.java

Modified: directory/shared/ldap/branches/shared-ldap-utf8/common/src/java/org/apache/ldap/common/filter/SimpleNode.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/shared-ldap-utf8/common/src/java/org/apache/ldap/common/filter/SimpleNode.java?rev=329619&r1=329618&r2=329619&view=diff
==============================================================================
--- directory/shared/ldap/branches/shared-ldap-utf8/common/src/java/org/apache/ldap/common/filter/SimpleNode.java (original)
+++ directory/shared/ldap/branches/shared-ldap-utf8/common/src/java/org/apache/ldap/common/filter/SimpleNode.java Sun Oct 30 11:59:53 2005
@@ -16,8 +16,6 @@
  */
 package org.apache.ldap.common.filter ;
 
-import java.util.Arrays;
-
 import org.apache.asn1new.util.StringUtils;
 
 
@@ -30,7 +28,7 @@
 public class SimpleNode extends LeafNode
 {
     /** the value */
-    private byte[] value ;
+    private String value ;
 
     /**
      * Creates a new SimpleNode object.
@@ -39,9 +37,9 @@
      * @param value the value to test for
      * @param type the type of the assertion
      */
-    public SimpleNode( String attribute, String value, int type )
+    public SimpleNode( String attribute, byte[] value, int type )
     {
-        this( attribute, StringUtils.getBytesUtf8( value ), type );
+        this( attribute, StringUtils.toUtf8( value ), type );
     }
 
     /**
@@ -51,7 +49,7 @@
      * @param value the value to test for
      * @param type the type of the assertion
      */
-    public SimpleNode( String attribute, byte[] value, int type )
+    public SimpleNode( String attribute, String value, int type )
     {
         super( attribute, type ) ;
         this.value = value ;
@@ -94,7 +92,7 @@
      *
      * @return the value
      */
-    public final byte[] getValue()
+    public final String getValue()
     {
         return value ;
     }
@@ -105,7 +103,7 @@
      *
      * @param value the value for this node
      */
-    public void setValue( byte[] value )
+    public void setValue( String value )
     {
         this.value = value;
     }
@@ -142,9 +140,7 @@
         }
 
 
-        buf.append( StringUtils.toUtf8( value ) );
-        buf.append( '/' );
-        buf.append( StringUtils.dumpBytes( value ) );
+        buf.append( value );
         buf.append( ')' ) ;
 
         if ( ( null != getAnnotations() )
@@ -212,6 +208,6 @@
             return false;
         }
         
-        return Arrays.equals( value, ( ( ( SimpleNode ) other ).getValue() ) );
+        return value.equals( ( ( SimpleNode ) other ).getValue() );
     }
 }