directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1063522 - in /directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec: LdapMessageContainer.java LdapMessageGrammar.java
Date Tue, 25 Jan 2011 23:32:19 GMT
Author: elecharny
Date: Tue Jan 25 23:32:19 2011
New Revision: 1063522

URL: http://svn.apache.org/viewvc?rev=1063522&view=rev
Log:
Fixed some NPE

Modified:
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageContainer.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageGrammar.java

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageContainer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageContainer.java?rev=1063522&r1=1063521&r2=1063522&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageContainer.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageContainer.java
Tue Jan 25 23:32:19 2011
@@ -23,8 +23,8 @@ package org.apache.directory.shared.ldap
 import org.apache.directory.shared.asn1.ber.AbstractContainer;
 import org.apache.directory.shared.ldap.codec.controls.AbstractControl;
 import org.apache.directory.shared.ldap.codec.decorators.MessageDecorator;
-import org.apache.directory.shared.ldap.codec.decorators.SearchRequestDecorator;
 import org.apache.directory.shared.ldap.codec.decorators.ModifyRequestDecorator;
+import org.apache.directory.shared.ldap.codec.decorators.SearchRequestDecorator;
 import org.apache.directory.shared.ldap.message.spi.BinaryAttributeDetector;
 import org.apache.directory.shared.ldap.model.message.AbandonRequest;
 import org.apache.directory.shared.ldap.model.message.AddRequest;
@@ -272,9 +272,18 @@ public class LdapMessageContainer extend
     /**
      * @return Returns the SearchRequest stored in the container
      */
+    public SearchRequest getSearchRequest()
+    {
+        return (SearchRequest)(( SearchRequestDecorator ) message).getMessage();
+    }
+
+
+    /**
+     * @return Returns the SearchRequest stored in the container
+     */
     public SearchRequestDecorator getSearchRequestDecorator()
     {
-        return ( SearchRequestDecorator ) decorator;
+        return ( SearchRequestDecorator ) message;
     }
 
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageGrammar.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageGrammar.java?rev=1063522&r1=1063521&r2=1063522&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageGrammar.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageGrammar.java
Tue Jan 25 23:32:19 2011
@@ -71,8 +71,8 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.codec.actions.StoreTypeMatchingRuleAction;
 import org.apache.directory.shared.ldap.codec.actions.ValueAction;
 import org.apache.directory.shared.ldap.codec.controls.ControlFactory;
-import org.apache.directory.shared.ldap.codec.decorators.SearchRequestDecorator;
 import org.apache.directory.shared.ldap.codec.decorators.ModifyRequestDecorator;
+import org.apache.directory.shared.ldap.codec.decorators.SearchRequestDecorator;
 import org.apache.directory.shared.ldap.codec.search.ExtensibleMatchFilter;
 import org.apache.directory.shared.ldap.codec.search.SubstringFilter;
 import org.apache.directory.shared.ldap.message.SearchRequestImpl;
@@ -3602,8 +3602,10 @@ public final class LdapMessageGrammar ex
                     TLV tlv = ldapMessageContainer.getCurrentTLV();
 
                     SearchRequest searchRequest = new SearchRequestImpl( ldapMessageContainer.getMessageId()
);
-                    ldapMessageContainer.setMessage( searchRequest );
-                    ldapMessageContainer.getSearchRequestDecorator().setTlvId(tlv.getId());
+                    SearchRequestDecorator searchRequestDecorator = new SearchRequestDecorator(
searchRequest );
+
+                    searchRequestDecorator.setTlvId( tlv.getId());
+                    ldapMessageContainer.setMessage( searchRequestDecorator );
 
                     LOG.debug( "Search Request" );
                 }
@@ -3624,7 +3626,8 @@ public final class LdapMessageGrammar ex
                 public void action( Asn1Container container ) throws DecoderException
                 {
                     LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer )
container;
-                    SearchRequest searchRequest = ldapMessageContainer.getSearchRequestDecorator().getSearchRequest();
+                    SearchRequestDecorator searchRequestDecorator = ldapMessageContainer.getSearchRequestDecorator();
+                    SearchRequest searchRequest = searchRequestDecorator.getSearchRequest();
 
                     TLV tlv = ldapMessageContainer.getCurrentTLV();
 



Mime
View raw message