code: protected void setVersion(String buf)
    {
      // HACK to handle empty postfix
      while (buf.endsWith("-")) {
        buf = buf.substring(0, buf.length() - 1);
      }
      while (buf.endsWith(".")) {
        buf = buf.substring(0, buf.length() - 1);
      }
      head = Version.valueOf(buf);
  
      significantDigits = -1;
    }
docs: Set the version
  
  @param buf Version we are trying to parse