aboutsummaryrefslogtreecommitdiffstats
path: root/weaver
diff options
context:
space:
mode:
authoracolyer <acolyer>2005-07-11 13:50:39 +0000
committeracolyer <acolyer>2005-07-11 13:50:39 +0000
commitb468ecc0132d75fdade0c403f78d99212342176d (patch)
treefa5b27fd0a4f04544fc903840d1a76aa7bc09cea /weaver
parent3299a01318c8dfd360f5b970708f261a64bf49e7 (diff)
downloadaspectj-b468ecc0132d75fdade0c403f78d99212342176d.tar.gz
aspectj-b468ecc0132d75fdade0c403f78d99212342176d.zip
add unresolved TypeVariableRefTypes which are created by EclipseFactory during conversion of bindings to TypeX, and resolved to TypeVariableReferenceTypes by the world.
Diffstat (limited to 'weaver')
-rw-r--r--weaver/src/org/aspectj/weaver/UnresolvedTypeVariableReferenceType.java44
-rw-r--r--weaver/src/org/aspectj/weaver/World.java4
2 files changed, 48 insertions, 0 deletions
diff --git a/weaver/src/org/aspectj/weaver/UnresolvedTypeVariableReferenceType.java b/weaver/src/org/aspectj/weaver/UnresolvedTypeVariableReferenceType.java
new file mode 100644
index 000000000..b33b100b8
--- /dev/null
+++ b/weaver/src/org/aspectj/weaver/UnresolvedTypeVariableReferenceType.java
@@ -0,0 +1,44 @@
+/* *******************************************************************
+ * Copyright (c) 2005 Contributors.
+ * 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
+ * http://eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Adrian Colyer Initial implementation
+ * ******************************************************************/
+package org.aspectj.weaver;
+
+/**
+ * @author colyer
+ * Represents a type variable encountered in the Eclipse Source world,
+ * which when resolved will turn into a TypeVariableReferenceType
+ */
+public class UnresolvedTypeVariableReferenceType extends TypeX {
+
+ private TypeVariable typeVariable;
+
+ // constructor used as place-holder when dealing with circular refs such as Enum
+ public UnresolvedTypeVariableReferenceType() {
+ super("Ljava/lang/Object;");
+ }
+
+ public UnresolvedTypeVariableReferenceType(TypeVariable aTypeVariable) {
+ super(aTypeVariable.getUpperBound().getSignature());
+ this.typeVariable = aTypeVariable;
+ }
+
+ // only used when resolving circular refs...
+ public void setTypeVariable(TypeVariable aTypeVariable) {
+ this.signature = aTypeVariable.getUpperBound().getSignature();
+ this.typeVariable = aTypeVariable;
+ }
+
+ public ResolvedTypeX resolve(World world) {
+ typeVariable.resolve(world);
+ return new TypeVariableReferenceType(typeVariable,world);
+ }
+
+}
diff --git a/weaver/src/org/aspectj/weaver/World.java b/weaver/src/org/aspectj/weaver/World.java
index 2bfda6c54..4efa5fe65 100644
--- a/weaver/src/org/aspectj/weaver/World.java
+++ b/weaver/src/org/aspectj/weaver/World.java
@@ -157,6 +157,10 @@ public abstract class World implements Dump.INode {
public ResolvedTypeX resolve(TypeX ty, boolean allowMissing) {
//System.out.println("resolve: " + ty + " world " + typeMap.keySet());
+ if (ty instanceof UnresolvedTypeVariableReferenceType) {
+ // AMC - don't like this instanceof test, suggests some refactoring needed...
+ return ((UnresolvedTypeVariableReferenceType)ty).resolve(this);
+ }
String signature = ty.getSignature();
ResolvedTypeX ret = typeMap.get(signature);
if (ret != null) { ret.world = this; return ret; } // Set the world for the RTX