code: private static Boolean castToBoolean(Object val) //was BooleanValue
    {
      if (tc.isAnyTracingEnabled() && tc.isEntryEnabled())
        tc.entry(cclass, "castToBoolean", val);
      Boolean theReturn = null;
      if (val instanceof String)
      {
        String stringVal = (String) val;
        if (stringVal.equalsIgnoreCase("true"))
          theReturn = Boolean.TRUE; // was BooleanValue.TRUE
        else
          if (stringVal.equalsIgnoreCase("false"))
            theReturn = Boolean.FALSE; // was BooleanValue.FALSE
      }
      if (tc.isAnyTracingEnabled() && tc.isEntryEnabled())
        tc.exit(cclass, "castToBoolean", theReturn);    
      return theReturn;
    }
docs: Cast an Object which is not null and not an instance of BooleanValue to BooleanValue,
  if possible under the permissive rules, BooleanValue.NULL otherwise.  In fact, only a
  String can be so cast.
  @param val
  @return