src/jdk.compiler/share/classes/com/sun/tools/javac/code/Lint.java
author jlahoda
Mon, 21 Oct 2019 15:38:26 +0200
changeset 58713 ad69fd32778e
parent 55263 830ca7b43b95
permissions -rw-r--r--
8226585: Improve javac messages for using a preview API Summary: Avoiding deprecation for removal for APIs associated with preview features, the features are marked with an annotation, and errors/warnings are produced for them based on the annotation. Reviewed-by: erikj, mcimadamore, alanb Contributed-by: joe.darcy@oracle.com, jan.lahoda@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
43588
6a0e0ea0e93b 8172901: javac: 'opens' statement cannot specify non observable package
jjg
parents: 42822
diff changeset
     2
 * Copyright (c) 2005, 2017, 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: 5002
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: 5002
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: 5002
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 5002
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 5002
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.javac.code;
06bc494ca11e Initial load
duke
parents:
diff changeset
    27
41637
7b24b4c32ee6 8145471: javac changes for enhanced deprecation
jjg
parents: 40775
diff changeset
    28
import java.util.Arrays;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    29
import java.util.EnumSet;
06bc494ca11e Initial load
duke
parents:
diff changeset
    30
import java.util.Map;
22163
3651128c74eb 8030244: Update langtools to use Diamond
briangoetz
parents: 19941
diff changeset
    31
import java.util.concurrent.ConcurrentHashMap;
3651128c74eb 8030244: Update langtools to use Diamond
briangoetz
parents: 19941
diff changeset
    32
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    33
import com.sun.tools.javac.code.Symbol.*;
41637
7b24b4c32ee6 8145471: javac changes for enhanced deprecation
jjg
parents: 40775
diff changeset
    34
import com.sun.tools.javac.main.Option;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    35
import com.sun.tools.javac.util.Context;
06bc494ca11e Initial load
duke
parents:
diff changeset
    36
import com.sun.tools.javac.util.List;
06bc494ca11e Initial load
duke
parents:
diff changeset
    37
import com.sun.tools.javac.util.Options;
06bc494ca11e Initial load
duke
parents:
diff changeset
    38
import com.sun.tools.javac.util.Pair;
14801
d66cab4ef397 8003967: detect and remove all mutable implicit static enum fields in langtools
vromero
parents: 14369
diff changeset
    39
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    40
/**
06bc494ca11e Initial load
duke
parents:
diff changeset
    41
 * A class for handling -Xlint suboptions and @SuppresssWarnings.
06bc494ca11e Initial load
duke
parents:
diff changeset
    42
 *
5847
1908176fd6e3 6944312: Potential rebranding issues in openjdk/langtools repository sources
jjg
parents: 5846
diff changeset
    43
 *  <p><b>This is NOT part of any supported API.
1908176fd6e3 6944312: Potential rebranding issues in openjdk/langtools repository sources
jjg
parents: 5846
diff changeset
    44
 *  If you write code that depends on this, you do so at your own risk.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    45
 *  This code and its internal interfaces are subject to change or
06bc494ca11e Initial load
duke
parents:
diff changeset
    46
 *  deletion without notice.</b>
06bc494ca11e Initial load
duke
parents:
diff changeset
    47
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    48
public class Lint
06bc494ca11e Initial load
duke
parents:
diff changeset
    49
{
06bc494ca11e Initial load
duke
parents:
diff changeset
    50
    /** The context key for the root Lint object. */
22163
3651128c74eb 8030244: Update langtools to use Diamond
briangoetz
parents: 19941
diff changeset
    51
    protected static final Context.Key<Lint> lintKey = new Context.Key<>();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    52
06bc494ca11e Initial load
duke
parents:
diff changeset
    53
    /** Get the root Lint instance. */
