langtools/test/tools/javac/processing/rounds/BaseClassesNotReRead.java
author akulyakh
Thu, 21 May 2015 11:41:04 -0700
changeset 30730 d3ce7619db2c
parent 27319 030080f03e4f
child 36526 3b41f1c69604
permissions -rw-r--r--
8076543: Add @modules as needed to the langtools tests Reviewed-by: jjg, shurailine
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
23810
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
     1
/*
30730
d3ce7619db2c 8076543: Add @modules as needed to the langtools tests
akulyakh
parents: 27319
diff changeset
     2
 * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
23810
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
     4
 *
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
     7
 * published by the Free Software Foundation.
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
     8
 *
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    13
 * accompanied this code).
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    14
 *
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    18
 *
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    21
 * questions.
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    22
 */
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    23
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    24
/*
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    25
 * @test
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    26
 * @bug 8038455
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    27
 * @summary Check that classfiles are read only once in common cases despite several rounds of
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    28
 *          annotation processing.
30730
d3ce7619db2c 8076543: Add @modules as needed to the langtools tests
akulyakh
parents: 27319
diff changeset
    29
 * @modules jdk.compiler
23810
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    30
 * @clean *
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    31
 * @run main BaseClassesNotReRead
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    32
 */
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    33
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    34
import java.io.*;
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    35
import java.util.*;
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    36
import javax.annotation.processing.*;
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    37
import javax.lang.model.*;
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    38
import javax.lang.model.element.*;
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    39
import javax.tools.*;
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    40
import javax.tools.JavaFileObject.Kind;
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    41
import com.sun.source.util.JavacTask;
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    42
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    43
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    44
@SupportedAnnotationTypes("*")
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    45
public class BaseClassesNotReRead extends AbstractProcessor {
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    46
    public static void main(String... args) throws IOException {
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    47
        new BaseClassesNotReRead().run();
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    48
    }
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    49
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    50
    void run() throws IOException {
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    51
        File sources = new File(System.getProperty("test.src"));
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    52
        JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
27319
030080f03e4f 8062348: langtools tests should close file manager (group 1)
jjg
parents: 23810
diff changeset
    53
        try (StandardJavaFileManager fm = compiler.getStandardFileManager(null, null, null)) {
030080f03e4f 8062348: langtools tests should close file manager (group 1)
jjg
parents: 23810
diff changeset
    54
            Iterable<? extends JavaFileObject> files =
030080f03e4f 8062348: langtools tests should close file manager (group 1)
jjg
parents: 23810
diff changeset
    55
                    fm.getJavaFileObjects(new File(sources, "BaseClassesNotReReadSource.java"));
030080f03e4f 8062348: langtools tests should close file manager (group 1)
jjg
parents: 23810
diff changeset
    56
            DiagnosticListener<JavaFileObject> noErrors = new DiagnosticListener<JavaFileObject>() {
030080f03e4f 8062348: langtools tests should close file manager (group 1)
jjg
parents: 23810
diff changeset
    57
                @Override
030080f03e4f 8062348: langtools tests should close file manager (group 1)
jjg
parents: 23810
diff changeset
    58
                public void report(Diagnostic<? extends JavaFileObject> diagnostic) {
030080f03e4f 8062348: langtools tests should close file manager (group 1)
jjg
parents: 23810
diff changeset
    59
                    throw new IllegalStateException(diagnostic.toString());
030080f03e4f 8062348: langtools tests should close file manager (group 1)
jjg
parents: 23810
diff changeset
    60
                }
030080f03e4f 8062348: langtools tests should close file manager (group 1)
jjg
parents: 23810
diff changeset
    61
            };
030080f03e4f 8062348: langtools tests should close file manager (group 1)
jjg
parents: 23810
diff changeset
    62
            JavaFileManager manager = new OnlyOneReadFileManager(fm);
030080f03e4f 8062348: langtools tests should close file manager (group 1)
jjg
parents: 23810
diff changeset
    63
            Iterable<String> options = Arrays.asList("-processor", "BaseClassesNotReRead");
030080f03e4f 8062348: langtools tests should close file manager (group 1)
jjg
parents: 23810
diff changeset
    64
            JavacTask task = (JavacTask) compiler.getTask(null, manager, noErrors, options, null, files);
030080f03e4f 8062348: langtools tests should close file manager (group 1)
jjg
parents: 23810
diff changeset
    65
            task.analyze();
030080f03e4f 8062348: langtools tests should close file manager (group 1)
jjg
parents: 23810
diff changeset
    66
        }
23810
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    67
    }
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    68
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    69
    int round = 1;
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    70
    public boolean process(Set<? extends TypeElement> annotations,
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    71
                           RoundEnvironment roundEnv) {
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    72
        if (round++ == 1) {
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    73
            for (int c = 1; c <= 6; c++) {
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    74
                generateSource("GenClass" + c,
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    75
                               "public class GenClass" + c + " { public void test() { } }");
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    76
            }
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    77
            for (int c = 1; c <= 3; c++) {
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    78
                generateSource("GenIntf" + c,
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    79
                               "public interface GenIntf" + c + " { public void test(); }");
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    80
            }
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    81
            generateSource("GenAnnotation",
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    82
                           "public @interface GenAnnotation { }");
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    83
            generateSource("GenException",
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    84
                           "public class GenException extends Exception { }");
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    85
        }
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    86
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    87
        return false;
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    88
    }
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    89
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    90
    private void generateSource(String name, String code) {
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    91
        Filer filer = processingEnv.getFiler();
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    92
        try (Writer out = filer.createSourceFile(name).openWriter()) {
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    93
            out.write(code);
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    94
            out.close();
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    95
        } catch (IOException e) {
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    96
            processingEnv.getMessager().printMessage(Diagnostic.Kind.ERROR, e.toString());
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    97
        }
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    98
    }
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
    99
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   100
    @Override
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   101
    public SourceVersion getSupportedSourceVersion() {
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   102
        return SourceVersion.latest();
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   103
    }
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   104
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   105
    final class OnlyOneReadFileManager extends ForwardingJavaFileManager<JavaFileManager> {
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   106
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   107
        public OnlyOneReadFileManager(JavaFileManager fileManager) {
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   108
            super(fileManager);
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   109
        }
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   110
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   111
        @Override
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   112
        public JavaFileObject getJavaFileForInput(Location location, String className, Kind kind)
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   113
                throws IOException {
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   114
            return new OnlyOneReadJavaFileObject(super.getJavaFileForInput(location, className, kind));
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   115
        }
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   116
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   117
        @Override
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   118
        public Iterable<JavaFileObject> list(Location location, String packageName, Set<Kind> kinds,
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   119
                boolean recurse) throws IOException {
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   120
            List<JavaFileObject> result = new ArrayList<>();
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   121
            for (JavaFileObject jfo : super.list(location, packageName, kinds, recurse)) {
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   122
                result.add(new OnlyOneReadJavaFileObject(jfo));
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   123
            }
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   124
            return result;
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   125
        }
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   126
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   127
        @Override
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   128
        public String inferBinaryName(Location location, JavaFileObject file) {
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   129
            return super.inferBinaryName(location,
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   130
                                         ((OnlyOneReadJavaFileObject) file).getFileObject());
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   131
        }
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   132
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   133
    }
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   134
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   135
    final class OnlyOneReadJavaFileObject extends ForwardingJavaFileObject<JavaFileObject> {
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   136
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   137
        public OnlyOneReadJavaFileObject(JavaFileObject fileObject) {
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   138
            super(fileObject);
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   139
        }
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   140
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   141
        boolean used;
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   142
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   143
        @Override
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   144
        public CharSequence getCharContent(boolean ignoreEncodingErrors) throws IOException {
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   145
            if (used) throw new IllegalStateException("Already read.");
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   146
            used = true;
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   147
            return super.getCharContent(ignoreEncodingErrors);
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   148
        }
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   149
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   150
        @Override
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   151
        public InputStream openInputStream() throws IOException {
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   152
            if (used) throw new IllegalStateException("Already read.");
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   153
            used = true;
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   154
            return super.openInputStream();
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   155
        }
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   156
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   157
        @Override
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   158
        public Reader openReader(boolean ignoreEncodingErrors) throws IOException {
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   159
            if (used) throw new IllegalStateException("Already read.");
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   160
            used = true;
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   161
            return super.openReader(ignoreEncodingErrors);
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   162
        }
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   163
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   164
        public JavaFileObject getFileObject() {
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   165
            return fileObject;
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   166
        }
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   167
    }
b92eb80925f0 8038455: Use single Context for all rounds of annotation processing
jlahoda
parents:
diff changeset
   168
}