On 9/21/06, Alex Karasulu <[EMAIL PROTECTED]> wrote:
Sorry to bother you about this Emmanuel but did you also apply this to
the 0.9.5 branch for ApacheDS 1.0? I just did not see a mirrored commit
on 0.9.5 branch.
Or is this bug fix not applicable to 0.9.5?
Thanks,
Alex
[EMAIL PROTECTED] wrote:
> Author: elecharny
> Date: Thu Sep 21 02:57:50 2006
> New Revision: 448504
>
> URL: http://svn.apache.org/viewvc?view=rev&rev=448504
> Log:
> Applied the patch for DIRSERVER-741 (NPE in debug mode)
>
> Modified:
> directory/trunks/shared/asn1/src/main/java/org/apache/directory/shared/asn1/ber/Asn1Decoder.java
>
> Modified: directory/trunks/shared/asn1/src/main/java/org/apache/directory/shared/asn1/ber/Asn1Decoder.java
> URL: http://svn.apache.org/viewvc/directory/trunks/shared/asn1/src/main/java/org/apache/directory/shared/asn1/ber/Asn1Decoder.java?view=diff&rev=448504&r1=448503&r2=448504
> ==============================================================================
> --- directory/trunks/shared/asn1/src/main/java/org/apache/directory/shared/asn1/ber/Asn1Decoder.java (original)
> +++ directory/trunks/shared/asn1/src/main/java/org/apache/directory/shared/asn1/ber/Asn1Decoder.java Thu Sep 21 02:57:50 2006
> @@ -312,8 +312,15 @@
>
> if ( IS_DEBUG )
> {
> - Tag tag = container.getCurrentTLV().getTag();
> - log.debug( "Tag {} has been decoded", tag.toString() );
> + if ( container.getCurrentTLV() != null )
> + {
> + Tag tag = container.getCurrentTLV().getTag();
> + log.debug( "Tag {} has been decoded", tag.toString() );
> + }
> + else
> + {
> + log.debug( "Tag has been decoded, but is null" );
> + }
> }
>
> // Create a link between the current TLV with its parent
> @@ -513,7 +520,14 @@
>
> if ( IS_DEBUG )
> {
> - log.debug( "Root TLV[{}]", new Integer( tlv.getLength().getLength() ) );
> + if ( ( tlv != null ) && ( tlv.getLength() != null ) )
> + {
> + log.debug( "Root TLV[{}]", new Integer( tlv.getLength().getLength() ) );
> + }
> + else
> + {
> + log.debug( "Root TLV[ null ]");
> + }
> }
> }
> else
> @@ -974,18 +988,32 @@
>
> if ( container.getState() == TLVStateEnum.PDU_DECODED )
> {
> - log.debug( "<-- Stop decoding : {}", container.getCurrentTLV().toString() );
> + if ( container.getCurrentTLV() != null )
> + {
> + log.debug( "<-- Stop decoding : {}", container.getCurrentTLV ().toString() );
> + }
> + else
> + {
> + log.debug( "<-- Stop decoding : null current TLV" );
> + }
> }
> else
> {
> - log.debug( "<-- End decoding : {}", container.getCurrentTLV().toString() );
> + if ( container.getCurrentTLV () != null )
> + {
> + log.debug( "<-- End decoding : {}", container.getCurrentTLV().toString() );
> + }
> + else
> + {
> + log.debug( "<-- End decoding : null current TLV" );
> + }
> }
>
> log.debug( "<<<==========================================" );
> }
>
> return;
> - } // end method decode
> + }
>
>
> /**
> @@ -1075,5 +1103,5 @@
> this.maxTagLength = maxTagLength;
> }
>
> -} // end class TLVTagDecoder
> +}
>
>
>
>
--
Cordialement,
Emmanuel Lécharny