private static String calcPackageName(String qualifiedName) {
    if (qualifiedName == null) {
      return null;
    }
    int dotIndex = qualifiedName.lastIndexOf('.');
    return dotIndex >= 0 ? qualifiedName.substring(0, dotIndex) : "";
  }
private static String calcPackageName(String qualifiedName)