public static String[] internStringsInArray(String[] strings) {
    for (int i = 0; i < strings.length; i++) {
      // Intern values only when they are not part of the String pool already
      if (strings[i] != null && strings[i] != strings[i].intern()) {
        strings[i] = strings[i].intern();
      }
    }
    return strings;
  }
Interns all the strings in the given array in place, returning the same array
common/src/java/org/apache/hadoop/hive/common/StringInternUtils.java