test/langtools/tools/javac/api/TestGetElementReference.java
author jlahoda
Wed, 27 Nov 2019 09:00:01 +0100
changeset 59285 7799a51dbe30
parent 47216 71c04702a3d5
permissions -rw-r--r--
8231826: Implement javac changes for pattern matching for instanceof Reviewed-by: mcimadamore Contributed-by: brian.goetz@oracle.com, gavin.bierman@oracle.com, maurizio.cimadamore@oracle.com, srikanth.adayapalam@oracle.com, vicente.romero@oracle.com, jan.lahoda@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
17557
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
     1
/*
59285
7799a51dbe30 8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents: 47216
diff changeset
     2
 * Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
17557
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
     4
 *
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
     7
 * published by the Free Software Foundation.
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
     8
 *
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
    13
 * accompanied this code).
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
    14
 *
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
    18
 *
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
    21
 * questions.
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
    22
 */
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
    23
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
    24
/*
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
    25
 * @test
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
    26
 * @bug 8012929
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
    27
 * @summary Trees.getElement should work not only for declaration trees, but also for use-trees
30730
d3ce7619db2c 8076543: Add @modules as needed to the langtools tests
akulyakh
parents: 27319
diff changeset
    28
 * @modules jdk.compiler
17557
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
    29
 * @build TestGetElementReference
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
    30
 * @run main TestGetElementReference
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
    31
 */
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
    32
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
    33
import com.sun.source.tree.CompilationUnitTree;
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
    34
import com.sun.source.tree.Tree;
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
    35
import com.sun.source.util.*;
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
    36
import java.io.File;
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
    37
import java.io.IOException;
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
    38
import java.net.URI;
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 30730
diff changeset
    39
import java.util.ArrayList;
17557
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
    40
import java.util.Arrays;
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 30730
diff changeset
    41
import java.util.List;
17557
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
    42
import java.util.regex.Matcher;
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
    43
import java.util.regex.Pattern;
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
    44
import javax.lang.model.element.Element;
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
    45
import javax.tools.Diagnostic;
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
    46
import javax.tools.DiagnosticCollector;
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
    47
import javax.tools.JavaFileObject;
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
    48
import javax.tools.SimpleJavaFileObject;
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
    49
import javax.tools.StandardJavaFileManager;
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
    50
import javax.tools.ToolProvider;
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
    51
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
    52
