langtools/test/jdk/javadoc/tool/6964914/TestStdDoclet.java
changeset 40308 274367a99f98
parent 37637 b47af0433922
equal deleted inserted replaced
40306:1a0fcaf3f2ed 40308:274367a99f98
    45      * @throws DoesNotExist   oops, javadoc does not see this
    45      * @throws DoesNotExist   oops, javadoc does not see this
    46      * @see DoesNotExist
    46      * @see DoesNotExist
    47      */
    47      */
    48     void run() throws Exception {
    48     void run() throws Exception {
    49         File javaHome = new File(System.getProperty("java.home"));
    49         File javaHome = new File(System.getProperty("java.home"));
    50         if (javaHome.getName().equals("jre"))
       
    51             javaHome = javaHome.getParentFile();
       
    52         File javadoc = new File(new File(javaHome, "bin"), "javadoc");
    50         File javadoc = new File(new File(javaHome, "bin"), "javadoc");
    53         File testSrc = new File(System.getProperty("test.src"));
    51         File testSrc = new File(System.getProperty("test.src"));
    54 
    52 
    55         // run javadoc in separate process to ensure doclet executed under
    53         // run javadoc in separate process to ensure doclet executed under
    56         // normal user conditions w.r.t. classloader
    54         // normal user conditions w.r.t. classloader
    57         String thisClassName = TestStdDoclet.class.getName();
    55         String thisClassName = TestStdDoclet.class.getName();
    58         List<String> cmdArgs = new ArrayList<>();
    56         List<String> cmdArgs = new ArrayList<>();
    59         cmdArgs.add(javadoc.getPath());
    57         cmdArgs.add(javadoc.getPath());
    60         int i = 0;
       
    61         String prop;
       
    62         while ((prop = System.getProperty("jdk.launcher.patch." + (i++))) != null) {
       
    63             cmdArgs.add("-J-Xpatch:" + prop);
       
    64         }
       
    65         cmdArgs.addAll(Arrays.asList(
    58         cmdArgs.addAll(Arrays.asList(
    66                 "-classpath", ".", // insulates us from ambient classpath
    59                 "-classpath", ".", // insulates us from ambient classpath
    67                 "-Xdoclint:none",
    60                 "-Xdoclint:none",
    68                 "-package",
    61                 "-package",
    69                 new File(testSrc, thisClassName + ".java").getPath()
    62                 new File(testSrc, thisClassName + ".java").getPath()