langtools/test/tools/javac/processing/model/util/elements/doccomments/TestDocComments.java
--- a/langtools/test/tools/javac/processing/model/util/elements/doccomments/TestDocComments.java Thu Jul 17 10:55:50 2014 -0400
+++ b/langtools/test/tools/javac/processing/model/util/elements/doccomments/TestDocComments.java Thu Jul 17 09:47:25 2014 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,9 @@
* @test
* @bug 6877202 6986246
* @summary Elements.getDocComment() is not getting JavaDocComments
+ * @library /tools/javac/lib
+ * @build JavacTestingAbstractProcessor TestDocComments
+ * @run main TestDocComments
*/
import com.sun.source.tree.*;
@@ -49,8 +52,7 @@
*/
@SupportedOptions("scan")
-@SupportedAnnotationTypes("*")
-public class TestDocComments extends AbstractProcessor {
+public class TestDocComments extends JavacTestingAbstractProcessor {
enum CompileKind { API, CMD };
enum ScanKind { TREE, ELEMENT };
@@ -72,7 +74,7 @@
}
static void test(CompileKind ck, ScanKind sk) throws IOException {
- String testClasses = System.getProperty("test.classes");
+ String testClasses = System.getProperty("test.class.path");
String testSrc = System.getProperty("test.src");
File testDir = new File("test." + ck + "." + sk);
testDir.mkdirs();
@@ -136,26 +138,15 @@
// ----- Annotation processor: scan for elements and check doc comments ----
Map<String,String> options;
- Filer filer;
- Messager messager;
- Elements elements;
Trees trees;
ScanKind skind;
int round = 0;
@Override
- public SourceVersion getSupportedSourceVersion() {
- return SourceVersion.latest();
- }
-
- @Override
public void init(ProcessingEnvironment pEnv) {
super.init(pEnv);
options = pEnv.getOptions();
- filer = pEnv.getFiler();
- messager = pEnv.getMessager();
- elements = pEnv.getElementUtils();
trees = Trees.instance(processingEnv);
skind = ScanKind.valueOf(options.get("scan"));
}
@@ -271,7 +262,7 @@
// ----- Scanners to find elements -----------------------------------------
- class TestElementScanner extends ElementScanner7<Void, Void> {
+ class TestElementScanner extends ElementScanner<Void, Void> {
@Override
public Void visitExecutable(ExecutableElement e, Void _) {
check(e);
@@ -306,5 +297,4 @@
return super.visitVariable(tree, trees);
}
}
-
}