code: public static String fixName(String name) {
          if (name == null) {
              throw MESSAGES.nullArgument("name");
          }
          int length = name.length();
          if (length <= 1) { return name; }
          if (name.charAt(length - 1) == '/') { return name.substring(0, length - 1); }
          return name;
      }
docs: Fix a name (removes any trailing slash)
  
  @param name the name to fix
  @return the fixed name
  @throws IllegalArgumentException for a null name