1 Reply Latest reply on Feb 27, 2005 11:35 PM by Howard Lovatt

    Primitive arrays compared to null

    Howard Lovatt Newbie

      Hi,

      The following code fails in the Javassist compiler when $2 is a primitive array:

      if ( $2 != null )
       return $2.length;


      Instead I have to use:

      if ( System.identityHashCode( $2 ) != 0 )
       return $2.length;


      Are there plans to add support for comparing primitive arrays to null?

      Is there a better work around?

      Keep up the good work - Howard.