langtools/test/tools/javac/processing/environment/round/TestElementsAnnotatedWith.java
author jjg
Mon, 31 Aug 2009 19:43:06 -0700
changeset 3777 9d8c7669df64
parent 2215 dd8663d971d1
child 4551 a986317586f6
permissions -rw-r--r--
6877759: test/tools/javac/processing/environment/round/TestElementsAnnotatedWith.java leaves open file Reviewed-by: darcy
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
2215
dd8663d971d1 6498938: Faulty comparison of TypeMirror objects in getElementsAnnotatedWith implementation
darcy
parents: 10
diff changeset
     2
 * Copyright 2006-2009 Sun Microsystems, Inc.  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
06bc494ca11e Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
06bc494ca11e Initial load
duke
parents:
diff changeset
     8
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
06bc494ca11e Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
06bc494ca11e Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
06bc494ca11e Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
06bc494ca11e Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
06bc494ca11e Initial load
duke
parents:
diff changeset
    14
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
06bc494ca11e Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
06bc494ca11e Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
06bc494ca11e Initial load
duke
parents:
diff changeset
    18
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    19
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
06bc494ca11e Initial load
duke
parents:
diff changeset
    20
 * CA 95054 USA or visit www.sun.com if you need additional information or
06bc494ca11e Initial load
duke
parents:
diff changeset
    21
 * have any questions.
06bc494ca11e Initial load
duke
parents:
diff changeset
    22
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    23
06bc494ca11e Initial load
duke
parents:
diff changeset
    24
