Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 5536 invoked from network); 7 Feb 2011 20:52:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 7 Feb 2011 20:52:06 -0000 Received: (qmail 38664 invoked by uid 500); 7 Feb 2011 20:52:06 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 38582 invoked by uid 500); 7 Feb 2011 20:52:06 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 38407 invoked by uid 99); 7 Feb 2011 20:52:05 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Feb 2011 20:52:05 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Feb 2011 20:52:04 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id D797823889E0; Mon, 7 Feb 2011 20:51:43 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1068126 - in /directory/shared/branches/m1/asn1-ber/src/main/java/org/apache/directory/shared/asn1: actions/ ber/grammar/ Date: Mon, 07 Feb 2011 20:51:43 -0000 To: commits@directory.apache.org From: elecharny@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110207205143.D797823889E0@eris.apache.org> Author: elecharny Date: Mon Feb 7 20:51:43 2011 New Revision: 1068126 URL: http://svn.apache.org/viewvc?rev=1068126&view=rev Log: Fixing some more warnings Modified: directory/shared/branches/m1/asn1-ber/src/main/java/org/apache/directory/shared/asn1/actions/AbstractReadBitString.java directory/shared/branches/m1/asn1-ber/src/main/java/org/apache/directory/shared/asn1/actions/AbstractReadInteger.java directory/shared/branches/m1/asn1-ber/src/main/java/org/apache/directory/shared/asn1/actions/AbstractReadOctetString.java directory/shared/branches/m1/asn1-ber/src/main/java/org/apache/directory/shared/asn1/actions/CheckNotNullLength.java directory/shared/branches/m1/asn1-ber/src/main/java/org/apache/directory/shared/asn1/ber/grammar/AbstractGrammar.java directory/shared/branches/m1/asn1-ber/src/main/java/org/apache/directory/shared/asn1/ber/grammar/Grammar.java Modified: directory/shared/branches/m1/asn1-ber/src/main/java/org/apache/directory/shared/asn1/actions/AbstractReadBitString.java URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/asn1-ber/src/main/java/org/apache/directory/shared/asn1/actions/AbstractReadBitString.java?rev=1068126&r1=1068125&r2=1068126&view=diff ============================================================================== --- directory/shared/branches/m1/asn1-ber/src/main/java/org/apache/directory/shared/asn1/actions/AbstractReadBitString.java (original) +++ directory/shared/branches/m1/asn1-ber/src/main/java/org/apache/directory/shared/asn1/actions/AbstractReadBitString.java Mon Feb 7 20:51:43 2011 @@ -6,16 +6,16 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations - * under the License. - * + * under the License. + * */ package org.apache.directory.shared.asn1.actions; @@ -32,10 +32,10 @@ import org.slf4j.LoggerFactory; /** * The action used read a BITSTRING from a TLV - * + * * @author Apache Directory Project */ -public abstract class AbstractReadBitString extends GrammarAction +public abstract class AbstractReadBitString extends GrammarAction { /** The logger */ private static final Logger LOG = LoggerFactory.getLogger( AbstractReadBitString.class ); @@ -55,18 +55,18 @@ public abstract class AbstractReadBitStr /** * gives a byte array to be set to the appropriate field of the ASN.1 object - * present in the container + * present in the container * * @param data the data of the read TLV present in byte array format * @param container the container holding the ASN.1 object */ - protected abstract void setBitString( byte[] data, Asn1Container container ); + protected abstract void setBitString( byte[] data, E container ); /** * {@inheritDoc} */ - public final void action( Asn1Container container ) throws DecoderException + public final void action( E container ) throws DecoderException { TLV tlv = container.getCurrentTLV(); Modified: directory/shared/branches/m1/asn1-ber/src/main/java/org/apache/directory/shared/asn1/actions/AbstractReadInteger.java URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/asn1-ber/src/main/java/org/apache/directory/shared/asn1/actions/AbstractReadInteger.java?rev=1068126&r1=1068125&r2=1068126&view=diff ============================================================================== --- directory/shared/branches/m1/asn1-ber/src/main/java/org/apache/directory/shared/asn1/actions/AbstractReadInteger.java (original) +++ directory/shared/branches/m1/asn1-ber/src/main/java/org/apache/directory/shared/asn1/actions/AbstractReadInteger.java Mon Feb 7 20:51:43 2011 @@ -6,16 +6,16 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations - * under the License. - * + * under the License. + * */ package org.apache.directory.shared.asn1.actions; @@ -23,10 +23,10 @@ package org.apache.directory.shared.asn1 import org.apache.directory.shared.asn1.DecoderException; import org.apache.directory.shared.asn1.ber.Asn1Container; import org.apache.directory.shared.asn1.ber.grammar.GrammarAction; +import org.apache.directory.shared.asn1.ber.tlv.IntegerDecoder; import org.apache.directory.shared.asn1.ber.tlv.IntegerDecoderException; import org.apache.directory.shared.asn1.ber.tlv.TLV; import org.apache.directory.shared.asn1.ber.tlv.Value; -import org.apache.directory.shared.asn1.ber.tlv.IntegerDecoder; import org.apache.directory.shared.i18n.I18n; import org.apache.directory.shared.util.Strings; import org.slf4j.Logger; @@ -35,10 +35,10 @@ import org.slf4j.LoggerFactory; /** * The action used to read an integer value - * + * * @author Apache Directory Project */ -public abstract class AbstractReadInteger extends GrammarAction +public abstract class AbstractReadInteger extends GrammarAction { /** The logger */ private static final Logger LOG = LoggerFactory.getLogger( AbstractReadInteger.class ); @@ -63,7 +63,7 @@ public abstract class AbstractReadIntege /** - * + * * Creates a new instance of AbstractReadInteger. * * @param name the action's name @@ -80,19 +80,19 @@ public abstract class AbstractReadIntege /** - * + * * set the integer value to the appropriate field of ASN.1 object present in the container - * + * * @param value the integer value * @param container the ASN.1 object's container */ - protected abstract void setIntegerValue( int value, Asn1Container container ); + protected abstract void setIntegerValue( int value, E container ); /** * {@inheritDoc} */ - public final void action( Asn1Container container ) throws DecoderException + public final void action( E container ) throws DecoderException { TLV tlv = container.getCurrentTLV(); @@ -104,9 +104,9 @@ public abstract class AbstractReadIntege // This will generate a PROTOCOL_ERROR throw new DecoderException( I18n.err( I18n.ERR_04067 ) ); } - + Value value = tlv.getValue(); - + try { int number = IntegerDecoder.parse( value, minValue, maxValue ); @@ -115,7 +115,7 @@ public abstract class AbstractReadIntege { LOG.debug( "read integer value : {}", number ); } - + setIntegerValue( number, container ); } catch ( IntegerDecoderException ide ) Modified: directory/shared/branches/m1/asn1-ber/src/main/java/org/apache/directory/shared/asn1/actions/AbstractReadOctetString.java URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/asn1-ber/src/main/java/org/apache/directory/shared/asn1/actions/AbstractReadOctetString.java?rev=1068126&r1=1068125&r2=1068126&view=diff ============================================================================== --- directory/shared/branches/m1/asn1-ber/src/main/java/org/apache/directory/shared/asn1/actions/AbstractReadOctetString.java (original) +++ directory/shared/branches/m1/asn1-ber/src/main/java/org/apache/directory/shared/asn1/actions/AbstractReadOctetString.java Mon Feb 7 20:51:43 2011 @@ -6,16 +6,16 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations - * under the License. - * + * under the License. + * */ package org.apache.directory.shared.asn1.actions; @@ -32,10 +32,10 @@ import org.slf4j.LoggerFactory; /** * The action used to read an OCTET STRING value - * + * * @author Apache Directory Project */ -public abstract class AbstractReadOctetString extends GrammarAction +public abstract class AbstractReadOctetString extends GrammarAction { /** The logger */ private static final Logger LOG = LoggerFactory.getLogger( AbstractReadOctetString.class ); @@ -55,32 +55,32 @@ public abstract class AbstractReadOctetS /** * Instantiates a new AbstractReadInteger action. - * + * * @param name The log message * @param canBeNull Tells if the byte array can be null or not */ public AbstractReadOctetString( String name, boolean canBeNull ) { super( name ); - + this.canBeNull = canBeNull; } /** - * + * * set the OCTET STRING value to the appropriate field of ASN.1 object present in the container - * + * * @param value the OCTET STRING value * @param container the ASN.1 object's container */ - protected abstract void setOctetString( byte[] value, Asn1Container container ); + protected abstract void setOctetString( byte[] value, E container ); /** * {@inheritDoc} */ - public final void action( Asn1Container container ) throws DecoderException + public final void action( E container ) throws DecoderException { TLV tlv = container.getCurrentTLV(); @@ -92,9 +92,9 @@ public abstract class AbstractReadOctetS // This will generate a PROTOCOL_ERROR throw new DecoderException( I18n.err( I18n.ERR_04067 ) ); } - + Value value = tlv.getValue(); - + // The data should not be null if ( ( value.getData() == null ) && ( !canBeNull ) ) { @@ -103,7 +103,7 @@ public abstract class AbstractReadOctetS // This will generate a PROTOCOL_ERROR throw new DecoderException( I18n.err( I18n.ERR_04067 ) ); } - + setOctetString( value.getData(), container ); } } Modified: directory/shared/branches/m1/asn1-ber/src/main/java/org/apache/directory/shared/asn1/actions/CheckNotNullLength.java URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/asn1-ber/src/main/java/org/apache/directory/shared/asn1/actions/CheckNotNullLength.java?rev=1068126&r1=1068125&r2=1068126&view=diff ============================================================================== --- directory/shared/branches/m1/asn1-ber/src/main/java/org/apache/directory/shared/asn1/actions/CheckNotNullLength.java (original) +++ directory/shared/branches/m1/asn1-ber/src/main/java/org/apache/directory/shared/asn1/actions/CheckNotNullLength.java Mon Feb 7 20:51:43 2011 @@ -6,24 +6,24 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations - * under the License. - * + * under the License. + * */ package org.apache.directory.shared.asn1.actions; +import org.apache.directory.shared.asn1.DecoderException; import org.apache.directory.shared.asn1.ber.Asn1Container; import org.apache.directory.shared.asn1.ber.grammar.GrammarAction; import org.apache.directory.shared.asn1.ber.tlv.TLV; -import org.apache.directory.shared.asn1.DecoderException; import org.apache.directory.shared.i18n.I18n; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -31,10 +31,10 @@ import org.slf4j.LoggerFactory; /** * An action that checks the length is not null - * + * * @author Apache Directory Project */ -public class CheckNotNullLength extends GrammarAction +public class CheckNotNullLength extends GrammarAction { /** The logger */ private static final Logger LOG = LoggerFactory.getLogger( CheckNotNullLength.class ); @@ -51,7 +51,7 @@ public class CheckNotNullLength extends /** * {@inheritDoc} */ - public void action( Asn1Container container ) throws DecoderException + public void action( E container ) throws DecoderException { TLV tlv = container.getCurrentTLV(); Modified: directory/shared/branches/m1/asn1-ber/src/main/java/org/apache/directory/shared/asn1/ber/grammar/AbstractGrammar.java URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/asn1-ber/src/main/java/org/apache/directory/shared/asn1/ber/grammar/AbstractGrammar.java?rev=1068126&r1=1068125&r2=1068126&view=diff ============================================================================== --- directory/shared/branches/m1/asn1-ber/src/main/java/org/apache/directory/shared/asn1/ber/grammar/AbstractGrammar.java (original) +++ directory/shared/branches/m1/asn1-ber/src/main/java/org/apache/directory/shared/asn1/ber/grammar/AbstractGrammar.java Mon Feb 7 20:51:43 2011 @@ -6,16 +6,16 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations - * under the License. - * + * under the License. + * */ package org.apache.directory.shared.asn1.ber.grammar; @@ -31,10 +31,10 @@ import org.slf4j.LoggerFactory; /** * The abstract Grammar which is the Mother of all the grammars. It contains * the transitions table. - * + * * @author Apache Directory Project */ -public abstract class AbstractGrammar implements Grammar +public abstract class AbstractGrammar implements Grammar { /** The logger */ private static final Logger LOG = LoggerFactory.getLogger( AbstractGrammar.class ); @@ -47,7 +47,7 @@ public abstract class AbstractGrammar im * indice the states, the second dimension indices the Tag value, so it is * 256 wide. */ - protected GrammarTransition[][] transitions; + protected GrammarTransition[][] transitions; /** The grammar name */ private String name; @@ -60,7 +60,7 @@ public abstract class AbstractGrammar im /** * Return the grammar's name - * + * * @return The grammar name */ public String getName() @@ -71,7 +71,7 @@ public abstract class AbstractGrammar im /** * Set the grammar's name - * + * * @param name The new grammar name */ public void setName( String name ) @@ -82,12 +82,12 @@ public abstract class AbstractGrammar im /** * Get the transition associated with the state and tag - * + * * @param state The current state * @param tag The current tag * @return A valid transition if any, or null. */ - public GrammarTransition getTransition( Enum state, int tag ) + public GrammarTransition getTransition( Enum state, int tag ) { return transitions[state.ordinal()][tag & 0x00FF]; } @@ -96,11 +96,11 @@ public abstract class AbstractGrammar im /** * The main function. This is where an action is executed. If the action is * null, nothing is done. - * + * * @param container The Asn1Container * @throws DecoderException Thrown if anything went wrong */ - public void executeAction( Asn1Container container ) throws DecoderException + public void executeAction( E container ) throws DecoderException { Enum currentState = container.getTransition(); @@ -113,7 +113,7 @@ public abstract class AbstractGrammar im byte tagByte = container.getCurrentTLV().getTag(); // We will loop until no more actions are to be executed - GrammarTransition transition = ( ( AbstractGrammar ) container.getGrammar() ).getTransition( currentState, + GrammarTransition transition = ( ( AbstractGrammar ) container.getGrammar() ).getTransition( currentState, tagByte ); if ( transition == null ) @@ -134,7 +134,7 @@ public abstract class AbstractGrammar im if ( transition.hasAction() ) { - Action action = transition.getAction(); + Action action = transition.getAction(); action.action( container ); } Modified: directory/shared/branches/m1/asn1-ber/src/main/java/org/apache/directory/shared/asn1/ber/grammar/Grammar.java URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/asn1-ber/src/main/java/org/apache/directory/shared/asn1/ber/grammar/Grammar.java?rev=1068126&r1=1068125&r2=1068126&view=diff ============================================================================== --- directory/shared/branches/m1/asn1-ber/src/main/java/org/apache/directory/shared/asn1/ber/grammar/Grammar.java (original) +++ directory/shared/branches/m1/asn1-ber/src/main/java/org/apache/directory/shared/asn1/ber/grammar/Grammar.java Mon Feb 7 20:51:43 2011 @@ -6,16 +6,16 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations - * under the License. - * + * under the License. + * */ package org.apache.directory.shared.asn1.ber.grammar; @@ -26,24 +26,24 @@ import org.apache.directory.shared.asn1. /** * The interface which expose common behavior of a Grammar implementer. - * + * * @author Apache Directory Project */ -public interface Grammar +public interface Grammar { /** * This method, when called, execute an action on the current data stored in * the container. - * + * * @param asn1Container Store the data being processed. * @throws DecoderException Thrown when an unrecoverable error occurs. */ - void executeAction( Asn1Container asn1Container ) throws DecoderException; + void executeAction( E asn1Container ) throws DecoderException; /** * Get the grammar name - * + * * @return Return the grammar's name */ String getName(); @@ -51,7 +51,7 @@ public interface Grammar /** * Set the grammar's name - * + * * @param name The grammar name */ void setName( String name );