directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r438482 - /directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/FilterGrammar.java
Date Wed, 30 Aug 2006 13:23:03 GMT
Author: elecharny
Date: Wed Aug 30 06:23:02 2006
New Revision: 438482

URL: http://svn.apache.org/viewvc?rev=438482&view=rev
Log:
Removed a duplicated transition.

Modified:
    directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/FilterGrammar.java

Modified: directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/FilterGrammar.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/FilterGrammar.java?rev=438482&r1=438481&r2=438482&view=diff
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/FilterGrammar.java
(original)
+++ directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/FilterGrammar.java
Wed Aug 30 06:23:02 2006
@@ -415,21 +415,29 @@
 
                     AttributeValueAssertion assertion = new AttributeValueAssertion();
 
-                    try
+                    if ( tlv.getLength().getLength() == 0 )
                     {
-                        LdapString type = new LdapString( tlv.getValue().getData() );
-                        assertion.setAttributeDesc( type );
+                        log.error( "The attribute description is empty " );
+                        throw new DecoderException( "The type can't be null" );
                     }
-                    catch ( LdapStringEncodingException lsee )
+                    else
                     {
-                        String msg = StringTools.dumpBytes( tlv.getValue().getData() );
-                        log.error( "The assertion description ({}) is invalid", msg );
-                        throw new DecoderException( "Invalid assertion description " + msg
+ ", : " + lsee.getMessage() );
-                    }
+                        try
+                        {
+                            LdapString type = new LdapString( tlv.getValue().getData() );
+                            assertion.setAttributeDesc( type );
+                        }
+                        catch ( LdapStringEncodingException lsee )
+                        {
+                            String msg = StringTools.dumpBytes( tlv.getValue().getData()
);
+                            log.error( "The assertion value ({}) is invalid", msg );
+                            throw new DecoderException( "Invalid assertion value " + msg
+ ", : " + lsee.getMessage() );
+                        }
 
-                    AttributeValueAssertionFilter comparisonFilter = ( AttributeValueAssertionFilter
) searchRequest
-                        .getTerminalFilter();
-                    comparisonFilter.setAssertion( assertion );
+                        AttributeValueAssertionFilter terminalFilter = ( AttributeValueAssertionFilter
) searchRequest
+                            .getTerminalFilter();
+                        terminalFilter.setAssertion( assertion );
+                    }
                 }
             } );
 
@@ -485,52 +493,6 @@
                     searchRequest.unstackFilters( container );
 
                     container.grammarPopAllowed( true );
-                }
-            } );
-
-        // AttributeValueAssertion ::= SEQUENCE {
-        //    attributeDesc   AttributeDescription, (VALUE)
-        //     ...
-        // We have to set the attribute description in the current filter.
-        // It could be an equalityMatch, greaterOrEqual, lessOrEqual or an
-        // approxMatch filter.
-        super.transitions[LdapStatesEnum.FILTER_ATTRIBUTE_DESC_VALUE][UniversalTag.OCTET_STRING_TAG]
= new GrammarTransition(
-            LdapStatesEnum.FILTER_ATTRIBUTE_DESC_VALUE, LdapStatesEnum.FILTER_ASSERTION_VALUE_TAG,
new GrammarAction(
-                "Init attributeDesc Value" )
-            {
-                public void action( IAsn1Container container ) throws DecoderException
-                {
-                    LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer )
container;
-                    LdapMessage ldapMessage = ldapMessageContainer.getLdapMessage();
-                    SearchRequest searchRequest = ldapMessage.getSearchRequest();
-
-                    TLV tlv = ldapMessageContainer.getCurrentTLV();
-
-                    AttributeValueAssertion assertion = new AttributeValueAssertion();
-
-                    if ( tlv.getLength().getLength() == 0 )
-                    {
-                        log.error( "The attribute description is empty " );
-                        throw new DecoderException( "The type can't be null" );
-                    }
-                    else
-                    {
-                        try
-                        {
-                            LdapString type = new LdapString( tlv.getValue().getData() );
-                            assertion.setAttributeDesc( type );
-                        }
-                        catch ( LdapStringEncodingException lsee )
-                        {
-                            String msg = StringTools.dumpBytes( tlv.getValue().getData()
);
-                            log.error( "The assertion value ({}) is invalid", msg );
-                            throw new DecoderException( "Invalid assertion value " + msg
+ ", : " + lsee.getMessage() );
-                        }
-
-                        AttributeValueAssertionFilter terminalFilter = ( AttributeValueAssertionFilter
) searchRequest
-                            .getTerminalFilter();
-                        terminalFilter.setAssertion( assertion );
-                    }
                 }
             } );
 



Mime
View raw message