06bc494ca11e Initial load
duke
parents:
diff changeset
    54
    public static Lint instance(Context context) {
06bc494ca11e Initial load
duke
parents:
diff changeset
    55
        Lint instance = context.get(lintKey);
06bc494ca11e Initial load
duke
parents:
diff changeset
    56
        if (instance == null)
06bc494ca11e Initial load
duke
parents:
diff changeset
    57
            instance = new Lint(context);
06bc494ca11e Initial load
duke
parents:
diff changeset
    58
        return instance;
06bc494ca11e Initial load
duke
parents:
diff changeset
    59
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    60
06bc494ca11e Initial load
duke
parents:
diff changeset
    61
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    62
     * Returns the result of combining the values in this object with
06bc494ca11e Initial load
duke
parents:
diff changeset
    63
     * the given annotation.
06bc494ca11e Initial load
duke
parents:
diff changeset
    64
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    65
    public Lint augment(Attribute.Compound attr) {
06bc494ca11e Initial load
duke
parents:
diff changeset
    66
        return augmentor.augment(this, attr);
06bc494ca11e Initial load
duke
parents:
diff changeset
    67
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    68
06bc494ca11e Initial load
duke
parents:
diff changeset
    69
06bc494ca11e Initial load
duke
parents:
diff changeset
    70
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    71
     * Returns the result of combining the values in this object with
18010
604faee85350 8004643: Reduce javac space overhead introduced with compiler support for repeating annotations
jjg
parents: 16301
diff changeset
    72
     * the metadata on the given symbol.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    73
     */
18010
604faee85350 8004643: Reduce javac space overhead introduced with compiler support for repeating annotations
jjg
parents: 16301
diff changeset
    74
    public Lint augment(Symbol sym) {
604faee85350 8004643: Reduce javac space overhead introduced with compiler support for repeating annotations
jjg
parents: 16301
diff changeset
    75
        Lint l = augmentor.augment(this, sym.getDeclarationAttributes());
604faee85350 8004643: Reduce javac space overhead introduced with compiler support for repeating annotations
jjg
parents: 16301
diff changeset
    76
        if (sym.isDeprecated()) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    77
            if (l == this)
06bc494ca11e Initial load
duke
parents:
diff changeset
    78
                l = new Lint(this);
06bc494ca11e Initial load
duke
parents:
diff changeset
    79
            l.values.remove(LintCategory.DEPRECATION);
06bc494ca11e Initial load
duke
parents:
diff changeset
    80
            l.suppressedValues.add(LintCategory.DEPRECATION);
06bc494ca11e Initial load
duke
parents:
diff changeset
    81
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
    82
        return l;
06bc494ca11e Initial load
duke
parents:
diff changeset
    83
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    84
27854
22b4bfc4e22f 8032211: Don't issue deprecation warnings on import statements
jlahoda
parents: 25874
diff changeset
    85
    /**
41637
7b24b4c32ee6 8145471: javac changes for enhanced deprecation
jjg
parents: 40775
diff changeset
    86
     * Returns a new Lint that has the given LintCategorys suppressed.
7b24b4c32ee6 8145471: javac changes for enhanced deprecation
jjg
parents: 40775
diff changeset
    87
     * @param lc one or more categories to be suppressed
27854
22b4bfc4e22f 8032211: Don't issue deprecation warnings on import statements
jlahoda
parents: 25874
diff changeset
    88
     */
41637
7b24b4c32ee6 8145471: javac changes for enhanced deprecation
jjg
parents: 40775
diff changeset
    89
    public Lint suppress(LintCategory... lc) {
27854
22b4bfc4e22f 8032211: Don't issue deprecation warnings on import statements
jlahoda
parents: 25874
diff changeset
    90
        Lint l = new Lint(this);
41637
7b24b4c32ee6 8145471: javac changes for enhanced deprecation
jjg
parents: 40775
diff changeset
    91
        l.values.removeAll(Arrays.asList(lc));
7b24b4c32ee6 8145471: javac changes for enhanced deprecation
jjg
parents: 40775
diff changeset
    92
        l.suppressedValues.addAll(Arrays.asList(lc));
27854
22b4bfc4e22f 8032211: Don't issue deprecation warnings on import statements
jlahoda
parents: 25874
diff changeset
    93
        return l;
22b4bfc4e22f 8032211: Don't issue deprecation warnings on import statements
jlahoda
parents: 25874
diff changeset
    94
    }
22b4bfc4e22f 8032211: Don't issue deprecation warnings on import statements
jlahoda
parents: 25874
diff changeset
    95
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    96
    private final AugmentVisitor augmentor;
06bc494ca11e Initial load
duke
parents:
diff changeset
    97
06bc494ca11e Initial load
duke
parents:
diff changeset
    98
    private final EnumSet<LintCategory> values;
06bc494ca11e Initial load
duke
parents:
diff changeset
    99
    private final EnumSet<LintCategory> suppressedValues;
06bc494ca11e Initial load
duke
parents:
diff changeset
   100
22163
3651128c74eb 8030244: Update langtools to use Diamond
briangoetz
parents: 19941
diff changeset
   101
    private static final Map<String, LintCategory> map = new ConcurrentHashMap<>(20);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   102
06bc494ca11e Initial load
duke
parents:
diff changeset
   103
    protected Lint(Context context) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   104
        // initialize values according to the lint options
06bc494ca11e Initial load
duke
parents:
diff changeset
   105
        Options options = Options.instance(context);
41637
7b24b4c32ee6 8145471: javac changes for enhanced deprecation
jjg
parents: 40775
diff changeset
   106
7b24b4c32ee6 8145471: javac changes for enhanced deprecation
jjg
parents: 40775
diff changeset
   107
        if (options.isSet(Option.XLINT) || options.isSet(Option.XLINT_CUSTOM, "all")) {
7b24b4c32ee6 8145471: javac changes for enhanced deprecation
jjg
parents: 40775
diff changeset
   108
            // If -Xlint or -Xlint:all is given, enable all categories by default
7b24b4c32ee6 8145471: javac changes for enhanced deprecation
jjg
parents: 40775
diff changeset
   109
            values = EnumSet.allOf(LintCategory.class);
7b24b4c32ee6 8145471: javac changes for enhanced deprecation
jjg
parents: 40775
diff changeset
   110
        } else if (options.isSet(Option.XLINT_CUSTOM, "none")) {
7b24b4c32ee6 8145471: javac changes for enhanced deprecation
jjg
parents: 40775
diff changeset
   111
            // if -Xlint:none is given, disable all categories by default
7b24b4c32ee6 8145471: javac changes for enhanced deprecation
jjg
parents: 40775
diff changeset
   112
            values = EnumSet.noneOf(LintCategory.class);
7b24b4c32ee6 8145471: javac changes for enhanced deprecation
jjg
parents: 40775
diff changeset
   113
        } else {
7b24b4c32ee6 8145471: javac changes for enhanced deprecation
jjg
parents: 40775
diff changeset
   114
            // otherwise, enable on-by-default categories
7b24b4c32ee6 8145471: javac changes for enhanced deprecation
jjg
parents: 40775
diff changeset
   115
            values = EnumSet.noneOf(LintCategory.class);
7b24b4c32ee6 8145471: javac changes for enhanced deprecation
jjg
parents: 40775
diff changeset
   116
7b24b4c32ee6 8145471: javac changes for enhanced deprecation
jjg
parents: 40775
diff changeset
   117
            Source source = Source.instance(context);
48054
702043a4cdeb 8189749: Devise strategy for making source level checks more uniform
mcimadamore
parents: 47216
diff changeset
   118
            if (source.compareTo(Source.JDK9) >= 0) {
41637
7b24b4c32ee6 8145471: javac changes for enhanced deprecation
jjg
parents: 40775
diff changeset
   119
                values.add(LintCategory.DEP_ANN);
7b24b4c32ee6 8145471: javac changes for enhanced deprecation
jjg
parents: 40775
diff changeset
   120
            }
44576
9e18c9ce29e7 8178011: Automatic module warnings
jlahoda
parents: 43588
diff changeset
   121
            values.add(LintCategory.REQUIRES_TRANSITIVE_AUTOMATIC);
43588
6a0e0ea0e93b 8172901: javac: 'opens' statement cannot specify non observable package
jjg
parents: 42822
diff changeset
   122
            values.add(LintCategory.OPENS);
42822
a84956e7ee4d 8170987: Module system implementation refresh (12/2016)
alanb
parents: 41637
diff changeset
   123
            values.add(LintCategory.MODULE);
41637
7b24b4c32ee6 8145471: javac changes for enhanced deprecation
jjg
parents: 40775
diff changeset
   124
            values.add(LintCategory.REMOVAL);
58713
ad69fd32778e 8226585: Improve javac messages for using a preview API
jlahoda
parents: 55263
diff changeset
   125
            if (!options.isSet(Option.PREVIEW)) {
ad69fd32778e 8226585: Improve javac messages for using a preview API
jlahoda
parents: 55263
diff changeset
   126
                values.add(LintCategory.PREVIEW);
ad69fd32778e 8226585: Improve javac messages for using a preview API
jlahoda
parents: 55263
diff changeset
   127
            }
41637
7b24b4c32ee6 8145471: javac changes for enhanced deprecation
jjg
parents: 40775
diff changeset
   128
        }
7b24b4c32ee6 8145471: javac changes for enhanced deprecation
jjg
parents: 40775
diff changeset
   129
7b24b4c32ee6 8145471: javac changes for enhanced deprecation
jjg
parents: 40775
diff changeset
   130
        // Look for specific overrides
7b24b4c32ee6 8145471: javac changes for enhanced deprecation
jjg
parents: 40775
diff changeset
   131
        for (LintCategory lc : LintCategory.values()) {
7b24b4c32ee6 8145471: javac changes for enhanced deprecation
jjg
parents: 40775
diff changeset
   132
            if (options.isSet(Option.XLINT_CUSTOM, lc.option)) {
7b24b4c32ee6 8145471: javac changes for enhanced deprecation
jjg
parents: 40775
diff changeset
   133
                values.add(lc);
7b24b4c32ee6 8145471: javac changes for enhanced deprecation
jjg
parents: 40775
diff changeset
   134
            } else if (options.isSet(Option.XLINT_CUSTOM, "-" + lc.option)) {
7b24b4c32ee6 8145471: javac changes for enhanced deprecation
jjg
parents: 40775
diff changeset
   135
                values.remove(lc);
7b24b4c32ee6 8145471: javac changes for enhanced deprecation
jjg
parents: 40775
diff changeset
   136
            }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   137
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   138
06bc494ca11e Initial load
duke
parents:
diff changeset
   139
        suppressedValues = EnumSet.noneOf(LintCategory.class);
06bc494ca11e Initial load
duke
parents:
diff changeset
   140
06bc494ca11e Initial load
duke
parents:
diff changeset
   141
        context.put(lintKey, this);
06bc494ca11e Initial load
duke
parents:
diff changeset
   142
        augmentor = new AugmentVisitor(context);
06bc494ca11e Initial load
duke
parents:
diff changeset
   143
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   144
06bc494ca11e Initial load
duke
parents:
diff changeset
   145
    protected Lint(Lint other) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   146
        this.augmentor = other.augmentor;
06bc494ca11e Initial load
duke
parents:
diff changeset
   147
        this.values = other.values.clone();
06bc494ca11e Initial load
duke
parents:
diff changeset
   148
        this.suppressedValues = other.suppressedValues.clone();
06bc494ca11e Initial load
duke
parents:
diff changeset
   149
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   150
6151
dd513881e71d 6957438: improve code for generating warning messages containing option names
jjg
parents: 6148
diff changeset
   151
    @Override
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   152
    public String toString() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   153
        return "Lint:[values" + values + " suppressedValues" + suppressedValues + "]";
06bc494ca11e Initial load
duke
parents:
diff changeset
   154
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   155
06bc494ca11e Initial load
duke
parents:
diff changeset
   156
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   157
     * Categories of warnings that can be generated by the compiler.
06bc494ca11e Initial load
duke
parents:
diff changeset
   158
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   159
    public enum LintCategory {
06bc494ca11e Initial load
duke
parents:
diff changeset
   160
        /**
14369
3d660d08d1f7 7153951: Add new lint option -Xlint:auxiliaryclass
ohrstrom
parents: 13689
diff changeset
   161
         * Warn when code refers to a auxiliary class that is hidden in a source file (ie source file name is
3d660d08d1f7 7153951: Add new lint option -Xlint:auxiliaryclass
ohrstrom
parents: 13689
diff changeset
   162
         * different from the class name, and the type is not properly nested) and the referring code
3d660d08d1f7 7153951: Add new lint option -Xlint:auxiliaryclass
ohrstrom
parents: 13689
diff changeset
   163
         * is not located in the same source file.
3d660d08d1f7 7153951: Add new lint option -Xlint:auxiliaryclass
ohrstrom
parents: 13689
diff changeset
   164
         */
3d660d08d1f7 7153951: Add new lint option -Xlint:auxiliaryclass
ohrstrom
parents: 13689
diff changeset
   165
        AUXILIARYCLASS("auxiliaryclass"),
3d660d08d1f7 7153951: Add new lint option -Xlint:auxiliaryclass
ohrstrom
parents: 13689
diff changeset
   166
3d660d08d1f7 7153951: Add new lint option -Xlint:auxiliaryclass
ohrstrom
parents: 13689
diff changeset
   167
        /**
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   168
         * Warn about use of unnecessary casts.
06bc494ca11e Initial load
duke
parents:
diff changeset
   169
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   170
        CAST("cast"),
06bc494ca11e Initial load
duke
parents:
diff changeset
   171
06bc494ca11e Initial load
duke
parents:
diff changeset
   172
        /**
7624
c31b0ea95b37 6999210: javac should be able to warn of anomalous conditions in classfiles
jjg
parents: 7335
diff changeset
   173
         * Warn about issues related to classfile contents
c31b0ea95b37 6999210: javac should be able to warn of anomalous conditions in classfiles
jjg
parents: 7335
diff changeset
   174
         */
c31b0ea95b37 6999210: javac should be able to warn of anomalous conditions in classfiles
jjg
parents: 7335
diff changeset
   175
        CLASSFILE("classfile"),
c31b0ea95b37 6999210: javac should be able to warn of anomalous conditions in classfiles
jjg
parents: 7335
diff changeset
   176
c31b0ea95b37 6999210: javac should be able to warn of anomalous conditions in classfiles
jjg
parents: 7335
diff changeset
   177
        /**
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   178
         * Warn about use of deprecated items.
06bc494ca11e Initial load
duke
parents:
diff changeset
   179
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   180
        DEPRECATION("deprecation"),
06bc494ca11e Initial load
duke
parents:
diff changeset
   181
06bc494ca11e Initial load
duke
parents:
diff changeset
   182
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   183
         * Warn about items which are documented with an {@code @deprecated} JavaDoc
06bc494ca11e Initial load
duke
parents:
diff changeset
   184
         * comment, but which do not have {@code @Deprecated} annotation.
06bc494ca11e Initial load
duke
parents:
diff changeset
   185
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   186
        DEP_ANN("dep-ann"),
06bc494ca11e Initial load
duke
parents:
diff changeset
   187
06bc494ca11e Initial load
duke
parents:
diff changeset
   188
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   189
         * Warn about division by constant integer 0.
06bc494ca11e Initial load
duke
parents:
diff changeset
   190
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   191
        DIVZERO("divzero"),
06bc494ca11e Initial load
duke
parents:
diff changeset
   192
06bc494ca11e Initial load
duke
parents:
diff changeset
   193
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   194
         * Warn about empty statement after if.
06bc494ca11e Initial load
duke
parents:
diff changeset
   195
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   196
        EMPTY("empty"),
06bc494ca11e Initial load
duke
parents:
diff changeset
   197
06bc494ca11e Initial load
duke
parents:
diff changeset
   198
        /**
40775
39dd3d3d369e 8161376: Introduce -Xlint:exports
jlahoda
parents: 35810
diff changeset
   199
         * Warn about issues regarding module exports.
39dd3d3d369e 8161376: Introduce -Xlint:exports
jlahoda
parents: 35810
diff changeset
   200
         */
39dd3d3d369e 8161376: Introduce -Xlint:exports
jlahoda
parents: 35810
diff changeset
   201
        EXPORTS("exports"),
39dd3d3d369e 8161376: Introduce -Xlint:exports
jlahoda
parents: 35810
diff changeset
   202
39dd3d3d369e 8161376: Introduce -Xlint:exports
jlahoda
parents: 35810
diff changeset
   203
        /**
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   204
         * Warn about falling through from one case of a switch statement to the next.
06bc494ca11e Initial load
duke
parents:
diff changeset
   205
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   206
        FALLTHROUGH("fallthrough"),
06bc494ca11e Initial load
duke
parents:
diff changeset
   207
06bc494ca11e Initial load
duke
parents:
diff changeset
   208
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   209
         * Warn about finally clauses that do not terminate normally.
06bc494ca11e Initial load
duke
parents:
diff changeset
   210
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   211
        FINALLY("finally"),
06bc494ca11e Initial load
duke
parents:
diff changeset
   212
06bc494ca11e Initial load
duke
parents:
diff changeset
   213
        /**
42822
a84956e7ee4d 8170987: Module system implementation refresh (12/2016)
alanb
parents: 41637
diff changeset
   214
         * Warn about module system related issues.
a84956e7ee4d 8170987: Module system implementation refresh (12/2016)
alanb
parents: 41637
diff changeset
   215
         */
a84956e7ee4d 8170987: Module system implementation refresh (12/2016)
alanb
parents: 41637
diff changeset
   216
        MODULE("module"),
a84956e7ee4d 8170987: Module system implementation refresh (12/2016)
alanb
parents: 41637
diff changeset
   217
a84956e7ee4d 8170987: Module system implementation refresh (12/2016)
alanb
parents: 41637
diff changeset
   218
        /**
43588
6a0e0ea0e93b 8172901: javac: 'opens' statement cannot specify non observable package
jjg
parents: 42822
diff changeset
   219
         * Warn about issues regarding module opens.
6a0e0ea0e93b 8172901: javac: 'opens' statement cannot specify non observable package
jjg
parents: 42822
diff changeset
   220
         */
6a0e0ea0e93b 8172901: javac: 'opens' statement cannot specify non observable package
jjg
parents: 42822
diff changeset
   221
        OPENS("opens"),
6a0e0ea0e93b 8172901: javac: 'opens' statement cannot specify non observable package
jjg
parents: 42822
diff changeset
   222
6a0e0ea0e93b 8172901: javac: 'opens' statement cannot specify non observable package
jjg
parents: 42822
diff changeset
   223
        /**
7335
8b390fd27190 6900037: javac should warn if earlier -source is used and bootclasspath not set
jjg
parents: 7211
diff changeset
   224
         * Warn about issues relating to use of command line options
8b390fd27190 6900037: javac should warn if earlier -source is used and bootclasspath not set
jjg
parents: 7211
diff changeset
   225
         */
8b390fd27190 6900037: javac should warn if earlier -source is used and bootclasspath not set
jjg
parents: 7211
diff changeset
   226
        OPTIONS("options"),
8b390fd27190 6900037: javac should warn if earlier -source is used and bootclasspath not set
jjg
parents: 7211
diff changeset
   227
8b390fd27190 6900037: javac should warn if earlier -source is used and bootclasspath not set
jjg
parents: 7211
diff changeset
   228
        /**
19914
d86271bd430a 8016177: structural most specific and stuckness
vromero
parents: 18010
diff changeset
   229
         * Warn about issues regarding method overloads.
d86271bd430a 8016177: structural most specific and stuckness
vromero
parents: 18010
diff changeset
   230
         */
d86271bd430a 8016177: structural most specific and stuckness
vromero
parents: 18010
diff changeset
   231
        OVERLOADS("overloads"),
d86271bd430a 8016177: structural most specific and stuckness
vromero
parents: 18010
diff changeset
   232
d86271bd430a 8016177: structural most specific and stuckness
vromero
parents: 18010
diff changeset
   233
        /**
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   234
         * Warn about issues regarding method overrides.
06bc494ca11e Initial load
duke
parents:
diff changeset
   235
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   236
        OVERRIDES("overrides"),
06bc494ca11e Initial load
duke
parents:
diff changeset
   237
06bc494ca11e Initial load
duke
parents:
diff changeset
   238
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   239
         * Warn about invalid path elements on the command line.
06bc494ca11e Initial load
duke
parents:
diff changeset
   240
         * Such warnings cannot be suppressed with the SuppressWarnings
06bc494ca11e Initial load
duke
parents:
diff changeset
   241
         * annotation.
06bc494ca11e Initial load
duke
parents:
diff changeset
   242
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   243
        PATH("path"),
06bc494ca11e Initial load
duke
parents:
diff changeset
   244
06bc494ca11e Initial load
duke
parents:
diff changeset
   245
        /**
1360
fd574e4926e3 6739427: -Xlint:processing not recognized as an option
martin
parents: 1358
diff changeset
   246
         * Warn about issues regarding annotation processing.
fd574e4926e3 6739427: -Xlint:processing not recognized as an option
martin
parents: 1358
diff changeset
   247
         */
fd574e4926e3 6739427: -Xlint:processing not recognized as an option
martin
parents: 1358
diff changeset
   248
        PROCESSING("processing"),
fd574e4926e3 6739427: -Xlint:processing not recognized as an option
martin
parents: 1358
diff changeset
   249
fd574e4926e3 6739427: -Xlint:processing not recognized as an option
martin
parents: 1358
diff changeset
   250
        /**
7335
8b390fd27190 6900037: javac should warn if earlier -source is used and bootclasspath not set
jjg
parents: 7211
diff changeset
   251
         * Warn about unchecked operations on raw types.
8b390fd27190 6900037: javac should warn if earlier -source is used and bootclasspath not set
jjg
parents: 7211
diff changeset
   252
         */
8b390fd27190 6900037: javac should warn if earlier -source is used and bootclasspath not set
jjg
parents: 7211
diff changeset
   253
        RAW("rawtypes"),
8b390fd27190 6900037: javac should warn if earlier -source is used and bootclasspath not set
jjg
parents: 7211
diff changeset
   254
8b390fd27190 6900037: javac should warn if earlier -source is used and bootclasspath not set
jjg
parents: 7211
diff changeset
   255
        /**
41637
7b24b4c32ee6 8145471: javac changes for enhanced deprecation
jjg
parents: 40775
diff changeset
   256
         * Warn about use of deprecated-for-removal items.
7b24b4c32ee6 8145471: javac changes for enhanced deprecation
jjg
parents: 40775
diff changeset
   257
         */
7b24b4c32ee6 8145471: javac changes for enhanced deprecation
jjg
parents: 40775
diff changeset
   258
        REMOVAL("removal"),
7b24b4c32ee6 8145471: javac changes for enhanced deprecation
jjg
parents: 40775
diff changeset
   259
7b24b4c32ee6 8145471: javac changes for enhanced deprecation
jjg
parents: 40775
diff changeset
   260
        /**
44576
9e18c9ce29e7 8178011: Automatic module warnings
jlahoda
parents: 43588
diff changeset
   261
         * Warn about use of automatic modules in the requires clauses.
9e18c9ce29e7 8178011: Automatic module warnings
jlahoda
parents: 43588
diff changeset
   262
         */
9e18c9ce29e7 8178011: Automatic module warnings
jlahoda
parents: 43588
diff changeset
   263
        REQUIRES_AUTOMATIC("requires-automatic"),
9e18c9ce29e7 8178011: Automatic module warnings
jlahoda
parents: 43588
diff changeset
   264
9e18c9ce29e7 8178011: Automatic module warnings
jlahoda
parents: 43588
diff changeset
   265
        /**
9e18c9ce29e7 8178011: Automatic module warnings
jlahoda
parents: 43588
diff changeset
   266
         * Warn about automatic modules in requires transitive.
9e18c9ce29e7 8178011: Automatic module warnings
jlahoda
parents: 43588
diff changeset
   267
         */
9e18c9ce29e7 8178011: Automatic module warnings
jlahoda
parents: 43588
diff changeset
   268
        REQUIRES_TRANSITIVE_AUTOMATIC("requires-transitive-automatic"),
9e18c9ce29e7 8178011: Automatic module warnings
jlahoda
parents: 43588
diff changeset
   269
9e18c9ce29e7 8178011: Automatic module warnings
jlahoda
parents: 43588
diff changeset
   270
        /**
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   271
         * Warn about Serializable classes that do not provide a serial version ID.
06bc494ca11e Initial load
duke
parents:
diff changeset
   272
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   273
        SERIAL("serial"),
06bc494ca11e Initial load
duke
parents:
diff changeset
   274
06bc494ca11e Initial load
duke
parents:
diff changeset
   275
        /**
7335
8b390fd27190 6900037: javac should warn if earlier -source is used and bootclasspath not set
jjg
parents: 7211
diff changeset
   276
         * Warn about issues relating to use of statics
8b390fd27190 6900037: javac should warn if earlier -source is used and bootclasspath not set
jjg
parents: 7211
diff changeset
   277
         */
8b390fd27190 6900037: javac should warn if earlier -source is used and bootclasspath not set
jjg
parents: 7211
diff changeset
   278
        STATIC("static"),
8b390fd27190 6900037: javac should warn if earlier -source is used and bootclasspath not set
jjg
parents: 7211
diff changeset
   279
8b390fd27190 6900037: javac should warn if earlier -source is used and bootclasspath not set
jjg
parents: 7211
diff changeset
   280
        /**
55263
830ca7b43b95 8223967: Implement Text Blocks (Preview) in the Java compiler
jlaskey
parents: 49580
diff changeset
   281
         * Warn about issues relating to use of text blocks
830ca7b43b95 8223967: Implement Text Blocks (Preview) in the Java compiler
jlaskey
parents: 49580
diff changeset
   282
         */
830ca7b43b95 8223967: Implement Text Blocks (Preview) in the Java compiler
jlaskey
parents: 49580
diff changeset
   283
        TEXT_BLOCKS("text-blocks"),
830ca7b43b95 8223967: Implement Text Blocks (Preview) in the Java compiler
jlaskey
parents: 49580
diff changeset
   284
830ca7b43b95 8223967: Implement Text Blocks (Preview) in the Java compiler
jlaskey
parents: 49580
diff changeset
   285
        /**
7335
8b390fd27190 6900037: javac should warn if earlier -source is used and bootclasspath not set
jjg
parents: 7211
diff changeset
   286
         * Warn about issues relating to use of try blocks (i.e. try-with-resources)
8b390fd27190 6900037: javac should warn if earlier -source is used and bootclasspath not set
jjg
parents: 7211
diff changeset
   287
         */
8b390fd27190 6900037: javac should warn if earlier -source is used and bootclasspath not set
jjg
parents: 7211
diff changeset
   288
        TRY("try"),
8b390fd27190 6900037: javac should warn if earlier -source is used and bootclasspath not set
jjg
parents: 7211
diff changeset
   289
8b390fd27190 6900037: javac should warn if earlier -source is used and bootclasspath not set
jjg
parents: 7211
diff changeset
   290
        /**
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   291
         * Warn about unchecked operations on raw types.
06bc494ca11e Initial load
duke
parents:
diff changeset
   292
         */
1358
a51c5f89f8af 6747671: -Xlint:rawtypes
mcimadamore
parents: 735
diff changeset
   293
        UNCHECKED("unchecked"),
a51c5f89f8af 6747671: -Xlint:rawtypes
mcimadamore
parents: 735
diff changeset
   294
a51c5f89f8af 6747671: -Xlint:rawtypes
mcimadamore
parents: 735
diff changeset
   295
        /**
5846
6df0e6bcb388 6945418: Project Coin: Simplified Varargs Method Invocation
mcimadamore
parents: 5520
diff changeset
   296
         * Warn about potentially unsafe vararg methods
6df0e6bcb388 6945418: Project Coin: Simplified Varargs Method Invocation
mcimadamore
parents: 5520
diff changeset
   297
         */
49580
62b908c9f0e6 8199194: Add javac support for preview features
mcimadamore
parents: 48054
diff changeset
   298
        VARARGS("varargs"),
62b908c9f0e6 8199194: Add javac support for preview features
mcimadamore
parents: 48054
diff changeset
   299
62b908c9f0e6 8199194: Add javac support for preview features
mcimadamore
parents: 48054
diff changeset
   300
        /**
62b908c9f0e6 8199194: Add javac support for preview features
mcimadamore
parents: 48054
diff changeset
   301
         * Warn about use of preview features.
62b908c9f0e6 8199194: Add javac support for preview features
mcimadamore
parents: 48054
diff changeset
   302
         */
62b908c9f0e6 8199194: Add javac support for preview features
mcimadamore
parents: 48054
diff changeset
   303
        PREVIEW("preview");
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   304
06bc494ca11e Initial load
duke
parents:
diff changeset
   305
        LintCategory(String option) {
3661
104c425e96aa 6873845: refine access to symbol file
jjg
parents: 1360
diff changeset
   306
            this(option, false);
104c425e96aa 6873845: refine access to symbol file
jjg
parents: 1360
diff changeset
   307
        }
104c425e96aa 6873845: refine access to symbol file
jjg
parents: 1360
diff changeset
   308
104c425e96aa 6873845: refine access to symbol file
jjg
parents: 1360
diff changeset
   309
        LintCategory(String option, boolean hidden) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   310
            this.option = option;
3661
104c425e96aa 6873845: refine access to symbol file
jjg
parents: 1360
diff changeset
   311
            this.hidden = hidden;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   312
            map.put(option, this);
06bc494ca11e Initial load
duke
parents:
diff changeset
   313
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   314
06bc494ca11e Initial load
duke
parents:
diff changeset
   315
        static LintCategory get(String option) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   316
            return map.get(option);
06bc494ca11e Initial load
duke
parents:
diff changeset
   317
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   318
168
25697c18650b 6307187: clean up code for -Xlint:options
jjg
parents: 10
diff changeset
   319
        public final String option;
3661
104c425e96aa 6873845: refine access to symbol file
jjg
parents: 1360
diff changeset
   320
        public final boolean hidden;
22163
3651128c74eb 8030244: Update langtools to use Diamond
briangoetz
parents: 19941
diff changeset
   321
    }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   322
06bc494ca11e Initial load
duke
parents:
diff changeset
   323
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   324
     * Checks if a warning category is enabled. A warning category may be enabled
06bc494ca11e Initial load
duke
parents:
diff changeset
   325
     * on the command line, or by default, and can be temporarily disabled with
06bc494ca11e Initial load
duke
parents:
diff changeset
   326
     * the SuppressWarnings annotation.
06bc494ca11e Initial load
duke
parents:
diff changeset
   327
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   328
    public boolean isEnabled(LintCategory lc) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   329
        return values.contains(lc);
06bc494ca11e Initial load
duke
parents:
diff changeset
   330
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   331
06bc494ca11e Initial load
duke
parents:
diff changeset
   332
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   333
     * Checks is a warning category has been specifically suppressed, by means
06bc494ca11e Initial load
duke
parents:
diff changeset
   334
     * of the SuppressWarnings annotation, or, in the case of the deprecated
06bc494ca11e Initial load
duke
parents:
diff changeset
   335
     * category, whether it has been implicitly suppressed by virtue of the
06bc494ca11e Initial load
duke
parents:
diff changeset
   336
     * current entity being itself deprecated.
06bc494ca11e Initial load
duke
parents:
diff changeset
   337
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   338
    public boolean isSuppressed(LintCategory lc) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   339
        return suppressedValues.contains(lc);
06bc494ca11e Initial load
duke
parents:
diff changeset
   340
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   341
06bc494ca11e Initial load
duke
parents:
diff changeset
   342
    protected static class AugmentVisitor implements Attribute.Visitor {
06bc494ca11e Initial load
duke
parents:
diff changeset
   343
        private final Context context;
06bc494ca11e Initial load
duke
parents:
diff changeset
   344
        private Symtab syms;
06bc494ca11e Initial load
duke
parents:
diff changeset
   345
        private Lint parent;
06bc494ca11e Initial load
duke
parents:
diff changeset
   346
        private Lint lint;
06bc494ca11e Initial load
duke
parents:
diff changeset
   347
06bc494ca11e Initial load
duke
parents:
diff changeset
   348
        AugmentVisitor(Context context) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   349
            // to break an ugly sequence of initialization dependencies,
06bc494ca11e Initial load
duke
parents:
diff changeset
   350
            // we defer the initialization of syms until it is needed
06bc494ca11e Initial load
duke
parents:
diff changeset
   351
            this.context = context;
06bc494ca11e Initial load
duke
parents:
diff changeset
   352
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   353
06bc494ca11e Initial load
duke
parents:
diff changeset
   354
        Lint augment(Lint parent, Attribute.Compound attr) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   355
            initSyms();
06bc494ca11e Initial load
duke
parents:
diff changeset
   356
            this.parent = parent;
06bc494ca11e Initial load
duke
parents:
diff changeset
   357
            lint = null;
06bc494ca11e Initial load
duke
parents:
diff changeset
   358
            attr.accept(this);
06bc494ca11e Initial load
duke
parents:
diff changeset
   359
            return (lint == null ? parent : lint);
06bc494ca11e Initial load
duke
parents:
diff changeset
   360
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   361
06bc494ca11e Initial load
duke
parents:
diff changeset
   362
        Lint augment(Lint parent, List<Attribute.Compound> attrs) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   363
            initSyms();
06bc494ca11e Initial load
duke
parents:
diff changeset
   364
            this.parent = parent;
06bc494ca11e Initial load
duke
parents:
diff changeset
   365
            lint = null;
06bc494ca11e Initial load
duke
parents:
diff changeset
   366
            for (Attribute.Compound a: attrs) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   367
                a.accept(this);
06bc494ca11e Initial load
duke
parents:
diff changeset
   368
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   369
            return (lint == null ? parent : lint);
06bc494ca11e Initial load
duke
parents:
diff changeset
   370
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   371
06bc494ca11e Initial load
duke
parents:
diff changeset
   372
        private void initSyms() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   373
            if (syms == null)
06bc494ca11e Initial load
duke
parents:
diff changeset
   374
                syms = Symtab.instance(context);
06bc494ca11e Initial load
duke
parents:
diff changeset
   375
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   376
06bc494ca11e Initial load
duke
parents:
diff changeset
   377
        private void suppress(LintCategory lc) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   378
            if (lint == null)
06bc494ca11e Initial load
duke
parents:
diff changeset
   379
                lint = new Lint(parent);
06bc494ca11e Initial load
duke
parents:
diff changeset
   380
            lint.suppressedValues.add(lc);
06bc494ca11e Initial load
duke
parents:
diff changeset
   381
            lint.values.remove(lc);
06bc494ca11e Initial load
duke
parents:
diff changeset
   382
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   383
06bc494ca11e Initial load
duke
parents:
diff changeset
   384
        public void visitConstant(Attribute.Constant value) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   385
            if (value.type.tsym == syms.stringType.tsym) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   386
                LintCategory lc = LintCategory.get((String) (value.value));
06bc494ca11e Initial load
duke
parents:
diff changeset
   387
                if (lc != null)
06bc494ca11e Initial load
duke
parents:
diff changeset
   388
                    suppress(lc);
06bc494ca11e Initial load
duke
parents:
diff changeset
   389
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   390
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   391
06bc494ca11e Initial load
duke
parents:
diff changeset
   392
        public void visitClass(Attribute.Class clazz) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   393
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   394
06bc494ca11e Initial load
duke
parents:
diff changeset
   395
        // If we find a @SuppressWarnings annotation, then we continue
06bc494ca11e Initial load
duke
parents:
diff changeset
   396
        // walking the tree, in order to suppress the individual warnings
06bc494ca11e Initial load
duke
parents:
diff changeset
   397
        // specified in the @SuppressWarnings annotation.
06bc494ca11e Initial load
duke
parents:
diff changeset
   398
        public void visitCompound(Attribute.Compound compound) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   399
            if (compound.type.tsym == syms.suppressWarningsType.tsym) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   400
                for (List<Pair<MethodSymbol,Attribute>> v = compound.values;
06bc494ca11e Initial load
duke
parents:
diff changeset
   401
                     v.nonEmpty(); v = v.tail) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   402
                    Pair<MethodSymbol,Attribute> value = v.head;
06bc494ca11e Initial load
duke
parents:
diff changeset
   403
                    if (value.fst.name.toString().equals("value"))
06bc494ca11e Initial load
duke
parents:
diff changeset
   404
                        value.snd.accept(this);
06bc494ca11e Initial load
duke
parents:
diff changeset
   405
                }
06bc494ca11e Initial load
duke
parents:
diff changeset
   406
06bc494ca11e Initial load
duke
parents:
diff changeset
   407
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   408
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   409
06bc494ca11e Initial load
duke
parents:
diff changeset
   410
        public void visitArray(Attribute.Array array) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   411
            for (Attribute value : array.values)
06bc494ca11e Initial load
duke
parents:
diff changeset
   412
                value.accept(this);
06bc494ca11e Initial load
duke
parents:
diff changeset
   413
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   414
06bc494ca11e Initial load
duke
parents:
diff changeset
   415
        public void visitEnum(Attribute.Enum e) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   416
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   417
06bc494ca11e Initial load
duke
parents:
diff changeset
   418
        public void visitError(Attribute.Error e) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   419
        }
22163
3651128c74eb 8030244: Update langtools to use Diamond
briangoetz
parents: 19941
diff changeset
   420
    }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   421
}