public static Class < ? > getRawClass ( Type t ) { if ( isClassType ( t ) ) { return typeToClass ( t ) ; } else if ( t instanceof GenericArrayType ) { Type component = ( ( GenericArrayType ) t ) . getGenericComponentType ( ) ; return Array . newInstance ( getRawClass ( component ) , 0 ) . getClass ( ) ; } return Object . class ; }
Returns the raw class of both parameterized types and generic arrays . Returns java . lang . Object for all other types .