test/tools/javac/tree/TreePosRoundsTest.java

changeset 696
d4df3b6ee729
parent 695
3c9b64e55c5d
child 2525
2eb010b6cb22
     1.1 --- a/test/tools/javac/tree/TreePosRoundsTest.java	Mon Sep 27 14:20:39 2010 -0700
     1.2 +++ b/test/tools/javac/tree/TreePosRoundsTest.java	Mon Sep 27 17:28:49 2010 -0700
     1.3 @@ -23,7 +23,7 @@
     1.4  
     1.5  /*
     1.6   * @test
     1.7 - * @bug 6985205
     1.8 + * @bug 6985205 6986246
     1.9   * @summary access to tree positions and doc comments may be lost across annotation processing rounds
    1.10   * @build TreePosRoundsTest
    1.11   * @compile -proc:only -processor TreePosRoundsTest TreePosRoundsTest.java
    1.12 @@ -70,6 +70,7 @@
    1.13  
    1.14      Filer filer;
    1.15      Messager messager;
    1.16 +    Trees trees;
    1.17  
    1.18      @Override
    1.19      public SourceVersion getSupportedSourceVersion() {
    1.20 @@ -81,6 +82,7 @@
    1.21          super.init(pEnv);
    1.22          filer = pEnv.getFiler();
    1.23          messager = pEnv.getMessager();
    1.24 +        trees = Trees.instance(pEnv);
    1.25      }
    1.26  
    1.27      int round = 0;
    1.28 @@ -92,7 +94,6 @@
    1.29          // Scan trees for elements, verifying source tree positions
    1.30          for (Element e: roundEnv.getRootElements()) {
    1.31              try {
    1.32 -                Trees trees = Trees.instance(processingEnv); // cannot cache this across rounds
    1.33                  TreePath p = trees.getPath(e);
    1.34                  new TestTreeScanner(p.getCompilationUnit(), trees).scan(trees.getPath(e), null);
    1.35              } catch (IOException ex) {

mercurial