langtools/test/tools/javac/lib/JavacTestingAbstractProcessor.java
author ysuenaga
Wed, 30 Mar 2016 21:05:13 +0900
changeset 37218 c7241bc368bf
parent 36526 3b41f1c69604
child 44573 245bb4e6f983
permissions -rw-r--r--
8151674: STW phases at Concurrent GC should count in PerfCounter Reviewed-by: jmasa, sla, tschatzl
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6720
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
     1
/*
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 25690
diff changeset
     2
 * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
6720
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
     4
 *
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
     7
 * published by the Free Software Foundation.
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
     8
 *
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    13
 * accompanied this code).
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    14
 *
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    18
 *
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    21
 * questions.
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    22
 */
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    23
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 25690
diff changeset
    24
import java.lang.reflect.Layer;
3b41f1c69604 8142968: Module System implementation
alanb
parents: 25690
diff changeset
    25
import java.lang.reflect.Module;
6720
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    26
import java.util.*;
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    27
import javax.annotation.processing.*;
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    28
import javax.lang.model.SourceVersion;
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    29
import javax.lang.model.util.*;
10192
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
    30
import static javax.lang.model.SourceVersion.*;
6720
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    31
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    32
/**
25690
b1dac768ab79 8050430: Provided new utility visitors supporting SourceVersion.RELEASE_9
darcy
parents: 22170
diff changeset
    33
 * An abstract annotation processor tailored to {@code javac} regression testing.
6720
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    34
 */
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    35
public abstract class JavacTestingAbstractProcessor extends AbstractProcessor {
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    36
    private static final Set<String> allAnnotations;
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    37
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    38
    static {
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    39
        Set<String> tmp = new HashSet<>();
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    40
        tmp.add("*");
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    41
        allAnnotations = Collections.unmodifiableSet(tmp);
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    42
    }
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    43
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    44
    protected Elements eltUtils;
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    45
    protected Elements elements;
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    46
    protected Types    typeUtils;
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    47
    protected Types    types;
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    48
    protected Filer    filer;
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    49
    protected Messager messager;
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    50
    protected Map<String, String> options;
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    51
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    52
    /**
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    53
     * Constructor for subclasses to call.
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    54
     */
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    55
    protected JavacTestingAbstractProcessor() {
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    56
        super();
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    57
    }
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    58
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    59
    /**
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    60
     * Return the latest source version. Unless this method is
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    61
     * overridden, an {@code IllegalStateException} will be thrown if a
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    62
     * subclass has a {@code SupportedSourceVersion} annotation.
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    63
     */
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    64
    @Override
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    65
    public SourceVersion getSupportedSourceVersion() {
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    66
        SupportedSourceVersion ssv = this.getClass().getAnnotation(SupportedSourceVersion.class);
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    67
        if (ssv != null)
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    68
            throw new IllegalStateException("SupportedSourceVersion annotation not supported here.");
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    69
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    70
        return SourceVersion.latest();
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    71
    }
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    72
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    73
    /**
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    74
     * If the processor class is annotated with {@link
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    75
     * SupportedAnnotationTypes}, return an unmodifiable set with the
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    76
     * same set of strings as the annotation.  If the class is not so
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    77
     * annotated, a one-element set containing {@code "*"} is returned
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    78
     * to indicate all annotations are processed.
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    79
     *
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    80
     * @return the names of the annotation types supported by this
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    81
     * processor, or an empty set if none
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    82
     */
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    83
    @Override
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    84
    public Set<String> getSupportedAnnotationTypes() {
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    85
        SupportedAnnotationTypes sat = this.getClass().getAnnotation(SupportedAnnotationTypes.class);
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    86
        if (sat != null)
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    87
            return super.getSupportedAnnotationTypes();
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    88
        else
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    89
            return allAnnotations;
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    90
    }
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    91
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    92
    @Override
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    93
    public void init(ProcessingEnvironment processingEnv) {
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    94
        super.init(processingEnv);
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    95
        elements = eltUtils  = processingEnv.getElementUtils();
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    96
        types = typeUtils = processingEnv.getTypeUtils();
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    97
        filer     = processingEnv.getFiler();
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    98
        messager  = processingEnv.getMessager();
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
    99
        options   = processingEnv.getOptions();
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
   100
    }
10192
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   101
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 25690
diff changeset
   102
    protected void addExports(String moduleName, String... packageNames) {
3b41f1c69604 8142968: Module System implementation
alanb
parents: 25690
diff changeset
   103
        for (String packageName : packageNames) {
3b41f1c69604 8142968: Module System implementation
alanb
parents: 25690
diff changeset
   104
            try {
3b41f1c69604 8142968: Module System implementation
alanb
parents: 25690
diff changeset
   105
                Layer layer = Layer.boot();
3b41f1c69604 8142968: Module System implementation
alanb
parents: 25690
diff changeset
   106
                Optional<Module> m = layer.findModule(moduleName);
3b41f1c69604 8142968: Module System implementation
alanb
parents: 25690
diff changeset
   107
                if (!m.isPresent())
3b41f1c69604 8142968: Module System implementation
alanb
parents: 25690
diff changeset
   108
                    throw new Error("module not found: " + moduleName);
3b41f1c69604 8142968: Module System implementation
alanb
parents: 25690
diff changeset
   109
                m.get().addExports(packageName, getClass().getModule());
3b41f1c69604 8142968: Module System implementation
alanb
parents: 25690
diff changeset
   110
            } catch (Exception e) {
3b41f1c69604 8142968: Module System implementation
alanb
parents: 25690
diff changeset
   111
                throw new Error("failed to add exports for " + moduleName + "/" + packageName);
3b41f1c69604 8142968: Module System implementation
alanb
parents: 25690
diff changeset
   112
            }
3b41f1c69604 8142968: Module System implementation
alanb
parents: 25690
diff changeset
   113
        }
3b41f1c69604 8142968: Module System implementation
alanb
parents: 25690
diff changeset
   114
    }
3b41f1c69604 8142968: Module System implementation
alanb
parents: 25690
diff changeset
   115
10192
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   116
    /*
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   117
     * The set of visitors below will directly extend the most recent
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   118
     * corresponding platform visitor type.
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   119
     */
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   120
22170
62da5257a0a7 8031360: Update langtools code base to use RELEASE_9
darcy
parents: 10192
diff changeset
   121
    @SupportedSourceVersion(RELEASE_9)
25690
b1dac768ab79 8050430: Provided new utility visitors supporting SourceVersion.RELEASE_9
darcy
parents: 22170
diff changeset
   122
    public static abstract class AbstractAnnotationValueVisitor<R, P> extends AbstractAnnotationValueVisitor9<R, P> {
10192
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   123
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   124
        /**
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   125
         * Constructor for concrete subclasses to call.
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   126
         */
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   127
        protected AbstractAnnotationValueVisitor() {
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   128
            super();
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   129
        }
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   130
    }
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   131
22170
62da5257a0a7 8031360: Update langtools code base to use RELEASE_9
darcy
parents: 10192
diff changeset
   132
    @SupportedSourceVersion(RELEASE_9)
25690
b1dac768ab79 8050430: Provided new utility visitors supporting SourceVersion.RELEASE_9
darcy
parents: 22170
diff changeset
   133
    public static abstract class AbstractElementVisitor<R, P> extends AbstractElementVisitor9<R, P> {
10192
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   134
        /**
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   135
         * Constructor for concrete subclasses to call.
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   136
         */
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   137
        protected AbstractElementVisitor(){
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   138
            super();
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   139
        }
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   140
    }
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   141
22170
62da5257a0a7 8031360: Update langtools code base to use RELEASE_9
darcy
parents: 10192
diff changeset
   142
    @SupportedSourceVersion(RELEASE_9)
25690
b1dac768ab79 8050430: Provided new utility visitors supporting SourceVersion.RELEASE_9
darcy
parents: 22170
diff changeset
   143
    public static abstract class AbstractTypeVisitor<R, P> extends AbstractTypeVisitor9<R, P> {
10192
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   144
        /**
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   145
         * Constructor for concrete subclasses to call.
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   146
         */
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   147
        protected AbstractTypeVisitor() {
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   148
            super();
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   149
        }
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   150
    }
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   151
22170
62da5257a0a7 8031360: Update langtools code base to use RELEASE_9
darcy
parents: 10192
diff changeset
   152
    @SupportedSourceVersion(RELEASE_9)
25690
b1dac768ab79 8050430: Provided new utility visitors supporting SourceVersion.RELEASE_9
darcy
parents: 22170
diff changeset
   153
    public static class ElementKindVisitor<R, P> extends ElementKindVisitor9<R, P> {
10192
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   154
        /**
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   155
         * Constructor for concrete subclasses; uses {@code null} for the
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   156
         * default value.
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   157
         */
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   158
        protected ElementKindVisitor() {
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   159
            super(null);
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   160
        }
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   161
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   162
        /**
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   163
         * Constructor for concrete subclasses; uses the argument for the
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   164
         * default value.
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   165
         *
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   166
         * @param defaultValue the value to assign to {@link #DEFAULT_VALUE}
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   167
         */
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   168
        protected ElementKindVisitor(R defaultValue) {
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   169
            super(defaultValue);
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   170
        }
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   171
    }
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   172
22170
62da5257a0a7 8031360: Update langtools code base to use RELEASE_9
darcy
parents: 10192
diff changeset
   173
    @SupportedSourceVersion(RELEASE_9)
25690
b1dac768ab79 8050430: Provided new utility visitors supporting SourceVersion.RELEASE_9
darcy
parents: 22170
diff changeset
   174
    public static class ElementScanner<R, P> extends ElementScanner9<R, P> {
10192
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   175
        /**
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   176
         * Constructor for concrete subclasses; uses {@code null} for the
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   177
         * default value.
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   178
         */
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   179
        protected ElementScanner(){
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   180
            super(null);
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   181
        }
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   182
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   183
        /**
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   184
         * Constructor for concrete subclasses; uses the argument for the
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   185
         * default value.
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   186
         */
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   187
        protected ElementScanner(R defaultValue){
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   188
            super(defaultValue);
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   189
        }
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   190
    }
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   191
22170
62da5257a0a7 8031360: Update langtools code base to use RELEASE_9
darcy
parents: 10192
diff changeset
   192
    @SupportedSourceVersion(RELEASE_9)
25690
b1dac768ab79 8050430: Provided new utility visitors supporting SourceVersion.RELEASE_9
darcy
parents: 22170
diff changeset
   193
    public static class SimpleAnnotationValueVisitor<R, P> extends SimpleAnnotationValueVisitor9<R, P> {
10192
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   194
        /**
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   195
         * Constructor for concrete subclasses; uses {@code null} for the
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   196
         * default value.
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   197
         */
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   198
        protected SimpleAnnotationValueVisitor() {
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   199
            super(null);
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   200
        }
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   201
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   202
        /**
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   203
         * Constructor for concrete subclasses; uses the argument for the
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   204
         * default value.
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   205
         *
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   206
         * @param defaultValue the value to assign to {@link #DEFAULT_VALUE}
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   207
         */
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   208
        protected SimpleAnnotationValueVisitor(R defaultValue) {
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   209
            super(defaultValue);
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   210
        }
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   211
    }
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   212
22170
62da5257a0a7 8031360: Update langtools code base to use RELEASE_9
darcy
parents: 10192
diff changeset
   213
    @SupportedSourceVersion(RELEASE_9)
25690
b1dac768ab79 8050430: Provided new utility visitors supporting SourceVersion.RELEASE_9
darcy
parents: 22170
diff changeset
   214
    public static class SimpleElementVisitor<R, P> extends SimpleElementVisitor9<R, P> {
10192
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   215
        /**
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   216
         * Constructor for concrete subclasses; uses {@code null} for the
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   217
         * default value.
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   218
         */
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   219
        protected SimpleElementVisitor(){
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   220
            super(null);
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   221
        }
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   222
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   223
        /**
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   224
         * Constructor for concrete subclasses; uses the argument for the
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   225
         * default value.
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   226
         *
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   227
         * @param defaultValue the value to assign to {@link #DEFAULT_VALUE}
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   228
         */
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   229
        protected SimpleElementVisitor(R defaultValue){
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   230
            super(defaultValue);
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   231
        }
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   232
    }
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   233
22170
62da5257a0a7 8031360: Update langtools code base to use RELEASE_9
darcy
parents: 10192
diff changeset
   234
    @SupportedSourceVersion(RELEASE_9)
25690
b1dac768ab79 8050430: Provided new utility visitors supporting SourceVersion.RELEASE_9
darcy
parents: 22170
diff changeset
   235
    public static class SimpleTypeVisitor<R, P> extends SimpleTypeVisitor9<R, P> {
10192
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   236
        /**
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   237
         * Constructor for concrete subclasses; uses {@code null} for the
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   238
         * default value.
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   239
         */
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   240
        protected SimpleTypeVisitor(){
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   241
            super(null);
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   242
        }
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   243
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   244
        /**
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   245
         * Constructor for concrete subclasses; uses the argument for the
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   246
         * default value.
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   247
         *
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   248
         * @param defaultValue the value to assign to {@link #DEFAULT_VALUE}
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   249
         */
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   250
        protected SimpleTypeVisitor(R defaultValue){
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   251
            super(defaultValue);
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   252
        }
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   253
    }
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   254
22170
62da5257a0a7 8031360: Update langtools code base to use RELEASE_9
darcy
parents: 10192
diff changeset
   255
    @SupportedSourceVersion(RELEASE_9)
25690
b1dac768ab79 8050430: Provided new utility visitors supporting SourceVersion.RELEASE_9
darcy
parents: 22170
diff changeset
   256
    public static class TypeKindVisitor<R, P> extends TypeKindVisitor9<R, P> {
10192
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   257
        /**
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   258
         * Constructor for concrete subclasses to call; uses {@code null}
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   259
         * for the default value.
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   260
         */
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   261
        protected TypeKindVisitor() {
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   262
            super(null);
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   263
        }
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   264
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   265
        /**
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   266
         * Constructor for concrete subclasses to call; uses the argument
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   267
         * for the default value.
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   268
         *
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   269
         * @param defaultValue the value to assign to {@link #DEFAULT_VALUE}
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   270
         */
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   271
        protected TypeKindVisitor(R defaultValue) {
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   272
            super(defaultValue);
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   273
        }
378321489bea 7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents: 8846
diff changeset
   274
    }
6720
f16f91662ad8 6983738: Use a JavacTestingAbstractProcessor
darcy
parents:
diff changeset
   275
}