langtools/src/jdk.compiler/share/classes/com/sun/tools/javah/Util.java
author vasya
Mon, 14 Dec 2015 20:18:19 +0100
changeset 34752 9c262a013456
parent 26266 2d24bda701dc
child 40308 274367a99f98
permissions -rw-r--r--
8145342: Some copyright notices are inconsistently and ill formatted Summary: Adjusted formatting of copyright notices. Reviewed-by: darcy, alundblad
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
16560
c6c7f0c26568 8010361: fix some langtools findbugs issues
jjg
parents: 5847
diff changeset
     2
 * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
06bc494ca11e Initial load
duke
parents:
diff changeset
     4
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
06bc494ca11e Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 3996
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 3996
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    10
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
06bc494ca11e Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
06bc494ca11e Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
06bc494ca11e Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
06bc494ca11e Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
06bc494ca11e Initial load
duke
parents:
diff changeset
    16
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
06bc494ca11e Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
06bc494ca11e Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
06bc494ca11e Initial load
duke
parents:
diff changeset
    20
 *
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 3996
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 3996
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 3996
diff changeset
    23
 * questions.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    24
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    25
06bc494ca11e Initial load
duke
parents:
diff changeset
    26
package com.sun.tools.javah;
06bc494ca11e Initial load
duke
parents:
diff changeset
    27
3996
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
    28
import java.io.PrintWriter;
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
    29
import java.text.MessageFormat;
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
    30
import java.util.Locale;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    31
import java.util.ResourceBundle;
06bc494ca11e Initial load
duke
parents:
diff changeset
    32
import java.util.MissingResourceException;
3996
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
    33
import javax.tools.Diagnostic;
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
    34
import javax.tools.Diagnostic.Kind;
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
    35
import javax.tools.DiagnosticListener;
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
    36
import javax.tools.JavaFileObject;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    37
26266
2d24bda701dc 8056061: Mark implementations of public interfaces with an annotation
jlahoda
parents: 25874
diff changeset
    38
import com.sun.tools.javac.util.DefinedBy;
2d24bda701dc 8056061: Mark implementations of public interfaces with an annotation
jlahoda
parents: 25874
diff changeset
    39
import com.sun.tools.javac.util.DefinedBy.Api;
2d24bda701dc 8056061: Mark implementations of public interfaces with an annotation
jlahoda
parents: 25874
diff changeset
    40
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    41
/**
06bc494ca11e Initial load
duke
parents:
diff changeset
    42
 * Messages, verbose and error handling support.
06bc494ca11e Initial load
duke
parents:
diff changeset
    43
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    44
 * For errors, the failure modes are:
06bc494ca11e Initial load
duke
parents:
diff changeset
    45
 *      error -- User did something wrong
06bc494ca11e Initial load
duke
parents:
diff changeset
    46
 *      bug   -- Bug has occurred in javah
06bc494ca11e Initial load
duke
parents:
diff changeset
    47
 *      fatal -- We can't even find resources, so bail fast, don't localize
06bc494ca11e Initial load
duke
parents:
diff changeset
    48
 *
5847
1908176fd6e3 6944312: Potential rebranding issues in openjdk/langtools repository sources
jjg
parents: 5520
diff changeset
    49
 * <p><b>This is NOT part of any supported API.
3996
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
    50
 * If you write code that depends on this, you do so at your own
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
    51
 * risk.  This code and its internal interfaces are subject to change
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
    52
 * or deletion without notice.</b></p>
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    53
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    54
public class Util {
3996
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
    55
    /** Exit is used to replace the use of System.exit in the original javah.
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
    56
     */
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
    57
    public static class Exit extends Error {
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
    58
        private static final long serialVersionUID = 430820978114067221L;
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
    59
        Exit(int exitValue) {
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
    60
            this(exitValue, null);
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
    61
        }
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
    62
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
    63
        Exit(int exitValue, Throwable cause) {
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
    64
            super(cause);
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
    65
            this.exitValue = exitValue;
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
    66
            this.cause = cause;
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
    67
        }
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
    68
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
    69
        Exit(Exit e) {
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
    70
            this(e.exitValue, e.cause);
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
    71
        }
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
    72
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
    73
        public final int exitValue;
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
    74
        public final Throwable cause;
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
    75
    }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    76
06bc494ca11e Initial load
duke
parents:
diff changeset
    77
    /*
06bc494ca11e Initial load
duke
parents:
diff changeset
    78
     * Help for verbosity.
06bc494ca11e Initial load
duke
parents:
diff changeset
    79
     */
3996
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
    80
    public boolean verbose = false;
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
    81
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
    82
    public PrintWriter log;
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
    83
    public DiagnosticListener<? super JavaFileObject> dl;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    84
