diff options
author | Andy Clement <andrew.clement@gmail.com> | 2012-07-10 10:18:35 -0700 |
---|---|---|
committer | Andy Clement <andrew.clement@gmail.com> | 2012-07-10 10:18:35 -0700 |
commit | bf949d3260232dd69a5fd3a2b81a19cb3dd1a6a6 (patch) | |
tree | a128790e3b29e568bc3044ae9ef6cf2c1162b315 /org.aspectj.ajdt.core | |
parent | 5d0e1860cb5069b266ba70d33bc356d36e285a90 (diff) | |
download | aspectj-bf949d3260232dd69a5fd3a2b81a19cb3dd1a6a6.tar.gz aspectj-bf949d3260232dd69a5fd3a2b81a19cb3dd1a6a6.zip |
384398: some fixes for generics/itds/inner classes
Diffstat (limited to 'org.aspectj.ajdt.core')
-rw-r--r-- | org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java | 31 |
1 files changed, 30 insertions, 1 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 ae2d2d04e..154746fa4 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 @@ -273,7 +273,17 @@ public class EclipseFactory { // pr168044 - sometimes (whilst resolving types) we are working with 'half finished' types and so (for example) the // underlying generic type for a raw type hasnt been set yet // if (!baseType.isGenericType() && arguments!=null) baseType = baseType.getGenericType(); - baseTypeSignature = baseType.getErasureSignature(); +// pr384398 - secondary testcase in 1.7.1 tests - this needs work as this code +// currently discards the parameterization on the outer type, which is important info +// ReferenceBinding enclosingTypeBinding = ptb.enclosingType(); +// if (enclosingTypeBinding!=null) { +// UnresolvedType ttt = fromBinding(enclosingTypeBinding); +// baseTypeSignature = ttt.getSignature(); +// baseTypeSignature= baseTypeSignature.substring(0,baseTypeSignature.length()-1); +// baseTypeSignature = baseTypeSignature + "."+new String(ptb.sourceName)+";"; +// } else { + baseTypeSignature = baseType.getErasureSignature(); +// } } else { baseTypeSignature = UnresolvedType.forName(getName(binding)).getSignature(); } @@ -283,6 +293,10 @@ public class EclipseFactory { // be type variables that we haven't fixed up yet. if (arguments == null) { arguments = new UnresolvedType[0]; + // for pr384398 + if (!hasAnyArguments(ptb)) { + return UnresolvedType.forRawTypeName(getName(binding)); + } } // StringBuffer parameterizedSig = new StringBuffer(); // parameterizedSig.append(ResolvedType.PARAMETERIZED_TYPE_IDENTIFIER); @@ -331,6 +345,21 @@ public class EclipseFactory { } /** + * Search up a parameterized type binding for any arguments at any level. + */ + private boolean hasAnyArguments(ParameterizedTypeBinding ptb) { + if (ptb.arguments!=null && ptb.arguments.length>0) { + return true; + } + ReferenceBinding enclosingType = ptb.enclosingType(); + if (enclosingType instanceof ParameterizedTypeBinding) { + return hasAnyArguments((ParameterizedTypeBinding)enclosingType); + } else { + return false; + } + } + + /** * Some type variables refer to themselves recursively, this enables us to avoid recursion problems. */ private static Map typeVariableBindingsInProgress = new HashMap(); |