private static boolean updateVMOptionsLines(Path newConfigDir, List<String> lines, Logger log) {
    Path platformVmOptionsFile = newConfigDir.getFileSystem().getPath(VMOptions.getPlatformOptionsFile().toString());
    Collection<String> platformLines = new LinkedHashSet<>(readPlatformOptions(platformVmOptionsFile, log));
    boolean updated = false;

    for (ListIterator<String> i = lines.listIterator(); i.hasNext(); ) {
      String line = i.next().trim();
      if (line.equals("-XX:MaxJavaStackTraceDepth=-1")) {
        i.set("-XX:MaxJavaStackTraceDepth=10000"); updated = true;
      }
      else if ("-XX:+UseConcMarkSweepGC".equals(line) ||
               "-Xverify:none".equals(line) || "-noverify".equals(line) ||
               "-XX:+UseCompressedOops".equals(line) ||
               line.startsWith("-agentlib:yjpagent") ||
               line.startsWith("-agentpath:") && line.contains("yjpagent") ||
               "-Dsun.io.useCanonPrefixCache=false".equals(line) ||
               "-Dfile.encoding=UTF-8".equals(line) && SystemInfoRt.isMac ||
               isDuplicateOrLowerValue(line, platformLines)) {
        i.remove(); updated = true;
      }
    }
    return updated;
  }
private static boolean updateVMOptionsLines(Path newConfigDir, List<String> lines, Logger log)