/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 6985205 6986246
* @summary access to tree positions and doc comments may be lost across annotation processing rounds
* @build TreePosRoundsTest
* @compile -proc:only -processor TreePosRoundsTest TreePosRoundsTest.java
* @run main TreePosRoundsTest
*/
// This test is an annotation processor that performs multiple rounds of
// processing, and on each round, it checks that source positions are
// available and correct.
//
// The test can be run directly as a processor from the javac command line
// or via JSR 199 by invoking the main program.
@SupportedAnnotationTypes("*")
"-proc:only",
"-processor", thisName,
"-processorpath", testClasses);
if (!ok)
throw new Exception("processing failed");
}
return SourceVersion.latest();
}
}
round++;
// Scan trees for elements, verifying source tree positions
try {
} catch (IOException ex) {
"Cannot get source: " + ex, e);
}
}
final int MAXROUNDS = 3;
return true;
}
try {
try {
} finally {
}
} catch (IOException e) {
throw new Error(e);
}
}
}
check(getCurrentPath());
return super.visitVariable(tree, _);
}
// tree.toString() does not know enough context to add ";",
// so deal with that manually...
//System.err.println(" encl: " +enclKind);
expect += ";";
}
//System.err.println("expect: " + expect);
return;
}
return;
}
//System.err.println(" found: " + found);
// allow for long lines, in which case just compare beginning and
// end of the strings
boolean equal;
} else {
}
if (!equal) {
}
}
final int MAXLEN = 32;
}
}
}