private static TypeInfo toTypeInfo(Type type, @NotNull FirstPassData mapping) {
    int dimensions = 0;
    if (type.getSort() == Type.ARRAY) {
      dimensions = type.getDimensions();
      type = type.getElementType();
    }
    TypeInfo typeInfo = type.getSort() == Type.OBJECT ? mapping.toTypeInfo(type.getInternalName()) :
                        TypeInfo.fromString(type.getClassName());
    while (dimensions > 0) {
      dimensions--;
      typeInfo = typeInfo.arrayOf();
    }
    return typeInfo;
  }
private static TypeInfo toTypeInfo(Type type, @NotNull FirstPassData mapping)