public Type getType ( Type baseType , boolean isArray , List < Type > typeParams ) { boolean isGeneric = typeParams != null && ! typeParams . isEmpty ( ) ; if ( ! isArray && ! isGeneric ) { // Simple type. return baseType ; } else if ( isArray && ! isGeneric ) { // Array type, not generic. ClassSymbol arraySymbol = getSymtab ( ) . arrayClass ; return new ArrayType ( baseType , arraySymbol ) ; } else if ( ! isArray && isGeneric ) { // Generic type, not array. com . sun . tools . javac . util . List < Type > typeParamsCopy = com . sun . tools . javac . util . List . from ( typeParams ) ; return new ClassType ( Type . noType , typeParamsCopy , baseType . tsym ) ; } else { throw new IllegalArgumentException ( "Unsupported arguments to getType" ) ; } }
Build an instance of a Type .