code: protected static String[] calculateBundleNames(String baseName, Locale locale) {
          int length = 1;
          boolean hasLanguage = locale.getLanguage().length() > 0;
          if (hasLanguage) {
              length++;
          }
          boolean hasCountry = locale.getCountry().length() > 0;
          if (hasCountry) {
              length++;
          }
          boolean hasVariant = locale.getVariant().length() > 0;
          if (hasVariant) {
              length++;
          }
          String[] result = new String[length];
          int index = 0;
          result[index++] = baseName;
  
          if (!(hasLanguage || hasCountry || hasVariant)) {
              return result;
          }
  
          StringBuffer buffer = new StringBuffer(baseName);
          buffer.append('_');
          buffer.append(locale.getLanguage());
          if (hasLanguage) {
              result[index++] = new String(buffer);
          }
  
          if (!(hasCountry || hasVariant)) {
              return result;
          }
          buffer.append('_');
          buffer.append(locale.getCountry());
          if (hasCountry) {
              result[index++] = new String(buffer);
          }
  
          if (!hasVariant) {
              return result;
          }
          buffer.append('_');
          buffer.append(locale.getVariant());
          result[index++] = new String(buffer);
  
          return result;
      }
docs: ======================