public TextBuffer appendCastTypeName(String castName, VarType type) {
    if (type.type == CodeType.OBJECT) {
      if (type.arrayDim > 0) {
        String name = castName.substring(0, castName.length() - type.arrayDim * 2);
        appendAllClasses(name, type.value);
        addGenericTypeTokens(length() - name.length(), name, type);
        append(castName.substring(castName.length() - type.arrayDim * 2));
      } else {
        appendAllClasses(castName, type.value);
        addGenericTypeTokens(length() - castName.length(), castName, type);
      }

      return this;
    }

    return append(castName);
  }
Allows to connect text with resulting lines

@author egor
src/org/jetbrains/java/decompiler/util/TextBuffer.java