aboutsummaryrefslogtreecommitdiffstats
path: root/org.aspectj.ajdt.core/src/org
diff options
context:
space:
mode:
authorAndy Clement <aclement@gopivotal.com>2015-04-23 12:22:23 -0700
committerAndy Clement <aclement@gopivotal.com>2015-04-23 12:22:23 -0700
commitf7ae7fb012e540252ff03e1a8e1dff022fb19027 (patch)
tree78ebcadf0cc86674d92a74fb8dd61343e5b87b93 /org.aspectj.ajdt.core/src/org
parent3ad0706d16c0068aca1fb5ef2d8ef1c78bd9e975 (diff)
downloadaspectj-f7ae7fb012e540252ff03e1a8e1dff022fb19027.tar.gz
aspectj-f7ae7fb012e540252ff03e1a8e1dff022fb19027.zip
weaving generic types
Diffstat (limited to 'org.aspectj.ajdt.core/src/org')
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java
index 49b0f7371..7a27b709a 100644
--- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java
@@ -1314,6 +1314,28 @@ public class AjLookupEnvironment extends LookupEnvironment implements AnonymousC
// methods against in the verifier rather than compareTo(Object)
if (!factory.getWorld().isInJava5Mode()) {
parentBinding = (ReferenceBinding)convertToRawType(parentBinding, false /*do not force conversion of enclosing types*/);
+ } else if (sourceType.isGenericType()) {
+ RawTypeBinding rawTargetType = (RawTypeBinding)convertToRawType(sourceType, false);
+ if (rawTargetType != null) {
+ // assert: don't need to 'rememberTypeHierarchy' because the class file is constructed based on the generic type
+ if (parentBinding.isClass()) {
+ rawTargetType.superclass = parentBinding;
+ } else {
+ ReferenceBinding[] oldI = rawTargetType.superInterfaces;
+ ReferenceBinding[] newI;
+ if (oldI == null) {
+ newI = new ReferenceBinding[1];
+ newI[0] = parentBinding;
+ } else {
+ int n = oldI.length;
+ newI = new ReferenceBinding[n + 1];
+ System.arraycopy(oldI, 0, newI, 0, n);
+ newI[n] = parentBinding;
+ }
+ rawTargetType.superInterfaces = newI;
+ }
+ }
+ // TODO what about parameterized types?
}
sourceType.rememberTypeHierarchy();
if (parentBinding.isClass()) {