question: String format ( Object obj , StringBuffer toAppendTo ) throws IllegalArgumentException { Date source = null ; if ( obj instanceof Date ) { source = ( Date ) obj ; } else if ( obj instanceof String ) { try { source = parse ( ( String ) obj ) ; } catch ( ParseException pe ) { throw new RuntimeException ( pe . toString ( ) ) ; } } if ( source == null ) { throw new IllegalArgumentException ( ( obj == null ) ? "null" : obj . toString ( ) ) ; } return format ( source , toAppendTo ) ; }
target:  Format a given object.