0 Replies Latest reply on Apr 8, 2010 9:48 AM by jmesnil

    NPE when creating SimpleString

    jmesnil

      Just a reminder to pay attention when we convert a String to a SimpleString.

       

      The SimpleString constructor expects a non-null String parameter. If we pass null, it will throw a NPE.

      Most of the time, the String parameter must not be null but there are cases where this could happen (eg. a null filter, a null bridge's forward address).

      In the case the String can be null, we can use SimpleString.toSimpleString(String) instead. This method returns null if the parameter is null or a valid SimpleString.

       

      I've been bitten more than once by this, I'm spreading the info now