Get the corresponding primitive TYPE class for the java.lang wrapper
class type.
e.g.  Integer.class -> Integer.TYPE
495399
public static Class<?> unboxType( Class<?> wrapperType )
    {
        Class<?> c = wrapperMap.get( wrapperType );
        if ( c != null )
            return c;
        throw new InterpreterError(
            "Not a primitive wrapper type: "+wrapperType );
    }
968683
private Class<?> resolveClass(Type type) {
    if (type instanceof Class) {
      return (Class<?>) type;
    } else if (type instanceof ParameterizedType) {
      return resolveClass(((ParameterizedType) type).getRawType());
    } else if (type instanceof WildcardType) {
      Type[] bounds = ((WildcardType) type).getUpperBounds();
      if (bounds.length > 0) {
        return (Class<?>) bounds[0];
      }
    }
    return null;
  }
1130105
public static Class<?> getPrimitiveClass(final Class<?> clazz) {

    if (clazz == null) {
      return null;
    }
    int index = ArrayUtils.indexOf(WRAPPER_CLASSES, clazz);
    if (index != ArrayUtils.INDEX_OF_NOT_FOUND) {
      return PRIMITIVE_CLASSES[index];
    }
    return clazz;
  }
168825
private Class mapPrimitive(Class clazz) {
		if (clazz == Integer.TYPE) {
			return Integer.class;
		}
		if (clazz == Double.TYPE) {
			return Double.class;
		}
		if (clazz == Float.TYPE) {
			return Float.class;
		}
		if (clazz == Boolean.TYPE) {
			return Boolean.class;
		}
		if (clazz == Long.TYPE) {
			return Long.class;
		}
		
		throw new RuntimeException("Unsupported primitive: "+clazz);
	}
591540
@Pure
	@SuppressWarnings("unchecked")
	public Class<? extends T> getValueType() {
		if (this.object == null) {
			return null;
		}
		return (Class<? extends T>) this.object.getClass();
	}
465295
public static Class<?> getObjectClassOfPrimitve(Class<?> primitive) {
        Class<?> objectClass = PRIMITIVE_TO_WRAPPER.get(primitive);
        if (objectClass != null) {
            return objectClass;
        }

        return primitive;
    }
825762
public Class<?> getType() {
        Class<?> cl = getTypeInternal();
        if (isDeserialized && !cl.isPrimitive()) {
            return Object.class;
        }
        return cl;
    }
1177875
public static Class<?> getType( Object arg, boolean boxed ) {
        if ( null == arg || Primitive.NULL == arg )
            return null;
        if ( arg instanceof Primitive && !boxed )
            return ((Primitive) arg).getType();
       return Primitive.unwrap(arg).getClass();
    }
823316
public static Class unwrapType(Class pType) {
        if (pType == Boolean.class) {
            return Boolean.TYPE;
        }
        else if (pType == Byte.class) {
            return Byte.TYPE;
        }
        else if (pType == Character.class) {
            return Character.TYPE;
        }
        else if (pType == Double.class) {
            return Double.TYPE;
        }
        else if (pType == Float.class) {
            return Float.TYPE;
        }
        else if (pType == Integer.class) {
            return Integer.TYPE;
        }
        else if (pType == Long.class) {
            return Long.TYPE;
        }
        else if (pType == Short.class) {
            return Short.TYPE;
        }

        throw new IllegalArgumentException("Not a primitive wrapper: " + pType);
    }
191161
private Class getCollectionType()
  {
    Class collectionType = Collection.class;
    IParsedElement parent = getParsedElement().getParent();
    if( parent instanceof NewExpression )
    {
      IType newType = ((NewExpression)parent).getType();
      IJavaClassInfo classInfo = IRTypeResolver.getJavaBackedClass(newType);
      Class javaBackedClass = classInfo != null ? classInfo.getBackingClass() : null;
      if( classInfo != null && javaBackedClass != null )
      {
        collectionType = javaBackedClass;
      }
      else if( JavaTypes.getJreType(AbstractCollection.class).isAssignableFrom( newType ) )
      {
        collectionType = AbstractCollection.class;
      }
    }
    return collectionType;
  }
1115096
public static Class<?> wrapper(Class<?> type) {
        if (type == null) {
            return null;
        }
        else if (type.isPrimitive()) {
            if (boolean.class == type) {
                return Boolean.class;
            }
            else if (int.class == type) {
                return Integer.class;
            }
            else if (long.class == type) {
                return Long.class;
            }
            else if (short.class == type) {
                return Short.class;
            }
            else if (byte.class == type) {
                return Byte.class;
            }
            else if (double.class == type) {
                return Double.class;
            }
            else if (float.class == type) {
                return Float.class;
            }
            else if (char.class == type) {
                return Character.class;
            }
            else if (void.class == type) {
                return Void.class;
            }
        }

        return type;
    }
187049
private static Class primitiveToWrapperType(Class clazz) {
	// boolean, byte, char, short, int, long, float, and double
	if (clazz == null) return null;
	else if (clazz.isPrimitive()) {
	    if (clazz.getName().equals("boolean")) return Boolean.class;
	    else if (clazz.getName().equals("byte")) return Byte.class;
	    else if (clazz.getName().equals("char")) return Character.class;
	    else if (clazz.getName().equals("short")) return Short.class;
	    else if (clazz.getName().equals("int")) return Integer.class;
	    else if (clazz.getName().equals("long")) return Long.class;
	    else if (clazz.getName().equals("float")) return Float.class;
	    else if (clazz.getName().equals("double")) return Double.class;
	}
	return clazz;
    }
1126867
public Class<?> getElementType() {
		if (Iterable.class.isAssignableFrom(type)) {
			return (Class<?>) ((ParameterizedType) getGenericType()).getActualTypeArguments()[0];
		} else {
			return type;
		}
	}
336873
@Nullable
  public static Class <?> getPrimitiveClass (@Nullable final Class <?> aClass)
  {
    if (isPrimitiveType (aClass))
      return aClass;
    return WRAPPER_TO_PRIMITIVE.get (aClass);
  }
1049503
public static Class<?> getRawClass(Type type) {
        if (type instanceof Class) {
            return (Class<?>) type;
        }
        if (type instanceof ParameterizedType) {
            return (Class<?>) ((ParameterizedType) type).getRawType();
        }
        if (type instanceof TypeVariable) {
            Type[] bounds = ((TypeVariable) type).getBounds();
            if (null != bounds && 0 < bounds.length) {
                return getRawClass(bounds[0]);
            }
        }
        return Object.class;
    }
111583
public JType getGenericReturnType()
  {
    try {
      Type retType = _method.getGenericReturnType();

      if (retType instanceof Class)
  return _loader.forName(((Class) retType).getName());
      else
  return new JTypeWrapper(_loader, (ParameterizedType) retType);
    } catch (NoSuchMethodError e) {
      return getReturnType();
    }

  }
1015975
private static Class<?> getTypedClass(java.lang.reflect.Type type)
    {
        if (type instanceof Class)
        {
            return ((Class) type);
        }
        else if (type instanceof ParameterizedType)
        {
            java.lang.reflect.Type rawParamterizedType = ((ParameterizedType) type).getRawType();
            return getTypedClass(rawParamterizedType);
        }
        else if (type instanceof TypeVariable)
        {
            java.lang.reflect.Type upperBound = ((TypeVariable) type).getBounds()[0];
            return getTypedClass(upperBound);
        }

        throw new IllegalArgumentException("Error while finding generic class for :" + type);
    }