Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Arthanareeswaran2018-03-12 12:10:26 +0000
committerJay Arthanareeswaran2018-03-14 04:02:21 +0000
commit304a1635ec412ada95b23dc1c7c1226b0b600fd6 (patch)
tree29e015a0ef8566b5ec338f335ea4aec53177ff89 /org.eclipse.jdt.compiler.apt
parentf2340ce0cbbf0215b456f958cfc9a5ac47a03115 (diff)
downloadeclipse.jdt.core-304a1635ec412ada95b23dc1c7c1226b0b600fd6.tar.gz
eclipse.jdt.core-304a1635ec412ada95b23dc1c7c1226b0b600fd6.tar.xz
eclipse.jdt.core-304a1635ec412ada95b23dc1c7c1226b0b600fd6.zip
Bug 531717 - TypesImpl.erasure() should not throw CCE for NoType and
NullType Change-Id: I15803f8171f60905b5b6affaefe341d383d34c7c Signed-off-by: Jay Arthanareeswaran <jarthana@in.ibm.com> (cherry picked from commit 9d6af21769df88995beecbec9e93cceeea7e81da)
Diffstat (limited to 'org.eclipse.jdt.compiler.apt')
-rw-r--r--org.eclipse.jdt.compiler.apt/src/org/eclipse/jdt/internal/compiler/apt/model/NoTypeImpl.java25
1 files changed, 22 insertions, 3 deletions
diff --git a/org.eclipse.jdt.compiler.apt/src/org/eclipse/jdt/internal/compiler/apt/model/NoTypeImpl.java b/org.eclipse.jdt.compiler.apt/src/org/eclipse/jdt/internal/compiler/apt/model/NoTypeImpl.java
index adc49321fb..6aac2331a6 100644
--- a/org.eclipse.jdt.compiler.apt/src/org/eclipse/jdt/internal/compiler/apt/model/NoTypeImpl.java
+++ b/org.eclipse.jdt.compiler.apt/src/org/eclipse/jdt/internal/compiler/apt/model/NoTypeImpl.java
@@ -22,20 +22,39 @@ import javax.lang.model.type.NullType;
import javax.lang.model.type.TypeKind;
import javax.lang.model.type.TypeVisitor;
+import org.eclipse.jdt.internal.compiler.lookup.Binding;
+import org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
+
/**
* An implementation of NoType, which is used to represent certain pseudo-types.
* @see NoType
*/
-public class NoTypeImpl implements NoType, NullType
+public class NoTypeImpl extends TypeMirrorImpl implements NoType, NullType
{
private final TypeKind _kind;
public static final NoType NO_TYPE_NONE = new NoTypeImpl(TypeKind.NONE);
- public static final NoType NO_TYPE_VOID = new NoTypeImpl(TypeKind.VOID);
+ public static final NoType NO_TYPE_VOID = new NoTypeImpl(TypeKind.VOID, TypeBinding.VOID);
public static final NoType NO_TYPE_PACKAGE = new NoTypeImpl(TypeKind.PACKAGE);
- public static final NullType NULL_TYPE = new NoTypeImpl(TypeKind.NULL);
+ public static final NullType NULL_TYPE = new NoTypeImpl(TypeKind.NULL, TypeBinding.NULL);
+ public static final Binding NO_TYPE_BINDING = new Binding() {
+ @Override
+ public int kind() {
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public char[] readableName() {
+ throw new IllegalStateException();
+ }
+ };
public NoTypeImpl(TypeKind kind) {
+ super(null, NO_TYPE_BINDING);
+ _kind = kind;
+ }
+ public NoTypeImpl(TypeKind kind, Binding binding) {
+ super(null, binding);
_kind = kind;
}

Back to the top