Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Arthanareeswaran2018-03-21 11:28:43 -0400
committerJay Arthanareeswaran2018-03-21 11:28:43 -0400
commit9546f62f3065238a1d1e23f5e6b627106cf310bb (patch)
tree517b00db55f764fba8743cca50fad44070acf87b /org.eclipse.jdt.compiler.apt.tests
parente45436815d92043eff8111041fd0e5f1534397bd (diff)
parenta286dadafc4faa9471b30f800d840084d9a79545 (diff)
downloadeclipse.jdt.core-9546f62f3065238a1d1e23f5e6b627106cf310bb.tar.gz
eclipse.jdt.core-9546f62f3065238a1d1e23f5e6b627106cf310bb.tar.xz
eclipse.jdt.core-9546f62f3065238a1d1e23f5e6b627106cf310bb.zip
Merge remote-tracking branch 'origin/R4_7_maintenance'I20180322-0645I20180322-0225I20180321-2000
# Conflicts: # org.eclipse.jdt.annotation/pom.xml # org.eclipse.jdt.annotation_v1/pom.xml # org.eclipse.jdt.apt.core/META-INF/MANIFEST.MF # org.eclipse.jdt.apt.core/pom.xml # org.eclipse.jdt.apt.pluggable.core/pom.xml # org.eclipse.jdt.apt.pluggable.tests/pom.xml # org.eclipse.jdt.apt.tests/META-INF/MANIFEST.MF # org.eclipse.jdt.apt.tests/pom.xml # org.eclipse.jdt.apt.ui/pom.xml # org.eclipse.jdt.compiler.apt.tests/META-INF/MANIFEST.MF # org.eclipse.jdt.compiler.apt.tests/lib/apttestprocessors8.jar # org.eclipse.jdt.compiler.apt.tests/pom.xml # org.eclipse.jdt.compiler.apt/META-INF/MANIFEST.MF # org.eclipse.jdt.compiler.apt/build.properties # org.eclipse.jdt.compiler.apt/pom.xml # org.eclipse.jdt.compiler.apt/src/org/eclipse/jdt/internal/compiler/apt/model/ModuleElementImpl.java # org.eclipse.jdt.compiler.tool.tests/META-INF/MANIFEST.MF # org.eclipse.jdt.compiler.tool.tests/build.properties # org.eclipse.jdt.compiler.tool.tests/pom.xml # org.eclipse.jdt.compiler.tool/META-INF/MANIFEST.MF # org.eclipse.jdt.compiler.tool/pom.xml # org.eclipse.jdt.core.tests.builder/META-INF/MANIFEST.MF # org.eclipse.jdt.core.tests.builder/pom.xml # org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/PackageInfoTest.java # org.eclipse.jdt.core.tests.compiler/META-INF/MANIFEST.MF # org.eclipse.jdt.core.tests.compiler/pom.xml # org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/TestAll.java # org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java # org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java # org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java # org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Deprecated9Test.java # org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest_1_8.java # org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JSR335ClassFileTest.java # org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LambdaExpressionsTest.java # org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MethodParametersAttributeTest.java # org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ModuleCompilationTests.java # org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NegativeLambdaExpressionsTest.java # org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullTypeAnnotationTest.java # org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TestAll.java # org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/dom/StandAloneASTParserTest.java # org.eclipse.jdt.core.tests.model/META-INF/MANIFEST.MF # org.eclipse.jdt.core.tests.model/pom.xml # org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunAllJava9Tests.java # org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter18Test.java # org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter9Test.java # org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST8_2.java # org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests9.java # org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ExternalAnnotations9Test.java # org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/Java9ElementTests.java # org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaConventionTests.java # org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaElement8Tests.java # org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugs9Tests.java # org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ModuleBuilderTests.java # org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/RunCompletionModelTests.java # org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/RunJavaSearchTests.java # org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/TypeResolveTests.java # org.eclipse.jdt.core.tests.performance/META-INF/MANIFEST.MF # org.eclipse.jdt.core.tests.performance/pom.xml # org.eclipse.jdt.core/META-INF/MANIFEST.MF # org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathJep247.java # org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathJrt.java # org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathLocation.java # org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/FileSystem.java # org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/Main.java # org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java # org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/SelectionEngine.java # org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionParser.java # org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/IProblem.java # org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java # org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ForeachStatement.java # org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LambdaExpression.java # org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LocalDeclaration.java # org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ReferenceExpression.java # org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java # org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/AnnotatableTypeSystem.java # org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java # org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/FieldBinding.java # org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/InferenceContext18.java # org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/LocalVariableBinding.java # org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodBinding.java # org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/RawTypeBinding.java # org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java # org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceModuleBinding.java # org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java # org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeConstants.java # org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeSystem.java # org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeVariableBinding.java # org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java # org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties # org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AST.java # org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SimpleType.java # org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/NaiveASTFlattener.java # org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFlattener.java # org.eclipse.jdt.core/model/org/eclipse/jdt/core/IModuleDescription.java # org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaCore.java # org.eclipse.jdt.core/model/org/eclipse/jdt/core/provisional/JavaModelAccess.java # org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/AbstractModule.java # org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CompilationUnitStructureRequestor.java # org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JarPackageFragmentRoot.java # org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaProject.java # org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ModuleUpdater.java # org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/NameLookup.java # org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/PackageFragmentRoot.java # org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SelectionRequestor.java # org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathJrt.java # org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathLocation.java # org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/NameEnvironment.java # org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/messages.properties # org.eclipse.jdt.core/pom.xml # pom.xml # tests-pom/pom.xml Change-Id: I4f6a08a4ac7f604601da07c2829147d99afb0c92
Diffstat (limited to 'org.eclipse.jdt.compiler.apt.tests')
-rw-r--r--org.eclipse.jdt.compiler.apt.tests/.classpath2
-rw-r--r--org.eclipse.jdt.compiler.apt.tests/build.properties6
-rw-r--r--org.eclipse.jdt.compiler.apt.tests/java10/java10api.jarbin0 -> 109915 bytes
-rw-r--r--org.eclipse.jdt.compiler.apt.tests/java9/java9api.jarbin25089 -> 0 bytes
-rw-r--r--org.eclipse.jdt.compiler.apt.tests/lib/apttestprocessors8.jarbin233186 -> 235791 bytes
-rw-r--r--org.eclipse.jdt.compiler.apt.tests/processors/org/eclipse/jdt/compiler/apt/tests/processors/inherited/ArgsConstructorProcessor.java1
-rw-r--r--org.eclipse.jdt.compiler.apt.tests/processors/org/eclipse/jdt/compiler/apt/tests/processors/visitors/VisitorProc.java4
-rw-r--r--org.eclipse.jdt.compiler.apt.tests/processors8/org/eclipse/jdt/compiler/apt/tests/processors/elements/Java9ElementProcessor.java73
-rw-r--r--org.eclipse.jdt.compiler.apt.tests/processors8/org/eclipse/jdt/compiler/apt/tests/processors/util/TestDirectiveVisitor.java32
-rw-r--r--org.eclipse.jdt.compiler.apt.tests/src/org/eclipse/jdt/compiler/apt/tests/Java9ElementsTests.java11
10 files changed, 121 insertions, 8 deletions
diff --git a/org.eclipse.jdt.compiler.apt.tests/.classpath b/org.eclipse.jdt.compiler.apt.tests/.classpath
index 2dc14fa091..df856ce433 100644
--- a/org.eclipse.jdt.compiler.apt.tests/.classpath
+++ b/org.eclipse.jdt.compiler.apt.tests/.classpath
@@ -4,7 +4,7 @@
<classpathentry kind="src" output="binprocessors" path="processors"/>
<classpathentry kind="src" output="binprocessors8" path="processors8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="lib" path="java9/java9api.jar"/>
+ <classpathentry kind="lib" path="java10/java10api.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/org.eclipse.jdt.compiler.apt.tests/build.properties b/org.eclipse.jdt.compiler.apt.tests/build.properties
index 7df12f4db2..02efcb0107 100644
--- a/org.eclipse.jdt.compiler.apt.tests/build.properties
+++ b/org.eclipse.jdt.compiler.apt.tests/build.properties
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2006, 2017 BEA Systems Inc. and others
+# Copyright (c) 2006, 2018 BEA Systems Inc. and others
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
@@ -20,9 +20,9 @@ bin.includes = about.html,\
test.xml,\
META-INF/,\
resources/,\
- java9/,\
+ java10/,\
lib/,\
.
src.includes = about.html
compilerArg=-proc:none
-jars.extra.classpath = java9/java9api.jar
+jars.extra.classpath = java10/java10api.jar
diff --git a/org.eclipse.jdt.compiler.apt.tests/java10/java10api.jar b/org.eclipse.jdt.compiler.apt.tests/java10/java10api.jar
new file mode 100644
index 0000000000..464b69134f
--- /dev/null
+++ b/org.eclipse.jdt.compiler.apt.tests/java10/java10api.jar
Binary files differ
diff --git a/org.eclipse.jdt.compiler.apt.tests/java9/java9api.jar b/org.eclipse.jdt.compiler.apt.tests/java9/java9api.jar
deleted file mode 100644
index fd56ad100e..0000000000
--- a/org.eclipse.jdt.compiler.apt.tests/java9/java9api.jar
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.jdt.compiler.apt.tests/lib/apttestprocessors8.jar b/org.eclipse.jdt.compiler.apt.tests/lib/apttestprocessors8.jar
index 1e01a671f2..121c0dbeb0 100644
--- a/org.eclipse.jdt.compiler.apt.tests/lib/apttestprocessors8.jar
+++ b/org.eclipse.jdt.compiler.apt.tests/lib/apttestprocessors8.jar
Binary files differ
diff --git a/org.eclipse.jdt.compiler.apt.tests/processors/org/eclipse/jdt/compiler/apt/tests/processors/inherited/ArgsConstructorProcessor.java b/org.eclipse.jdt.compiler.apt.tests/processors/org/eclipse/jdt/compiler/apt/tests/processors/inherited/ArgsConstructorProcessor.java
index b8aa884386..4eabf11976 100644
--- a/org.eclipse.jdt.compiler.apt.tests/processors/org/eclipse/jdt/compiler/apt/tests/processors/inherited/ArgsConstructorProcessor.java
+++ b/org.eclipse.jdt.compiler.apt.tests/processors/org/eclipse/jdt/compiler/apt/tests/processors/inherited/ArgsConstructorProcessor.java
@@ -160,6 +160,7 @@ public class ArgsConstructorProcessor extends BaseProcessor {
return false;
}
+ @SuppressWarnings("deprecation")
private final TypeVisitor<Boolean, List<TypeMirror>> argsVisitor = new SimpleTypeVisitor6<Boolean, List<TypeMirror>>() {
@Override
public Boolean visitExecutable(ExecutableType t,
diff --git a/org.eclipse.jdt.compiler.apt.tests/processors/org/eclipse/jdt/compiler/apt/tests/processors/visitors/VisitorProc.java b/org.eclipse.jdt.compiler.apt.tests/processors/org/eclipse/jdt/compiler/apt/tests/processors/visitors/VisitorProc.java
index fb387cacb2..591e3c80a6 100644
--- a/org.eclipse.jdt.compiler.apt.tests/processors/org/eclipse/jdt/compiler/apt/tests/processors/visitors/VisitorProc.java
+++ b/org.eclipse.jdt.compiler.apt.tests/processors/org/eclipse/jdt/compiler/apt/tests/processors/visitors/VisitorProc.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 BEA Systems, Inc.
+ * Copyright (c) 2007, 2018 BEA Systems, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -47,6 +47,7 @@ public class VisitorProc extends BaseProcessor
* This visitor is invoked on the top-level types in resources/targets/model.
* We expect to see each of the visitX() methods get hit as a result.
*/
+ @SuppressWarnings("deprecation")
private static class ElementVisitorTester extends ElementScanner6<Void, Void> {
public enum Visited { TYPE, EXECUTABLE, VARIABLE, TYPEPARAM, PACKAGE, UNKNOWN }
@@ -129,6 +130,7 @@ public class VisitorProc extends BaseProcessor
/*
* The specific values checked by this visitor correspond to values in targets.model.pc.TypedAnnos.java
*/
+ @SuppressWarnings("deprecation")
private static class AnnotationVisitorTester extends AbstractAnnotationValueVisitor6<Void, Void> {
public enum Visited { ANNOTATION, ARRAY, BOOLEAN, BYTE, CHAR, DOUBLE, ENUMCONSTANT, FLOAT, INT, LONG, SHORT, STRING, TYPE }
diff --git a/org.eclipse.jdt.compiler.apt.tests/processors8/org/eclipse/jdt/compiler/apt/tests/processors/elements/Java9ElementProcessor.java b/org.eclipse.jdt.compiler.apt.tests/processors8/org/eclipse/jdt/compiler/apt/tests/processors/elements/Java9ElementProcessor.java
index 886054b020..8310874eba 100644
--- a/org.eclipse.jdt.compiler.apt.tests/processors8/org/eclipse/jdt/compiler/apt/tests/processors/elements/Java9ElementProcessor.java
+++ b/org.eclipse.jdt.compiler.apt.tests/processors8/org/eclipse/jdt/compiler/apt/tests/processors/elements/Java9ElementProcessor.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2017 IBM Corporation.
+ * Copyright (c) 2017, 2018 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -45,6 +45,7 @@ import javax.lang.model.type.TypeKind;
import javax.lang.model.type.TypeMirror;
import org.eclipse.jdt.compiler.apt.tests.processors.base.BaseProcessor;
+import org.eclipse.jdt.compiler.apt.tests.processors.util.TestDirectiveVisitor;
/**
* A processor that explores the java 9 specific elements and validates the lambda and
@@ -674,6 +675,76 @@ public class Java9ElementProcessor extends BaseProcessor {
}
}
+ public void testDirectiveVisitor() {
+ ModuleElement mod = _elementUtils.getModuleElement("mod.b");
+ assertNotNull("mod.b module null", mod);
+ try {
+ TestDirectiveVisitor<Object, Object> t = new TestDirectiveVisitor<>();
+ List<? extends Directive> directives = mod.getDirectives();
+ for (Directive directive : directives) {
+ Object result = t.visit(directive);
+ assertSame("Objects should be same", result, directive);
+ }
+
+ } catch (SecurityException e) {
+ e.printStackTrace();
+ }
+ }
+ public void testTypesImpl() {
+ ModuleElement mod = _elementUtils.getModuleElement("mod.a");
+ Set<? extends TypeElement> typeElements = _elementUtils.getAllTypeElements("abc.internal.A");
+ assertNotNull("mod.b module null", mod);
+ assertNotNull("Type should not be null", typeElements);
+ assertEquals("Incorrect no of types", 1, typeElements.size());
+ TypeElement tElement = null;
+ for (TypeElement typeElement : typeElements) {
+ tElement = typeElement;
+ }
+ assertNotNull("Package should not be null", tElement);
+ TypeMirror t = tElement.asType();
+ boolean exception = false;
+ try {
+ _typeUtils.erasure(mod.asType());
+ } catch(IllegalArgumentException iae) {
+ exception = true;
+ }
+ assertTrue("Exception not thrown", exception);
+ exception = false;
+ try {
+ _typeUtils.capture(mod.asType());
+ } catch(IllegalArgumentException iae) {
+ exception = true;
+ }
+ assertTrue("Exception not thrown", exception);
+ exception = false;
+ try {
+ _typeUtils.directSupertypes(mod.asType());
+ } catch(IllegalArgumentException iae) {
+ exception = true;
+ }
+ assertTrue("Exception not thrown", exception);
+ exception = false;
+ try {
+ _typeUtils.isSubtype(mod.asType(), t);
+ } catch(IllegalArgumentException iae) {
+ exception = true;
+ }
+ assertTrue("Exception not thrown", exception);
+ exception = false;
+ try {
+ _typeUtils.isAssignable(mod.asType(), t);
+ } catch(IllegalArgumentException iae) {
+ exception = true;
+ }
+ assertTrue("Exception not thrown", exception);
+ exception = false;
+ try {
+ _typeUtils.contains(mod.asType(), t);
+ } catch(IllegalArgumentException iae) {
+ exception = true;
+ }
+ assertTrue("Exception not thrown", exception);
+ }
private void validateModifiers(ExecutableElement method, Modifier[] expected) {
Set<Modifier> modifiers = method.getModifiers();
List<Modifier> list = new ArrayList<>(modifiers);
diff --git a/org.eclipse.jdt.compiler.apt.tests/processors8/org/eclipse/jdt/compiler/apt/tests/processors/util/TestDirectiveVisitor.java b/org.eclipse.jdt.compiler.apt.tests/processors8/org/eclipse/jdt/compiler/apt/tests/processors/util/TestDirectiveVisitor.java
new file mode 100644
index 0000000000..82e43ee440
--- /dev/null
+++ b/org.eclipse.jdt.compiler.apt.tests/processors8/org/eclipse/jdt/compiler/apt/tests/processors/util/TestDirectiveVisitor.java
@@ -0,0 +1,32 @@
+package org.eclipse.jdt.compiler.apt.tests.processors.util;
+
+import javax.lang.model.element.ModuleElement.*;
+
+public class TestDirectiveVisitor<R, P> implements DirectiveVisitor<Object, Object> {
+
+ @Override
+ public Object visitExports(ExportsDirective arg0, Object arg1) {
+ return arg0;
+ }
+
+ @Override
+ public Object visitOpens(OpensDirective arg0, Object arg1) {
+ return arg0;
+ }
+
+ @Override
+ public Object visitProvides(ProvidesDirective arg0, Object arg1) {
+ return arg0;
+ }
+
+ @Override
+ public Object visitRequires(RequiresDirective arg0, Object arg1) {
+ return arg0;
+ }
+
+ @Override
+ public Object visitUses(UsesDirective arg0, Object arg1) {
+ return arg0;
+ }
+
+} \ No newline at end of file
diff --git a/org.eclipse.jdt.compiler.apt.tests/src/org/eclipse/jdt/compiler/apt/tests/Java9ElementsTests.java b/org.eclipse.jdt.compiler.apt.tests/src/org/eclipse/jdt/compiler/apt/tests/Java9ElementsTests.java
index fb57fea7b3..6a048807a7 100644
--- a/org.eclipse.jdt.compiler.apt.tests/src/org/eclipse/jdt/compiler/apt/tests/Java9ElementsTests.java
+++ b/org.eclipse.jdt.compiler.apt.tests/src/org/eclipse/jdt/compiler/apt/tests/Java9ElementsTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2017 IBM Corporation.
+ * Copyright (c) 2017, 2018 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -371,7 +371,14 @@ public class Java9ElementsTests extends TestCase {
JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
internalTestWithBinary(compiler, MODULE_PROC, "9", "testBug521723", null, "bug521723");
}
-
+ public void testDirectiveVisitorJavac() throws IOException {
+ JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
+ internalTest2(compiler, MODULE_PROC, "testDirectiveVisitor", null);
+ }
+ public void testTypesImpl() throws IOException {
+ JavaCompiler compiler = BatchTestUtils.getEclipseCompiler();
+ internalTest2(compiler, MODULE_PROC, "testTypesImpl", null);
+ }
protected void internalTestWithBinary(JavaCompiler compiler, String processor, String compliance, String testMethod, String testClass, String resourceArea) throws IOException {
if (!canRunJava9()) {
return;

Back to the top