<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>Good point. That test should be run in other vm mode. I've logged
      <a class="moz-txt-link-freetext" href="https://bugs.openjdk.java.net/browse/JDK-8165711">https://bugs.openjdk.java.net/browse/JDK-8165711</a><br>
      We can do the code review on net-dev mailing list.<br>
    </p>
    <p>regards,<br>
      Sean.<br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 08/09/2016 12:19, EL MAAKOUL IMANE
      wrote:<br>
    </div>
    <blockquote
cite="mid:CABD=2mA7UYw4YJX15KXpGMVK3DNtwBh8STWZCetf5RLy2i8TCg@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>
          <div>
            <div>
              <div>
                <div>
                  <div>
                    <div>
                      <div>Hello,<br>
                        <br>
                      </div>
                      When running Jtreg test suite with jdk9, the test:
                      <font size="2">java/net/SetFactoryPermission/SetFactoryPermission.java
                        fails with the exception: </font><br>
                      <pre><font size="2">java.lang.Error: factory already defined  </font></pre>
                      <font size="2"><br>
                      </font><font size="2">This error only happens
                        when: </font><font size="2"><font size="2">java/net/HandlerLoop.java
                          is run before
                          java/net/SetFactoryPermission/SetFactoryPermission.java
                          within the same agent. </font>This is
                        explained by the fact that in
                        java/net/HandlerLoop.java calls the setter </font><font
                        size="2">URL.setURLStreamHandlerFactory is
                        called with a non-null parameter, which can be
                        called only once in a JVM instance according to
                        the JAVA API.</font><br>
                    </div>
                  </div>
                  <font size="2"> <br>
                    Consequently the VM that run</font><font size="2">s
                    java/net/HandlerLoop.java is invalid for running</font><font
                    size="2"> </font> <font size="2">java/net/SetFactoryPermission/SetFactoryPermission.java.</font></div>
              </div>
              <font size="2"><br>
                To solve that problem, an annotation could be added to
                the test java/net/HandlerLoop.java to tell Jtreg runner
                to spawn</font><font size="2"> a new VM for that test.</font><br>
            </div>
            <font size="2"> <br>
            </font><br>
          </div>
          <div>Note: This is reproducible using the -agentvm and setting
            the concurrency to 1 and also renaming<br>
          </div>
          <div>the package of one of the tests to force it to be
            executed first.<br>
          </div>
          <div>Reproducible always with jdk9. <br>
          </div>
          <br>
          <font size="2">Best regards,<br>
            Imane EL Maakoul<br>
          </font></div>
      </div>
    </blockquote>
    <br>
  </body>
</html>