aboutsummaryrefslogtreecommitdiffstats
path: root/org.aspectj.ajdt.core
diff options
context:
space:
mode:
authoraclement <aclement>2005-08-09 10:19:41 +0000
committeraclement <aclement>2005-08-09 10:19:41 +0000
commit937c645ae75e19c238cd7abf0132404fef1871ca (patch)
tree9ed1736aa5811df0ce0902e1e44cfec0a1994369 /org.aspectj.ajdt.core
parent43f8b24ddb2cb8b092921e614669a429830f795a (diff)
downloadaspectj-937c645ae75e19c238cd7abf0132404fef1871ca.tar.gz
aspectj-937c645ae75e19c238cd7abf0132404fef1871ca.zip
genericitds: 2 big changes here: I've modifed the super/extends stuff so its only in one place (UnresolvedType) - making it available through the type hierarchy. I've modified the TypeMap in the World to avoid putting entries in the type map which might confuse us later. This fix stops us putting parameterized types that are parameterized by type variables from a generic member into the typemap, since we may look them up later for another member that happened to use the same variable name but had different bounds specified. I'm sure its not perfect yet, but it is definetly improved. things like Enum<E> still go in the typemap since E is not a generic member type variable.
Diffstat (limited to 'org.aspectj.ajdt.core')
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java25
1 files changed, 14 insertions, 11 deletions
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
index 85810decc..5c803b132 100644
--- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
@@ -206,8 +206,8 @@ public class EclipseFactory {
// case let's set it correctly based on the one in the eclipse WildcardBinding
if (eWB.bound instanceof TypeVariableBinding) {
UnresolvedType tVar = fromTypeVariableBinding((TypeVariableBinding)eWB.bound);
- if (ut.isGenericWildcardSuper()) ut.setLowerBound(tVar);
- if (ut.isGenericWildcardExtends()) ut.setUpperBound(tVar);
+ if (ut.isGenericWildcard() && ut.isSuper()) ut.setLowerBound(tVar);
+ if (ut.isGenericWildcard() && ut.isExtends()) ut.setUpperBound(tVar);
}
return ut;
}
@@ -297,12 +297,13 @@ public class EclipseFactory {
tv.setUpperBound(superclassType);
tv.setAdditionalInterfaceBounds(superinterfaces);
tv.setRank(aTypeVariableBinding.rank);
-// dont need the declaring element yet...
-// if (aTypeVariableBinding.declaringElement instanceof MethodBinding) {
+ if (aTypeVariableBinding.declaringElement instanceof MethodBinding) {
+ tv.setDeclaringElementKind(TypeVariable.METHOD);
// tv.setDeclaringElement(fromBinding((MethodBinding)aTypeVariableBinding.declaringElement);
-// } else {
+ } else {
+ tv.setDeclaringElementKind(TypeVariable.TYPE);
// // tv.setDeclaringElement(fromBinding(aTypeVariableBinding.declaringElement));
-// }
+ }
ret.setTypeVariable(tv);
typeVariableBindingsInProgress.remove(aTypeVariableBinding);
return ret;
@@ -504,12 +505,14 @@ public class EclipseFactory {
BoundedReferenceType brt = (BoundedReferenceType)typeX;
// Work out 'kind' for the WildcardBinding
int boundkind = Wildcard.UNBOUND;
- if (brt.isExtends()) boundkind = Wildcard.EXTENDS;
- if (brt.isSuper()) boundkind = Wildcard.SUPER;
- // get the bound right
TypeBinding bound = null;
- if (brt.isGenericWildcardExtends()) bound = makeTypeBinding(brt.getUpperBound());
- if (brt.isGenericWildcardSuper()) bound = makeTypeBinding(brt.getLowerBound());
+ if (brt.isExtends()) {
+ boundkind = Wildcard.EXTENDS;
+ bound = makeTypeBinding(brt.getUpperBound());
+ } else if (brt.isSuper()) {
+ boundkind = Wildcard.SUPER;
+ bound = makeTypeBinding(brt.getLowerBound());
+ }
TypeBinding[] otherBounds = null;
if (brt.getAdditionalBounds()!=null && brt.getAdditionalBounds().length!=0) otherBounds = makeTypeBindings(brt.getAdditionalBounds());
// FIXME asc rank should not always be 0 ...