code: public static boolean isPrimitive(JCExpression ref) {
  		String typeName = ref.toString();
  		return PRIMITIVE_TYPE_NAME_PATTERN.matcher(typeName).matches();
  	}
docs: Checks if the given expression (that really ought to refer to a type
  expression) represents a primitive type.