3996
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
    85
    Util(PrintWriter log, DiagnosticListener<? super JavaFileObject> dl) {
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
    86
        this.log = log;
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
    87
        this.dl = dl;
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
    88
    }
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
    89
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
    90
    public void log(String s) {
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
    91
        log.println(s);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    92
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    93
06bc494ca11e Initial load
duke
parents:
diff changeset
    94
06bc494ca11e Initial load
duke
parents:
diff changeset
    95
    /*
06bc494ca11e Initial load
duke
parents:
diff changeset
    96
     * Help for loading localized messages.
06bc494ca11e Initial load
duke
parents:
diff changeset
    97
     */
3996
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
    98
    private ResourceBundle m;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    99
3996
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
   100
    private void initMessages() throws Exit {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   101
        try {
3996
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
   102
            m = ResourceBundle.getBundle("com.sun.tools.javah.resources.l10n");
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   103
        } catch (MissingResourceException mre) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   104
            fatal("Error loading resources.  Please file a bug report.", mre);
06bc494ca11e Initial load
duke
parents:
diff changeset
   105
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   106
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   107
3996
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
   108
    private String getText(String key, Object... args) throws Exit {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   109
        if (m == null)
06bc494ca11e Initial load
duke
parents:
diff changeset
   110
            initMessages();
06bc494ca11e Initial load
duke
parents:
diff changeset
   111
        try {
3996
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
   112
            return MessageFormat.format(m.getString(key), args);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   113
        } catch (MissingResourceException e) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   114
            fatal("Key " + key + " not found in resources.", e);
06bc494ca11e Initial load
duke
parents:
diff changeset
   115
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   116
        return null; /* dead code */
06bc494ca11e Initial load
duke
parents:
diff changeset
   117
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   118
06bc494ca11e Initial load
duke
parents:
diff changeset
   119
    /*
06bc494ca11e Initial load
duke
parents:
diff changeset
   120
     * Usage message.
06bc494ca11e Initial load
duke
parents:
diff changeset
   121
     */
3996
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
   122
    public void usage() throws Exit {
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
   123
        log.println(getText("usage"));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   124
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   125
3996
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
   126
    public void version() throws Exit {
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
   127
        log.println(getText("javah.version",
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   128
                                   System.getProperty("java.version"), null));
06bc494ca11e Initial load
duke
parents:
diff changeset
   129
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   130
06bc494ca11e Initial load
duke
parents:
diff changeset
   131
    /*
06bc494ca11e Initial load
duke
parents:
diff changeset
   132
     * Failure modes.
06bc494ca11e Initial load
duke
parents:
diff changeset
   133
     */
3996
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
   134
    public void bug(String key) throws Exit {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   135
        bug(key, null);
06bc494ca11e Initial load
duke
parents:
diff changeset
   136
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   137
3996
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
   138
    public void bug(String key, Exception e) throws Exit {
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
   139
        dl.report(createDiagnostic(Diagnostic.Kind.ERROR, key));
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
   140
        dl.report(createDiagnostic(Diagnostic.Kind.NOTE, "bug.report"));
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
   141
        throw new Exit(11, e);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   142
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   143
3996
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
   144
    public void error(String key, Object... args) throws Exit {
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
   145
        dl.report(createDiagnostic(Diagnostic.Kind.ERROR, key, args));
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
   146
        throw new Exit(15);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   147
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   148
3996
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
   149
    private void fatal(String msg, Exception e) throws Exit {
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
   150
        dl.report(createDiagnostic(Diagnostic.Kind.ERROR, "", msg));
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
   151
        throw new Exit(10, e);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   152
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   153
3996
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
   154
    private Diagnostic<JavaFileObject> createDiagnostic(
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
   155
            final Diagnostic.Kind kind, final String code, final Object... args) {
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
   156
        return new Diagnostic<JavaFileObject>() {
26266
2d24bda701dc 8056061: Mark implementations of public interfaces with an annotation
jlahoda
parents: 25874
diff changeset
   157
            @DefinedBy(Api.COMPILER)
3996
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
   158
            public String getCode() {
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
   159
                return code;
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
   160
            }
26266
2d24bda701dc 8056061: Mark implementations of public interfaces with an annotation
jlahoda
parents: 25874
diff changeset
   161
            @DefinedBy(Api.COMPILER)
3996
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
   162
            public long getColumnNumber() {
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
   163
                return Diagnostic.NOPOS;
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
   164
            }
26266
2d24bda701dc 8056061: Mark implementations of public interfaces with an annotation
jlahoda
parents: 25874
diff changeset
   165
            @DefinedBy(Api.COMPILER)
3996
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
   166
            public long getEndPosition() {
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
   167
                return Diagnostic.NOPOS;
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
   168
            }
26266
2d24bda701dc 8056061: Mark implementations of public interfaces with an annotation
jlahoda
parents: 25874
diff changeset
   169
            @DefinedBy(Api.COMPILER)
3996
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
   170
            public Kind getKind() {
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
   171
                return kind;
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
   172
            }
26266
2d24bda701dc 8056061: Mark implementations of public interfaces with an annotation
jlahoda
parents: 25874
diff changeset
   173
            @DefinedBy(Api.COMPILER)
3996
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
   174
            public long getLineNumber() {
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
   175
                return Diagnostic.NOPOS;
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
   176
            }
26266
2d24bda701dc 8056061: Mark implementations of public interfaces with an annotation
jlahoda
parents: 25874
diff changeset
   177
            @DefinedBy(Api.COMPILER)
3996
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
   178
            public String getMessage(Locale locale) {
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
   179
                if (code.length() == 0)
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
   180
                    return (String) args[0];
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
   181
                return getText(code, args); // FIXME locale
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
   182
            }
26266
2d24bda701dc 8056061: Mark implementations of public interfaces with an annotation
jlahoda
parents: 25874
diff changeset
   183
            @DefinedBy(Api.COMPILER)
3996
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
   184
            public long getPosition() {
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
   185
                return Diagnostic.NOPOS;
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
   186
            }
26266
2d24bda701dc 8056061: Mark implementations of public interfaces with an annotation
jlahoda
parents: 25874
diff changeset
   187
            @DefinedBy(Api.COMPILER)
3996
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
   188
            public JavaFileObject getSource() {
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
   189
                return null;
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
   190
            }
26266
2d24bda701dc 8056061: Mark implementations of public interfaces with an annotation
jlahoda
parents: 25874
diff changeset
   191
            @DefinedBy(Api.COMPILER)
3996
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
   192
            public long getStartPosition() {
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
   193
                return Diagnostic.NOPOS;
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
   194
            }
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents: 10
diff changeset
   195
        };
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   196
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   197
}