package org.bouncycastle.asn1;

import java.io.IOException;

/**
 * A NULL object.
 */
public abstract class ASN1Null
    extends ASN1Object
{
    public ASN1Null()
    {
    }

    public int hashCode()
    {
        return 0;
    }

    boolean asn1Equals(
        DERObject o)
    {
        if (!(o instanceof ASN1Null))
        {
            return false;
        }
        
        return true;
    }

    abstract void encode(DEROutputStream out)
        throws IOException;

    public String toString()
    {
         return "NULL";
    }
}

@@ -222,9 +222,10 @@
 urn 
-0
+-1
 ;%0A  

Use -1 for hashCode, since 0 has the same effect as "no object" in typical cases (e.g. sequences/sets)