public class TestGetElementReference {
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
    53
59285
7799a51dbe30 8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents: 47216
diff changeset
    54
    private static final String JDK_VERSION =
7799a51dbe30 8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents: 47216
diff changeset
    55
            Integer.toString(Runtime.getRuntime().version().feature());
7799a51dbe30 8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents: 47216
diff changeset
    56
17557
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
    57
    public static void main(String... args) throws IOException {
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 30730
diff changeset
    58
        analyze("TestGetElementReferenceData.java");
3b41f1c69604 8142968: Module System implementation
alanb
parents: 30730
diff changeset
    59
        analyze("mod/module-info.java", "mod/api/pkg/Api.java");
3b41f1c69604 8142968: Module System implementation
alanb
parents: 30730
diff changeset
    60
    }
3b41f1c69604 8142968: Module System implementation
alanb
parents: 30730
diff changeset
    61
3b41f1c69604 8142968: Module System implementation
alanb
parents: 30730
diff changeset
    62
    private static void analyze(String... fileNames) throws IOException {
27319
030080f03e4f 8062348: langtools tests should close file manager (group 1)
jjg
parents: 22444
diff changeset
    63
        try (StandardJavaFileManager fm = ToolProvider.getSystemJavaCompiler().getStandardFileManager(null, null, null)) {
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 30730
diff changeset
    64
            List<JavaFileObject> files = new ArrayList<>();
3b41f1c69604 8142968: Module System implementation
alanb
parents: 30730
diff changeset
    65
            for (String fileName : fileNames) {
3b41f1c69604 8142968: Module System implementation
alanb
parents: 30730
diff changeset
    66
                File source = new File(System.getProperty("test.src", "."), fileName.replace('/', File.separatorChar)).getAbsoluteFile();
3b41f1c69604 8142968: Module System implementation
alanb
parents: 30730
diff changeset
    67
                for (JavaFileObject f : fm.getJavaFileObjects(source)) {
3b41f1c69604 8142968: Module System implementation
alanb
parents: 30730
diff changeset
    68
                    files.add(f);
3b41f1c69604 8142968: Module System implementation
alanb
parents: 30730
diff changeset
    69
                }
3b41f1c69604 8142968: Module System implementation
alanb
parents: 30730
diff changeset
    70
            }
27319
030080f03e4f 8062348: langtools tests should close file manager (group 1)
jjg
parents: 22444
diff changeset
    71
            DiagnosticCollector<JavaFileObject> diagnostics = new DiagnosticCollector<>();
59285
7799a51dbe30 8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents: 47216
diff changeset
    72
            List<String> options = List.of("-Xjcov",
7799a51dbe30 8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents: 47216
diff changeset
    73
                                           "--enable-preview",
7799a51dbe30 8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents: 47216
diff changeset
    74
                                           "-source", JDK_VERSION);
7799a51dbe30 8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents: 47216
diff changeset
    75
            JavacTask ct = (JavacTask) ToolProvider.getSystemJavaCompiler().getTask(null, null, diagnostics, options, null, files);
27319
030080f03e4f 8062348: langtools tests should close file manager (group 1)
jjg
parents: 22444
diff changeset
    76
            Trees trees = Trees.instance(ct);
030080f03e4f 8062348: langtools tests should close file manager (group 1)
jjg
parents: 22444
diff changeset
    77
            CompilationUnitTree cut = ct.parse().iterator().next();
17557
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
    78
27319
030080f03e4f 8062348: langtools tests should close file manager (group 1)
jjg
parents: 22444
diff changeset
    79
            ct.analyze();
17557
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
    80
27319
030080f03e4f 8062348: langtools tests should close file manager (group 1)
jjg
parents: 22444
diff changeset
    81
            for (Diagnostic<? extends JavaFileObject> d : diagnostics.getDiagnostics()) {
030080f03e4f 8062348: langtools tests should close file manager (group 1)
jjg
parents: 22444
diff changeset
    82
                if (d.getKind() == Diagnostic.Kind.ERROR) {
030080f03e4f 8062348: langtools tests should close file manager (group 1)
jjg
parents: 22444
diff changeset
    83
                    throw new IllegalStateException("Should have been attributed without errors: " + diagnostics.getDiagnostics());
030080f03e4f 8062348: langtools tests should close file manager (group 1)
jjg
parents: 22444
diff changeset
    84
                }
17557
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
    85
            }
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
    86
27319
030080f03e4f 8062348: langtools tests should close file manager (group 1)
jjg
parents: 22444
diff changeset
    87
            Pattern p = Pattern.compile("/\\*getElement:(.*?)\\*/");
030080f03e4f 8062348: langtools tests should close file manager (group 1)
jjg
parents: 22444
diff changeset
    88
            Matcher m = p.matcher(cut.getSourceFile().getCharContent(false));
17557
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
    89
27319
030080f03e4f 8062348: langtools tests should close file manager (group 1)
jjg
parents: 22444
diff changeset
    90
            while (m.find()) {
030080f03e4f 8062348: langtools tests should close file manager (group 1)
jjg
parents: 22444
diff changeset
    91
                TreePath tp = pathFor(trees, cut, m.start() - 1);
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 30730
diff changeset
    92
                String expected = m.group(1);
3b41f1c69604 8142968: Module System implementation
alanb
parents: 30730
diff changeset
    93
                if (expected.startsWith("getParentPath:")) {
3b41f1c69604 8142968: Module System implementation
alanb
parents: 30730
diff changeset
    94
                    tp = tp.getParentPath();
3b41f1c69604 8142968: Module System implementation
alanb
parents: 30730
diff changeset
    95
                    expected = expected.substring("getParentPath:".length());
3b41f1c69604 8142968: Module System implementation
alanb
parents: 30730
diff changeset
    96
                }
27319
030080f03e4f 8062348: langtools tests should close file manager (group 1)
jjg
parents: 22444
diff changeset
    97
                Element found = trees.getElement(tp);
030080f03e4f 8062348: langtools tests should close file manager (group 1)
jjg
parents: 22444
diff changeset
    98
                String actual = found != null ? found.getKind() + ":" + symbolToString(found) : "<null>";
17557
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
    99
27319
030080f03e4f 8062348: langtools tests should close file manager (group 1)
jjg
parents: 22444
diff changeset
   100
                if (!expected.equals(actual)) {
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 30730
diff changeset
   101
                    throw new IllegalStateException("expected=" + expected + "; actual=" + actual + "; tree: " + tp.getLeaf());
27319
030080f03e4f 8062348: langtools tests should close file manager (group 1)
jjg
parents: 22444
diff changeset
   102
                }
17557
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
   103
            }
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
   104
        }
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
   105
    }
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
   106
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
   107
    private static TreePath pathFor(final Trees trees, final CompilationUnitTree cut, final int pos) {
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
   108
        final TreePath[] result = new TreePath[1];
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
   109
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
   110
        new TreePathScanner<Void, Void>() {
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
   111
            @Override public Void scan(Tree node, Void p) {
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
   112
                if (   node != null
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
   113
                    && trees.getSourcePositions().getStartPosition(cut, node) <= pos
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
   114
                    && pos <= trees.getSourcePositions().getEndPosition(cut, node)) {
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
   115
                    result[0] = new TreePath(getCurrentPath(), node);
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
   116
                    return super.scan(node, p);
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
   117
                }
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
   118
                return null;
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
   119
            }
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
   120
        }.scan(cut, null);
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
   121
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
   122
        return result[0];
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
   123
    }
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
   124
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
   125
    private static String symbolToString(Element el) {
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
   126
        switch (el.getKind()) {
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
   127
            case METHOD: return symbolToString(el.getEnclosingElement()) + "." + el.toString();
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
   128
            case CONSTRUCTOR: return symbolToString(el.getEnclosingElement().getEnclosingElement()) + "." + el.toString();
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
   129
            default:
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
   130
                return el.toString();
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
   131
        }
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
   132
    }
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
   133
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
   134
    static class TestFileObject extends SimpleJavaFileObject {
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
   135
        private final String text;
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
   136
        public TestFileObject(String text) {
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
   137
            super(URI.create("myfo:/Test.java"), JavaFileObject.Kind.SOURCE);
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
   138
            this.text = text;
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
   139
        }
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
   140
        @Override public CharSequence getCharContent(boolean ignoreEncodingErrors) {
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
   141
            return text;
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
   142
        }
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
   143
    }
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
   144
9c6ace1881fe 8012929: Trees.getElement should work not only for declaration trees, but also for use-trees
jlahoda
parents:
diff changeset
   145
}