Here you can find the source of toPrimitive(Class aClass)
public static Class toPrimitive(Class aClass)
//package com.java2s; public class Main { static Class _primitives[] = { boolean.class, char.class, byte.class, short.class, int.class, long.class, float.class, double.class, void.class }; static Class _primMappings[] = { Boolean.class, Character.class, Byte.class, Short.class, Integer.class, Long.class, Float.class, Double.class, Void.class }; /**/*ww w.j a va2 s . co m*/ * Returns non primitive type for primitive. */ public static Class toPrimitive(Class aClass) { for (int i = 0; i < _primitives.length; i++) if (aClass == _primMappings[i]) return _primitives[i]; return aClass; } }