/*
06bc494ca11e Initial load
duke
parents:
diff changeset
    25
 * @test
2215
dd8663d971d1 6498938: Faulty comparison of TypeMirror objects in getElementsAnnotatedWith implementation
darcy
parents: 10
diff changeset
    26
 * @bug 6397298 6400986 6425592 6449798 6453386 6508401 6498938
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    27
 * @summary Tests that getElementsAnnotatedWith works properly.
06bc494ca11e Initial load
duke
parents:
diff changeset
    28
 * @author  Joseph D. Darcy
06bc494ca11e Initial load
duke
parents:
diff changeset
    29
 * @compile TestElementsAnnotatedWith.java
06bc494ca11e Initial load
duke
parents:
diff changeset
    30
 * @compile InheritedAnnotation.java
06bc494ca11e Initial load
duke
parents:
diff changeset
    31
 * @compile -processor TestElementsAnnotatedWith -proc:only SurfaceAnnotations.java
06bc494ca11e Initial load
duke
parents:
diff changeset
    32
 * @compile -processor TestElementsAnnotatedWith -proc:only BuriedAnnotations.java
06bc494ca11e Initial load
duke
parents:
diff changeset
    33
 * @compile -processor TestElementsAnnotatedWith -proc:only Part1.java Part2.java
2215
dd8663d971d1 6498938: Faulty comparison of TypeMirror objects in getElementsAnnotatedWith implementation
darcy
parents: 10
diff changeset
    34
 * @compile -processor TestElementsAnnotatedWith -proc:only C2.java
dd8663d971d1 6498938: Faulty comparison of TypeMirror objects in getElementsAnnotatedWith implementation
darcy
parents: 10
diff changeset
    35
 * @compile -processor TestElementsAnnotatedWith -proc:only Foo.java
dd8663d971d1 6498938: Faulty comparison of TypeMirror objects in getElementsAnnotatedWith implementation
darcy
parents: 10
diff changeset
    36
 * @compile -XD-d=. Foo.java
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    37
 * @compile -processor TestElementsAnnotatedWith -proc:only TestElementsAnnotatedWith.java
06bc494ca11e Initial load
duke
parents:
diff changeset
    38
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    39
06bc494ca11e Initial load
duke
parents:
diff changeset
    40
import java.lang.annotation.Annotation;
2215
dd8663d971d1 6498938: Faulty comparison of TypeMirror objects in getElementsAnnotatedWith implementation
darcy
parents: 10
diff changeset
    41
import java.io.*;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    42
import java.util.Collections;
06bc494ca11e Initial load
duke
parents:
diff changeset
    43
import java.util.Set;
06bc494ca11e Initial load
duke
parents:
diff changeset
    44
import java.util.HashSet;
2215
dd8663d971d1 6498938: Faulty comparison of TypeMirror objects in getElementsAnnotatedWith implementation
darcy
parents: 10
diff changeset
    45
import java.util.List;
dd8663d971d1 6498938: Faulty comparison of TypeMirror objects in getElementsAnnotatedWith implementation
darcy
parents: 10
diff changeset
    46
import java.util.ArrayList;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    47
import java.util.Arrays;
06bc494ca11e Initial load
duke
parents:
diff changeset
    48
import javax.annotation.processing.*;
2215
dd8663d971d1 6498938: Faulty comparison of TypeMirror objects in getElementsAnnotatedWith implementation
darcy
parents: 10
diff changeset
    49
import javax.tools.*;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    50
import javax.lang.model.SourceVersion;
06bc494ca11e Initial load
duke
parents:
diff changeset
    51
import javax.lang.model.element.*;
06bc494ca11e Initial load
duke
parents:
diff changeset
    52
import javax.lang.model.util.*;
06bc494ca11e Initial load
duke
parents:
diff changeset
    53
import static javax.lang.model.util.ElementFilter.*;
06bc494ca11e Initial load
duke
parents:
diff changeset
    54
06bc494ca11e Initial load
duke
parents:
diff changeset
    55
/**
06bc494ca11e Initial load
duke
parents:
diff changeset
    56
 * This processor verifies that the information returned by
06bc494ca11e Initial load
duke
parents:
diff changeset
    57
 * getElementsAnnotatedWith is consistent with the expected results
06bc494ca11e Initial load
duke
parents:
diff changeset
    58
 * stored in an AnnotatedElementInfo annotation.
06bc494ca11e Initial load
duke
parents:
diff changeset
    59
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    60
@SupportedAnnotationTypes("*")
06bc494ca11e Initial load
duke
parents:
diff changeset
    61
@AnnotatedElementInfo(annotationName="java.lang.SuppressWarnings", expectedSize=0, names={})
06bc494ca11e Initial load
duke
parents:
diff changeset
    62
public class TestElementsAnnotatedWith extends AbstractProcessor {
06bc494ca11e Initial load
duke
parents:
diff changeset
    63
06bc494ca11e Initial load
duke
parents:
diff changeset
    64
    public boolean process(Set<? extends TypeElement> annotations,
06bc494ca11e Initial load
duke
parents:
diff changeset
    65
                           RoundEnvironment roundEnvironment) {
06bc494ca11e Initial load
duke
parents:
diff changeset
    66
        Elements elementUtils = processingEnv.getElementUtils();
06bc494ca11e Initial load
duke
parents:
diff changeset
    67
06bc494ca11e Initial load
duke
parents:
diff changeset
    68
        TypeElement annotatedElementInfoElement =
06bc494ca11e Initial load
duke
parents:
diff changeset
    69
            elementUtils.getTypeElement("AnnotatedElementInfo");
06bc494ca11e Initial load
duke
parents:
diff changeset
    70
        Set<? extends Element> resultsMeta = Collections.emptySet();
06bc494ca11e Initial load
duke
parents:
diff changeset
    71
        Set<? extends Element> resultsBase = Collections.emptySet();
06bc494ca11e Initial load
duke
parents:
diff changeset
    72
06bc494ca11e Initial load
duke
parents:
diff changeset
    73
        if (!roundEnvironment.processingOver()) {
06bc494ca11e Initial load
duke
parents:
diff changeset
    74
            testNonAnnotations(roundEnvironment);
06bc494ca11e Initial load
duke
parents:
diff changeset
    75
06bc494ca11e Initial load
duke
parents:
diff changeset
    76
            // Verify AnnotatedElementInfo is present on the first
06bc494ca11e Initial load
duke
parents:
diff changeset
    77
            // specified type.
06bc494ca11e Initial load
duke
parents:
diff changeset
    78
06bc494ca11e Initial load
duke
parents:
diff changeset
    79
            TypeElement firstType = typesIn(roundEnvironment.getRootElements()).iterator().next();
06bc494ca11e Initial load
duke
parents:
diff changeset
    80
06bc494ca11e Initial load
duke
parents:
diff changeset
    81
            AnnotatedElementInfo annotatedElementInfo = firstType.getAnnotation(AnnotatedElementInfo.class);
06bc494ca11e Initial load
duke
parents:
diff changeset
    82
06bc494ca11e Initial load
duke
parents:
diff changeset
    83
            boolean failed = false;
06bc494ca11e Initial load
duke
parents:
diff changeset
    84
06bc494ca11e Initial load
duke
parents:
diff changeset
    85
            if (annotatedElementInfo == null)
06bc494ca11e Initial load
duke
parents:
diff changeset
    86
                throw new IllegalArgumentException("Missing AnnotatedElementInfo annotation on " +
06bc494ca11e Initial load
duke
parents:
diff changeset
    87
                                                  firstType);
06bc494ca11e Initial load
duke
parents:
diff changeset
    88
            else {
06bc494ca11e Initial load
duke
parents:
diff changeset
    89
                // Verify that the annotation information is as
06bc494ca11e Initial load
duke
parents:
diff changeset
    90
                // expected.
06bc494ca11e Initial load
duke
parents:
diff changeset
    91
06bc494ca11e Initial load
duke
parents:
diff changeset
    92
                Set<String> expectedNames = new HashSet<String>(Arrays.asList(annotatedElementInfo.names()));
06bc494ca11e Initial load
duke
parents:
diff changeset
    93
06bc494ca11e Initial load
duke
parents:
diff changeset
    94
                resultsMeta =
06bc494ca11e Initial load
duke
parents:
diff changeset
    95
                    roundEnvironment.
06bc494ca11e Initial load
duke
parents:
diff changeset
    96
                    getElementsAnnotatedWith(elementUtils.
06bc494ca11e Initial load
duke
parents:
diff changeset
    97
                                             getTypeElement(annotatedElementInfo.
06bc494ca11e Initial load
duke
parents:
diff changeset
    98
                                                            annotationName())) ;
06bc494ca11e Initial load
duke
parents:
diff changeset
    99
06bc494ca11e Initial load
duke
parents:
diff changeset
   100
                System.err.println("Results: " + resultsMeta);
06bc494ca11e Initial load
duke
parents:
diff changeset
   101
06bc494ca11e Initial load
duke
parents:
diff changeset
   102
                if (resultsMeta.size() != annotatedElementInfo.expectedSize()) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   103
                    failed = true;
06bc494ca11e Initial load
duke
parents:
diff changeset
   104
                    System.err.printf("Bad number of elements; expected %d, got %d%n",
06bc494ca11e Initial load
duke
parents:
diff changeset
   105
                                      annotatedElementInfo.expectedSize(), resultsMeta.size());
06bc494ca11e Initial load
duke
parents:
diff changeset
   106
                } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
   107
                    for(Element element : resultsMeta) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   108
                        String simpleName = element.getSimpleName().toString();
06bc494ca11e Initial load
duke
parents:
diff changeset
   109
                        if (!expectedNames.contains(simpleName) ) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   110
                            failed = true;
06bc494ca11e Initial load
duke
parents:
diff changeset
   111
                            System.err.println("Name ``" + simpleName + "'' not expected.");
06bc494ca11e Initial load
duke
parents:
diff changeset
   112
                        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   113
                    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   114
                }
06bc494ca11e Initial load
duke
parents:
diff changeset
   115
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   116
06bc494ca11e Initial load
duke
parents:
diff changeset
   117
            resultsBase = computeResultsBase(roundEnvironment, annotatedElementInfo.annotationName());
06bc494ca11e Initial load
duke
parents:
diff changeset
   118
06bc494ca11e Initial load
duke
parents:
diff changeset
   119
            if (!resultsMeta.equals(resultsBase)) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   120
                failed = true;
06bc494ca11e Initial load
duke
parents:
diff changeset
   121
                System.err.println("Base and Meta sets unequal;\n meta: " + resultsMeta +
06bc494ca11e Initial load
duke
parents:
diff changeset
   122
                                   "\nbase: " + resultsBase);
06bc494ca11e Initial load
duke
parents:
diff changeset
   123
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   124
06bc494ca11e Initial load
duke
parents:
diff changeset
   125
            if (failed) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   126
                System.err.println("AnnotatedElementInfo: " + annotatedElementInfo);
06bc494ca11e Initial load
duke
parents:
diff changeset
   127
                throw new RuntimeException();
06bc494ca11e Initial load
duke
parents:
diff changeset
   128
            }
2215
dd8663d971d1 6498938: Faulty comparison of TypeMirror objects in getElementsAnnotatedWith implementation
darcy
parents: 10
diff changeset
   129
dd8663d971d1 6498938: Faulty comparison of TypeMirror objects in getElementsAnnotatedWith implementation
darcy
parents: 10
diff changeset
   130
            if("TestElementsAnnotatedWith".equals(firstType.getSimpleName().toString()))
dd8663d971d1 6498938: Faulty comparison of TypeMirror objects in getElementsAnnotatedWith implementation
darcy
parents: 10
diff changeset
   131
               writeClassFile(); // Start another round to test class file input
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   132
        } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
   133
            // If processing is over without an error, the specified
06bc494ca11e Initial load
duke
parents:
diff changeset
   134
            // elements should be empty so an empty set should be returned.
06bc494ca11e Initial load
duke
parents:
diff changeset
   135
            resultsMeta = roundEnvironment.getElementsAnnotatedWith(annotatedElementInfoElement);
06bc494ca11e Initial load
duke
parents:
diff changeset
   136
            resultsBase = roundEnvironment.getElementsAnnotatedWith(AnnotatedElementInfo.class);
06bc494ca11e Initial load
duke
parents:
diff changeset
   137
            if (!resultsMeta.isEmpty())
06bc494ca11e Initial load
duke
parents:
diff changeset
   138
                throw new RuntimeException("Nonempty resultsMeta: " + resultsMeta);
06bc494ca11e Initial load
duke
parents:
diff changeset
   139
            if (!resultsBase.isEmpty())
06bc494ca11e Initial load
duke
parents:
diff changeset
   140
                throw new RuntimeException("Nonempty resultsBase: " + resultsBase);
06bc494ca11e Initial load
duke
parents:
diff changeset
   141
06bc494ca11e Initial load
duke
parents:
diff changeset
   142
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   143
        return true;
06bc494ca11e Initial load
duke
parents:
diff changeset
   144
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   145
06bc494ca11e Initial load
duke
parents:
diff changeset
   146
    private Set<? extends Element> computeResultsBase(RoundEnvironment roundEnvironment, String name) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   147
        try {
06bc494ca11e Initial load
duke
parents:
diff changeset
   148
            return roundEnvironment.
06bc494ca11e Initial load
duke
parents:
diff changeset
   149
                getElementsAnnotatedWith(Class.forName(name).asSubclass(Annotation.class));
06bc494ca11e Initial load
duke
parents:
diff changeset
   150
        } catch(ClassNotFoundException cnfe) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   151
            throw new RuntimeException(cnfe);
06bc494ca11e Initial load
duke
parents:
diff changeset
   152
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   153
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   154
06bc494ca11e Initial load
duke
parents:
diff changeset
   155
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   156
     * Verify non-annotation types result in
06bc494ca11e Initial load
duke
parents:
diff changeset
   157
     * IllegalArgumentExceptions.
06bc494ca11e Initial load
duke
parents:
diff changeset
   158
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   159
    private void testNonAnnotations(RoundEnvironment roundEnvironment) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   160
        try {
06bc494ca11e Initial load
duke
parents:
diff changeset
   161
            Set<? extends Element> elements = roundEnvironment.getElementsAnnotatedWith((Class)Object.class );
06bc494ca11e Initial load
duke
parents:
diff changeset
   162
            throw new RuntimeException("Illegal argument exception not thrown");
06bc494ca11e Initial load
duke
parents:
diff changeset
   163
        } catch(IllegalArgumentException iae) {}
06bc494ca11e Initial load
duke
parents:
diff changeset
   164
06bc494ca11e Initial load
duke
parents:
diff changeset
   165
        try {
06bc494ca11e Initial load
duke
parents:
diff changeset
   166
            Set<? extends Element> elements = roundEnvironment.getElementsAnnotatedWith(processingEnv.
06bc494ca11e Initial load
duke
parents:
diff changeset
   167
                                                                                        getElementUtils().
06bc494ca11e Initial load
duke
parents:
diff changeset
   168
                                                                                        getTypeElement("java.lang.Object") );
06bc494ca11e Initial load
duke
parents:
diff changeset
   169
            throw new RuntimeException("Illegal argument exception not thrown");
06bc494ca11e Initial load
duke
parents:
diff changeset
   170
        } catch(IllegalArgumentException iae) {}
06bc494ca11e Initial load
duke
parents:
diff changeset
   171
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   172
2215
dd8663d971d1 6498938: Faulty comparison of TypeMirror objects in getElementsAnnotatedWith implementation
darcy
parents: 10
diff changeset
   173
    /*
dd8663d971d1 6498938: Faulty comparison of TypeMirror objects in getElementsAnnotatedWith implementation
darcy
parents: 10
diff changeset
   174
     * Hack alert!  The class file read below is generated by the
dd8663d971d1 6498938: Faulty comparison of TypeMirror objects in getElementsAnnotatedWith implementation
darcy
parents: 10
diff changeset
   175
     * "@compile -XD-d=. Foo.java" directive above.  This sneakily
dd8663d971d1 6498938: Faulty comparison of TypeMirror objects in getElementsAnnotatedWith implementation
darcy
parents: 10
diff changeset
   176
     * overrides the output location to the current directory where a
dd8663d971d1 6498938: Faulty comparison of TypeMirror objects in getElementsAnnotatedWith implementation
darcy
parents: 10
diff changeset
   177
     * subsequent @compile can read the file.  This could be improved
dd8663d971d1 6498938: Faulty comparison of TypeMirror objects in getElementsAnnotatedWith implementation
darcy
parents: 10
diff changeset
   178
     * if either a new directive like @process accepted class file
dd8663d971d1 6498938: Faulty comparison of TypeMirror objects in getElementsAnnotatedWith implementation
darcy
parents: 10
diff changeset
   179
     * arguments (the javac command accepts such arguments but
dd8663d971d1 6498938: Faulty comparison of TypeMirror objects in getElementsAnnotatedWith implementation
darcy
parents: 10
diff changeset
   180
     * @compile does not) or the test.src and test.classes properties
dd8663d971d1 6498938: Faulty comparison of TypeMirror objects in getElementsAnnotatedWith implementation
darcy
parents: 10
diff changeset
   181
     * were set to be read with @compile jobs.
dd8663d971d1 6498938: Faulty comparison of TypeMirror objects in getElementsAnnotatedWith implementation
darcy
parents: 10
diff changeset
   182
     */
