directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r371752 - /directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/codec/search/SearchRequestGrammar.java
Date Tue, 24 Jan 2006 00:48:29 GMT
Author: elecharny
Date: Mon Jan 23 16:48:25 2006
New Revision: 371752

URL: http://svn.apache.org/viewcvs?rev=371752&view=rev
Log:
The attributes list can now be empty.

Modified:
    directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/codec/search/SearchRequestGrammar.java

Modified: directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/codec/search/SearchRequestGrammar.java
URL: http://svn.apache.org/viewcvs/directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/codec/search/SearchRequestGrammar.java?rev=371752&r1=371751&r2=371752&view=diff
==============================================================================
--- directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/codec/search/SearchRequestGrammar.java
(original)
+++ directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/codec/search/SearchRequestGrammar.java
Mon Jan 23 16:48:25 2006
@@ -658,17 +658,6 @@
                         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer
)
                             container;
 
-                        SearchRequest     searchRequest =
-                            ldapMessageContainer.getLdapMessage().getSearchRequest();
-
-                        TLV                  tlv = ldapMessageContainer.getCurrentTLV();
-
-                        // The attribute list may be null.
-                        if ( tlv.getLength().getLength() != 0 )
-                        {
-                        	searchRequest.initAttributes();
-                        }
-
                         // We can have an END transition
                         ldapMessageContainer.grammarEndAllowed( true );
 
@@ -700,9 +689,20 @@
                         TLV                  tlv = ldapMessageContainer.getCurrentTLV();
                         LdapString attributeDescription = null;
                         
+                        byte[] value = null;
+                        
+                        if ( tlv.getLength().getLength() == 0 )
+                        {
+                            value = new byte[]{ '*' }; 
+                        }
+                        else
+                        {
+                            value = tlv.getValue().getData();
+                        }
+
                         try
                         {
-                            attributeDescription = new LdapString( tlv.getValue().getData()
);
+                            attributeDescription = new LdapString( value );
                             searchRequest.addAttribute( attributeDescription );
                         }
                         catch ( LdapStringEncodingException lsee )
@@ -710,7 +710,7 @@
                             log.error( "Cannot decode the attribute description : {}", StringTools.dumpBytes(
tlv.getValue().getData() ) );
                             throw new DecoderException( "Cannot decode the attribute description"
);
                         }
-                        
+                            
                         // We can have an END transition
                         ldapMessageContainer.grammarEndAllowed( true );
 



Mime
View raw message