private static String getReturnTypeForDisplay()

in src/main/java/com/twitter/nodes/NodeDotGraphGenerator.java [297:313]


  private static String getReturnTypeForDisplay(Node node) {
    String type = node.getResponseClassName();
    if (type.startsWith("class ")) {
      type = type.substring(6);
    }
    Matcher matcher = CLASS_NAME_PATTERN.matcher(type);
    StringBuffer sb = new StringBuffer();
    while (matcher.find()) {
      String name = matcher.group();  // found full qualified class name
      String[] items = name.split("\\.");
      String shortened = items.length > 0 ? items[items.length - 1] : name;
      matcher.appendReplacement(sb, shortened);
    }
    matcher.appendTail(sb);
    String finalType = sb.toString();
    return finalType.isEmpty() ? null : finalType;
  }