code: static boolean isJavaBaseAssignable( Class<?> lhsType, Class<?> rhsType )
      {
          /*
              Assignment to loose type, defer to bsh extensions
              Note: we could shortcut this here:
              if ( lhsType == null ) return true;
              rather than forcing another round.  It's not strictly a Java issue,
              so does it belong here?
          */
          if ( lhsType == null )
              return false;
  
          // null rhs type corresponds to type of Primitive.NULL assignable to any
          // object type but we give preference here to string types
          if ( rhsType == null )
              return lhsType == String.class;
  
          if ( lhsType.isPrimitive() && rhsType.isPrimitive() ) {
              if ( lhsType == rhsType )
                  return true;
  
              // handle primitive widening conversions - JLS 5.1.2
              if ( NUMBER_ORDER.containsKey(rhsType)
                      && NUMBER_ORDER.containsKey(lhsType) )
                  return NUMBER_ORDER.get(rhsType) < NUMBER_ORDER.get(lhsType);
          }
          else if ( lhsType.isAssignableFrom(rhsType) )
              return true;
  
          return false;
      }
docs: Is the assignment legal via original Java (up to version 1.4)
  assignment rules, not including auto-boxing/unboxing.
  @param rhsType may be null to indicate primitive null value