public static Class toReferenceClass(Class c){
  if (c.isPrimitive()) {
    if (c == boolean.class)     return Boolean.class;
    if (c == byte.class)     return Byte.class;
    if (c == short.class)     return Short.class;
    if (c == char.class)     return Character.class;
    if (c == int.class)     return Integer.class;
    if (c == long.class)     return Long.class;
    if (c == float.class)     return Float.class;
    if (c == double.class)     return Double.class;
  }
  return c;
}

public static Class toReferenceClass ( Class c ) { if ( c . isPrimitive ( ) ) { if ( c == boolean . class ) return Boolean . class ; if ( c == byte . class ) return Byte . class ; if ( c == short . class ) return Short . class ; if ( c == char . class ) return Character . class ; if ( c == int . class ) return Integer . class ; if ( c == long . class ) return Long . class ; if ( c == float . class ) return Float . class ; if ( c == double . class ) return Double . class ; } return c ; }
convert a primitive class type to a reference type ( example : int - > java . lang . integer )
