test/langtools/jdk/javadoc/tool/api/basic/GetTask_DocletClassTest.java
author bobv
Tue, 07 Nov 2017 10:30:53 -0500
changeset 47801 c7b50c23ea71
parent 47216 71c04702a3d5
permissions -rw-r--r--
8190283: Default heap sizing options select a MaxHeapSize larger than available physical memory in some cases Reviewed-by: tschatzl, sjohanss
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
14545
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
     1
/*
30730
d3ce7619db2c 8076543: Add @modules as needed to the langtools tests
akulyakh
parents: 27319
diff changeset
     2
 * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
14545
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
     4
 *
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
     7
 * published by the Free Software Foundation.
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
     8
 *
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    13
 * accompanied this code).
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    14
 *
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    18
 *
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    21
 * questions.
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    22
 */
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    23
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    24
/*
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    25
 * @test
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    26
 * @bug 6493690
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    27
 * @summary javadoc should have a javax.tools.Tool service provider
30730
d3ce7619db2c 8076543: Add @modules as needed to the langtools tests
akulyakh
parents: 27319
diff changeset
    28
 * @modules jdk.javadoc
14545
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    29
 * @build APITest
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    30
 * @run main GetTask_DocletClassTest
31004
dc33ef3ba667 8075546: Add tiered testing definitions to the langtools repo
darcy
parents: 30730
diff changeset
    31
 * @key randomness
14545
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    32
 */
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    33
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    34
import java.io.File;
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    35
import java.util.Arrays;
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    36
import java.util.Collections;
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    37
import java.util.Random;
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    38
import javax.tools.DocumentationTool;
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    39
import javax.tools.DocumentationTool.DocumentationTask;
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    40
import javax.tools.JavaFileObject;
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    41
import javax.tools.StandardJavaFileManager;
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    42
import javax.tools.ToolProvider;
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    43
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31004
diff changeset
    44
import com.sun.javadoc.DocErrorReporter;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31004
diff changeset
    45
import com.sun.javadoc.LanguageVersion;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31004
diff changeset
    46
import com.sun.javadoc.RootDoc;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31004
diff changeset
    47