dd8663d971d1 6498938: Faulty comparison of TypeMirror objects in getElementsAnnotatedWith implementation
darcy
parents: 10
diff changeset
   183
    private void writeClassFile() {
dd8663d971d1 6498938: Faulty comparison of TypeMirror objects in getElementsAnnotatedWith implementation
darcy
parents: 10
diff changeset
   184
        try {
dd8663d971d1 6498938: Faulty comparison of TypeMirror objects in getElementsAnnotatedWith implementation
darcy
parents: 10
diff changeset
   185
            Filer filer = processingEnv.getFiler();
dd8663d971d1 6498938: Faulty comparison of TypeMirror objects in getElementsAnnotatedWith implementation
darcy
parents: 10
diff changeset
   186
            JavaFileObject jfo = filer.createClassFile("Foo");
dd8663d971d1 6498938: Faulty comparison of TypeMirror objects in getElementsAnnotatedWith implementation
darcy
parents: 10
diff changeset
   187
            OutputStream os = jfo.openOutputStream();
dd8663d971d1 6498938: Faulty comparison of TypeMirror objects in getElementsAnnotatedWith implementation
darcy
parents: 10
diff changeset
   188
            // Copy the bytes over
dd8663d971d1 6498938: Faulty comparison of TypeMirror objects in getElementsAnnotatedWith implementation
darcy
parents: 10
diff changeset
   189
            System.out.println((new File(".")).getAbsolutePath());
dd8663d971d1 6498938: Faulty comparison of TypeMirror objects in getElementsAnnotatedWith implementation
darcy
parents: 10
diff changeset
   190
            InputStream io = new BufferedInputStream(new FileInputStream(new File(".", "Foo.class")));
3777
9d8c7669df64 6877759: test/tools/javac/processing/environment/round/TestElementsAnnotatedWith.java leaves open file
jjg
parents: 2215
diff changeset
   191
            try {
9d8c7669df64 6877759: test/tools/javac/processing/environment/round/TestElementsAnnotatedWith.java leaves open file
jjg
parents: 2215
diff changeset
   192
                int datum = io.read();
9d8c7669df64 6877759: test/tools/javac/processing/environment/round/TestElementsAnnotatedWith.java leaves open file
jjg
parents: 2215
diff changeset
   193
                while(datum != -1) {
9d8c7669df64 6877759: test/tools/javac/processing/environment/round/TestElementsAnnotatedWith.java leaves open file
jjg
parents: 2215
diff changeset
   194
                    os.write(datum);
9d8c7669df64 6877759: test/tools/javac/processing/environment/round/TestElementsAnnotatedWith.java leaves open file
jjg
parents: 2215
diff changeset
   195
                    datum = io.read();
9d8c7669df64 6877759: test/tools/javac/processing/environment/round/TestElementsAnnotatedWith.java leaves open file
jjg
parents: 2215
diff changeset
   196
                }
9d8c7669df64 6877759: test/tools/javac/processing/environment/round/TestElementsAnnotatedWith.java leaves open file
jjg
parents: 2215
diff changeset
   197
            } finally {
9d8c7669df64 6877759: test/tools/javac/processing/environment/round/TestElementsAnnotatedWith.java leaves open file
jjg
parents: 2215
diff changeset
   198
                io.close();
2215
dd8663d971d1 6498938: Faulty comparison of TypeMirror objects in getElementsAnnotatedWith implementation
darcy
parents: 10
diff changeset
   199
            }
dd8663d971d1 6498938: Faulty comparison of TypeMirror objects in getElementsAnnotatedWith implementation
darcy
parents: 10
diff changeset
   200
            os.close();
3777
9d8c7669df64 6877759: test/tools/javac/processing/environment/round/TestElementsAnnotatedWith.java leaves open file
jjg
parents: 2215
diff changeset
   201
        } catch (IOException ioe) {
9d8c7669df64 6877759: test/tools/javac/processing/environment/round/TestElementsAnnotatedWith.java leaves open file
jjg
parents: 2215
diff changeset
   202
            throw new RuntimeException(ioe);
2215
dd8663d971d1 6498938: Faulty comparison of TypeMirror objects in getElementsAnnotatedWith implementation
darcy
parents: 10
diff changeset
   203
        }
dd8663d971d1 6498938: Faulty comparison of TypeMirror objects in getElementsAnnotatedWith implementation
darcy
parents: 10
diff changeset
   204
dd8663d971d1 6498938: Faulty comparison of TypeMirror objects in getElementsAnnotatedWith implementation
darcy
parents: 10
diff changeset
   205
dd8663d971d1 6498938: Faulty comparison of TypeMirror objects in getElementsAnnotatedWith implementation
darcy
parents: 10
diff changeset
   206
    }
dd8663d971d1 6498938: Faulty comparison of TypeMirror objects in getElementsAnnotatedWith implementation
darcy
parents: 10
diff changeset
   207
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   208
    @Override
06bc494ca11e Initial load
duke
parents:
diff changeset
   209
    public SourceVersion getSupportedSourceVersion() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   210
        return SourceVersion.latest();
06bc494ca11e Initial load
duke
parents:
diff changeset
   211
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   212
}