directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fel...@apache.org
Subject svn commit: r945027 - /directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/SearchRequestDsml.java
Date Mon, 17 May 2010 08:48:42 GMT
Author: felixk
Date: Mon May 17 08:48:41 2010
New Revision: 945027

URL: http://svn.apache.org/viewvc?rev=945027&view=rev
Log:
- Use more precise type
- Fix ClassCastException (which obviously never happened up to now -> the 'else' statement
never happened to be executed, not even in test cases)

Modified:
    directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/SearchRequestDsml.java

Modified: directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/SearchRequestDsml.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/SearchRequestDsml.java?rev=945027&r1=945026&r2=945027&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/SearchRequestDsml.java
(original)
+++ directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/SearchRequestDsml.java
Mon May 17 08:48:41 2010
@@ -36,6 +36,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.codec.search.SearchRequestCodec;
 import org.apache.directory.shared.ldap.codec.search.SubstringFilter;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
+import org.apache.directory.shared.ldap.entry.Value;
 import org.apache.directory.shared.ldap.filter.SearchScope;
 import org.dom4j.Element;
 import org.dom4j.Namespace;
@@ -270,7 +271,7 @@ public class SearchRequestDsml extends A
             {
                 newElement.addAttribute( "name", assertion.getAttributeDesc() );
 
-                Object value = assertion.getAssertionValue();
+                Value<?> value = assertion.getAssertionValue();
                 if ( value != null )
                 {
                     if ( ParserUtils.needsBase64Encoding( value ) )
@@ -287,7 +288,7 @@ public class SearchRequestDsml extends A
                     }
                     else
                     {
-                        newElement.addElement( "value" ).setText( ( String ) value );
+                        newElement.addElement( "value" ).setText( value.getString() );
                     }
                 }
             }
@@ -308,7 +309,7 @@ public class SearchRequestDsml extends A
 
             ExtensibleMatchFilter extensibleMatchFilter = ( ExtensibleMatchFilter ) filter;
 
-            Object value = extensibleMatchFilter.getMatchValue();
+            Value<?> value = extensibleMatchFilter.getMatchValue();
             if ( value != null )
             {
                 if ( ParserUtils.needsBase64Encoding( value ) )
@@ -323,7 +324,7 @@ public class SearchRequestDsml extends A
                 }
                 else
                 {
-                    newElement.addElement( "value" ).setText( ( String ) value );
+                    newElement.addElement( "value" ).setText( value.getString() );
                 }
             }
 



Mime
View raw message