14545
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    48
/**
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    49
 * Tests for DocumentationTool.getTask  docletClass  parameter.
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    50
 */
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    51
public class GetTask_DocletClassTest extends APITest {
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    52
    public static void main(String... args) throws Exception {
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    53
        new GetTask_DocletClassTest().run();
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    54
    }
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    55
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    56
    /**
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    57
     * Verify that an alternate doclet can be specified.
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    58
     *
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    59
     * There is no standard interface or superclass for a doclet;
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    60
     * the only requirement is that it provides static methods that
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    61
     * can be invoked via reflection. So, for now, the doclet is
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    62
     * specified as a class.
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    63
     * Because we cannot create and use a unique instance of the class,
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    64
     * we verify that the doclet has been called by having it record
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    65
     * (in a static field!) the comment from the last time it was invoked,
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    66
     * which is randomly generated each time the test is run.
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    67
     */
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    68
    @Test
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    69
    public void testDoclet() throws Exception {
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    70
        Random r = new Random();
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    71
        int key = r.nextInt();
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    72
        JavaFileObject srcFile = createSimpleJavaFileObject(
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    73
                "pkg/C",
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    74
                "package pkg; /** " + key + "*/ public class C { }");
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    75
        DocumentationTool tool = ToolProvider.getSystemDocumentationTool();
27319
030080f03e4f 8062348: langtools tests should close file manager (group 1)
jjg
parents: 14545
diff changeset
    76
        try (StandardJavaFileManager fm = tool.getStandardFileManager(null, null, null)) {
030080f03e4f 8062348: langtools tests should close file manager (group 1)
jjg
parents: 14545
diff changeset
    77
            File outDir = getOutDir();
030080f03e4f 8062348: langtools tests should close file manager (group 1)
jjg
parents: 14545
diff changeset
    78
            fm.setLocation(DocumentationTool.Location.DOCUMENTATION_OUTPUT, Arrays.asList(outDir));
030080f03e4f 8062348: langtools tests should close file manager (group 1)
jjg
parents: 14545
diff changeset
    79
            Iterable<? extends JavaFileObject> files = Arrays.asList(srcFile);
030080f03e4f 8062348: langtools tests should close file manager (group 1)
jjg
parents: 14545
diff changeset
    80
            DocumentationTask t = tool.getTask(null, fm, null, TestDoclet.class, null, files);
030080f03e4f 8062348: langtools tests should close file manager (group 1)
jjg
parents: 14545
diff changeset
    81
            if (t.call()) {
030080f03e4f 8062348: langtools tests should close file manager (group 1)
jjg
parents: 14545
diff changeset
    82
                System.err.println("task succeeded");
030080f03e4f 8062348: langtools tests should close file manager (group 1)
jjg
parents: 14545
diff changeset
    83
                if (TestDoclet.lastCaller.equals(String.valueOf(key)))
030080f03e4f 8062348: langtools tests should close file manager (group 1)
jjg
parents: 14545
diff changeset
    84
                    System.err.println("found expected key: " + key);
030080f03e4f 8062348: langtools tests should close file manager (group 1)
jjg
parents: 14545
diff changeset
    85
                else
030080f03e4f 8062348: langtools tests should close file manager (group 1)
jjg
parents: 14545
diff changeset
    86
                    error("Expected key not found");
030080f03e4f 8062348: langtools tests should close file manager (group 1)
jjg
parents: 14545
diff changeset
    87
                checkFiles(outDir, Collections.<String>emptySet());
030080f03e4f 8062348: langtools tests should close file manager (group 1)
jjg
parents: 14545
diff changeset
    88
            } else {
030080f03e4f 8062348: langtools tests should close file manager (group 1)
jjg
parents: 14545
diff changeset
    89
                throw new Exception("task failed");
030080f03e4f 8062348: langtools tests should close file manager (group 1)
jjg
parents: 14545
diff changeset
    90
            }
14545
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    91
        }
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    92
    }
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    93
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    94
    public static class TestDoclet {
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    95
        static String lastCaller;
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    96
        public static boolean start(RootDoc root) {
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    97
            lastCaller = root.classNamed("pkg.C").commentText().trim();
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    98
            return true;
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
    99
        }
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
   100
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
   101
        public static int optionLength(String option) {
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
   102
            return 0;  // default is option unknown
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
   103
        }
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
   104
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
   105
        public static boolean validOptions(String options[][],
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
   106
                DocErrorReporter reporter) {
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
   107
            return true;  // default is options are valid
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
   108
        }
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
   109
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
   110
        public static LanguageVersion languageVersion() {
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
   111
            return LanguageVersion.JAVA_1_1;
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
   112
        }
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
   113
    }
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
   114
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
   115
    /**
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
   116
     * Verify that exceptions from a doclet are thrown as expected.
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
   117
     */
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
   118
    @Test
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
   119
    public void testBadDoclet() throws Exception {
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
   120
        JavaFileObject srcFile = createSimpleJavaFileObject();
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
   121
        DocumentationTool tool = ToolProvider.getSystemDocumentationTool();
27319
030080f03e4f 8062348: langtools tests should close file manager (group 1)
jjg
parents: 14545
diff changeset
   122
        try (StandardJavaFileManager fm = tool.getStandardFileManager(null, null, null)) {
030080f03e4f 8062348: langtools tests should close file manager (group 1)
jjg
parents: 14545
diff changeset
   123
            File outDir = getOutDir();
030080f03e4f 8062348: langtools tests should close file manager (group 1)
jjg
parents: 14545
diff changeset
   124
            fm.setLocation(DocumentationTool.Location.DOCUMENTATION_OUTPUT, Arrays.asList(outDir));
030080f03e4f 8062348: langtools tests should close file manager (group 1)
jjg
parents: 14545
diff changeset
   125
            Iterable<? extends JavaFileObject> files = Arrays.asList(srcFile);
030080f03e4f 8062348: langtools tests should close file manager (group 1)
jjg
parents: 14545
diff changeset
   126
            DocumentationTask t = tool.getTask(null, fm, null, BadDoclet.class, null, files);
030080f03e4f 8062348: langtools tests should close file manager (group 1)
jjg
parents: 14545
diff changeset
   127
            try {
030080f03e4f 8062348: langtools tests should close file manager (group 1)
jjg
parents: 14545
diff changeset
   128
                t.call();
030080f03e4f 8062348: langtools tests should close file manager (group 1)
jjg
parents: 14545
diff changeset
   129
                error("call completed without exception");
030080f03e4f 8062348: langtools tests should close file manager (group 1)
jjg
parents: 14545
diff changeset
   130
            } catch (RuntimeException e) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31004
diff changeset
   131
                e.printStackTrace();
27319
030080f03e4f 8062348: langtools tests should close file manager (group 1)
jjg
parents: 14545
diff changeset
   132
                Throwable c = e.getCause();
030080f03e4f 8062348: langtools tests should close file manager (group 1)
jjg
parents: 14545
diff changeset
   133
                if (c.getClass() == UnexpectedError.class)
030080f03e4f 8062348: langtools tests should close file manager (group 1)
jjg
parents: 14545
diff changeset
   134
                    System.err.println("exception caught as expected: " + c);
030080f03e4f 8062348: langtools tests should close file manager (group 1)
jjg
parents: 14545
diff changeset
   135
                else
030080f03e4f 8062348: langtools tests should close file manager (group 1)
jjg
parents: 14545
diff changeset
   136
                    throw e;
030080f03e4f 8062348: langtools tests should close file manager (group 1)
jjg
parents: 14545
diff changeset
   137
            }
14545
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
   138
        }
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
   139
    }
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
   140
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
   141
    public static class UnexpectedError extends Error { }
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
   142
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
   143
    public static class BadDoclet {
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
   144
        public static boolean start(RootDoc root) {
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
   145
            throw new UnexpectedError();
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
   146
        }
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
   147
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
   148
        public static int optionLength(String option) {
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
   149
            return 0;  // default is option unknown
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
   150
        }
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
   151
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
   152
        public static boolean validOptions(String options[][],
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
   153
                DocErrorReporter reporter) {
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
   154
            return true;  // default is options are valid
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
   155
        }
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
   156
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
   157
        public static LanguageVersion languageVersion() {
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
   158
            return LanguageVersion.JAVA_1_1;
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
   159
        }
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
   160
    }
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
   161
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
   162
}
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
diff changeset
   163