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
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')
-rw-r--r--org.eclipse.jdt.compiler.apt/build.properties2
-rw-r--r--org.eclipse.jdt.compiler.apt/lib/java10api.jarbin0 -> 109915 bytes
-rw-r--r--org.eclipse.jdt.compiler.apt/lib/java9api.jarbin25089 -> 0 bytes
-rw-r--r--org.eclipse.jdt.compiler.apt/src/org/eclipse/jdt/internal/compiler/apt/model/ModuleElementImpl.java10
-rw-r--r--org.eclipse.jdt.compiler.apt/src/org/eclipse/jdt/internal/compiler/apt/model/TypesImpl.java62
5 files changed, 43 insertions, 31 deletions
diff --git a/org.eclipse.jdt.compiler.apt/build.properties b/org.eclipse.jdt.compiler.apt/build.properties
index cb4935b695..62b759607f 100644
--- a/org.eclipse.jdt.compiler.apt/build.properties
+++ b/org.eclipse.jdt.compiler.apt/build.properties
@@ -19,4 +19,4 @@ jars.compile.order = .
output.. = bin/
source.. = src/
-jars.extra.classpath = lib/java9api.jar
+jars.extra.classpath = lib/java10api.jar
diff --git a/org.eclipse.jdt.compiler.apt/lib/java10api.jar b/org.eclipse.jdt.compiler.apt/lib/java10api.jar
new file mode 100644
index 0000000000..464b69134f
--- /dev/null
+++ b/org.eclipse.jdt.compiler.apt/lib/java10api.jar
Binary files differ
diff --git a/org.eclipse.jdt.compiler.apt/lib/java9api.jar b/org.eclipse.jdt.compiler.apt/lib/java9api.jar
deleted file mode 100644
index fd56ad100e..0000000000
--- a/org.eclipse.jdt.compiler.apt/lib/java9api.jar
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.jdt.compiler.apt/src/org/eclipse/jdt/internal/compiler/apt/model/ModuleElementImpl.java b/org.eclipse.jdt.compiler.apt/src/org/eclipse/jdt/internal/compiler/apt/model/ModuleElementImpl.java
index 1a9a941de9..bf98ea31a1 100644
--- a/org.eclipse.jdt.compiler.apt/src/org/eclipse/jdt/internal/compiler/apt/model/ModuleElementImpl.java
+++ b/org.eclipse.jdt.compiler.apt/src/org/eclipse/jdt/internal/compiler/apt/model/ModuleElementImpl.java
@@ -221,7 +221,7 @@ public class ModuleElementImpl extends ElementImpl implements ModuleElement {
@Override
public <R, P> R accept(DirectiveVisitor<R, P> visitor, P param) {
- return visitor.visit(this);
+ return visitor.visitExports(this, param);
}
@Override
@@ -254,7 +254,7 @@ public class ModuleElementImpl extends ElementImpl implements ModuleElement {
@Override
public <R, P> R accept(DirectiveVisitor<R, P> visitor, P param) {
- return visitor.visit(this);
+ return visitor.visitRequires(this, param);
}
@Override
@@ -287,7 +287,7 @@ public class ModuleElementImpl extends ElementImpl implements ModuleElement {
@Override
public <R, P> R accept(DirectiveVisitor<R, P> visitor, P param) {
- return visitor.visit(this);
+ return visitor.visitOpens(this, param);
}
@Override
@@ -312,7 +312,7 @@ public class ModuleElementImpl extends ElementImpl implements ModuleElement {
@Override
public <R, P> R accept(DirectiveVisitor<R, P> visitor, P param) {
- return visitor.visit(this);
+ return visitor.visitUses(this, param);
}
@Override
@@ -338,7 +338,7 @@ public class ModuleElementImpl extends ElementImpl implements ModuleElement {
@Override
public <R, P> R accept(DirectiveVisitor<R, P> visitor, P param) {
- return visitor.visit(this);
+ return visitor.visitProvides(this, param);
}
@Override
diff --git a/org.eclipse.jdt.compiler.apt/src/org/eclipse/jdt/internal/compiler/apt/model/TypesImpl.java b/org.eclipse.jdt.compiler.apt/src/org/eclipse/jdt/internal/compiler/apt/model/TypesImpl.java
index 13f27dbde6..faccb366aa 100644
--- a/org.eclipse.jdt.compiler.apt/src/org/eclipse/jdt/internal/compiler/apt/model/TypesImpl.java
+++ b/org.eclipse.jdt.compiler.apt/src/org/eclipse/jdt/internal/compiler/apt/model/TypesImpl.java
@@ -220,6 +220,21 @@ public class TypesImpl implements Types {
return null;
}
+ private void validateRealType(TypeMirror t) {
+ switch (t.getKind()) {
+ case EXECUTABLE:
+ case PACKAGE:
+ case MODULE:
+ throw new IllegalArgumentException(
+ "Executable, package and module are illegal argument for Types.contains(..)"); //$NON-NLS-1$
+ default:
+ break;
+ }
+ }
+ private void validateRealTypes(TypeMirror t1, TypeMirror t2) {
+ validateRealType(t1);
+ validateRealType(t2);
+ }
@Override
public TypeElement boxedClass(PrimitiveType p) {
@@ -231,37 +246,23 @@ public class TypesImpl implements Types {
@Override
public TypeMirror capture(TypeMirror t) {
- throw new UnsupportedOperationException("NYI: TypesImpl.capture(...)"); //$NON-NLS-1$
+ validateRealType(t);
+ TypeMirrorImpl typeMirrorImpl = (TypeMirrorImpl) t;
+ if (typeMirrorImpl._binding instanceof ParameterizedTypeBinding) {
+ throw new UnsupportedOperationException("NYI: TypesImpl.capture(...)"); //$NON-NLS-1$
+ }
+ return t;
}
@Override
public boolean contains(TypeMirror t1, TypeMirror t2) {
- switch(t1.getKind()) {
- case EXECUTABLE :
- case PACKAGE :
- throw new IllegalArgumentException("Executable and package are illegal argument for Types.contains(..)"); //$NON-NLS-1$
- default:
- break;
- }
- switch(t2.getKind()) {
- case EXECUTABLE :
- case PACKAGE :
- throw new IllegalArgumentException("Executable and package are illegal argument for Types.contains(..)"); //$NON-NLS-1$
- default:
- break;
- }
+ validateRealTypes(t1, t2);
throw new UnsupportedOperationException("NYI: TypesImpl.contains(" + t1 + ", " + t2 + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
@Override
public List<? extends TypeMirror> directSupertypes(TypeMirror t) {
- switch(t.getKind()) {
- case PACKAGE :
- case EXECUTABLE :
- throw new IllegalArgumentException("Invalid type mirror for directSupertypes"); //$NON-NLS-1$
- default:
- break;
- }
+ validateRealType(t);
TypeMirrorImpl typeMirrorImpl = (TypeMirrorImpl) t;
Binding binding = typeMirrorImpl._binding;
if (binding instanceof ReferenceBinding) {
@@ -281,6 +282,7 @@ public class TypesImpl implements Types {
@Override
public TypeMirror erasure(TypeMirror t) {
+ validateRealType(t);
TypeMirrorImpl typeMirrorImpl = (TypeMirrorImpl) t;
Binding binding = typeMirrorImpl._binding;
if (binding instanceof ReferenceBinding) {
@@ -455,8 +457,9 @@ public class TypesImpl implements Types {
*/
@Override
public boolean isAssignable(TypeMirror t1, TypeMirror t2) {
+ validateRealTypes(t1, t2);
if (!(t1 instanceof TypeMirrorImpl) || !(t2 instanceof TypeMirrorImpl)) {
- return false;
+ return false;
}
Binding b1 = ((TypeMirrorImpl)t1).binding();
Binding b2 = ((TypeMirrorImpl)t2).binding();
@@ -474,6 +477,14 @@ public class TypesImpl implements Types {
@Override
public boolean isSameType(TypeMirror t1, TypeMirror t2) {
+ if (t1 instanceof NoTypeImpl) {
+ if (t2 instanceof NoTypeImpl) {
+ return ((NoTypeImpl) t1).getKind() == ((NoTypeImpl) t2).getKind();
+ }
+ return false;
+ } else if (t2 instanceof NoTypeImpl) {
+ return false;
+ }
if (t1.getKind() == TypeKind.WILDCARD || t2.getKind() == TypeKind.WILDCARD) {
// Wildcard types are never equal, according to the spec of this method
return false;
@@ -514,6 +525,7 @@ public class TypesImpl implements Types {
*/
@Override
public boolean isSubtype(TypeMirror t1, TypeMirror t2) {
+ validateRealTypes(t1, t2);
if (t1 instanceof NoTypeImpl) {
if (t2 instanceof NoTypeImpl) {
return ((NoTypeImpl) t1).getKind() == ((NoTypeImpl) t2).getKind();
@@ -523,7 +535,7 @@ public class TypesImpl implements Types {
return false;
}
if (!(t1 instanceof TypeMirrorImpl) || !(t2 instanceof TypeMirrorImpl)) {
- return false;
+ throw new IllegalArgumentException();
}
if (t1 == t2) {
return true;
@@ -535,7 +547,7 @@ public class TypesImpl implements Types {
}
if (!(b1 instanceof TypeBinding) || !(b2 instanceof TypeBinding)) {
// package, method, import, etc.
- return false;
+ throw new IllegalArgumentException();
}
if (b1.kind() == Binding.BASE_TYPE || b2.kind() == Binding.BASE_TYPE) {
if (b1.kind() != b2.kind()) {

Back to the top