summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoracolyer <acolyer>2005-08-08 15:54:47 +0000
committeracolyer <acolyer>2005-08-08 15:54:47 +0000
commit6fe49e131d6699d52d94a34dac5a02d9971fe2aa (patch)
tree1eeda47a7e6a25576206d66090ab4e4d956a4e2e
parent311d26eeec387fc6365734d4d9991bb99f962325 (diff)
downloadaspectj-6fe49e131d6699d52d94a34dac5a02d9971fe2aa.tar.gz
aspectj-6fe49e131d6699d52d94a34dac5a02d9971fe2aa.zip
updated rules that allow ITDs on generic types using type parameters
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/InterTypeDeclaration.java19
-rw-r--r--org.eclipse.jdt.core/jdtcore-for-aspectj-src.zipbin4307009 -> 4307574 bytes
-rw-r--r--org.eclipse.jdt.core/jdtcore-for-aspectj.jarbin5169855 -> 5033041 bytes
3 files changed, 19 insertions, 0 deletions
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/InterTypeDeclaration.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/InterTypeDeclaration.java
index f3c2afa7d..52cd90e49 100644
--- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/InterTypeDeclaration.java
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/InterTypeDeclaration.java
@@ -24,6 +24,8 @@ import org.aspectj.ajdt.internal.core.builder.EclipseSourceContext;
import org.aspectj.weaver.*;
import org.aspectj.org.eclipse.jdt.internal.compiler.ClassFile;
import org.aspectj.org.eclipse.jdt.internal.compiler.CompilationResult;
+import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ParameterizedSingleTypeReference;
+import org.aspectj.org.eclipse.jdt.internal.compiler.ast.SingleTypeReference;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeReference;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.*;
import org.aspectj.org.eclipse.jdt.core.compiler.CharOperation;
@@ -130,12 +132,29 @@ public abstract class InterTypeDeclaration extends AjMethodDeclaration {
protected void resolveOnType(ClassScope classScope) {
checkSpec();
+ if (onType instanceof ParameterizedSingleTypeReference) {
+ resolveTypeParametersForITDOnGenericType();
+ }
+
onTypeBinding = (ReferenceBinding)onType.getTypeBindingPublic(classScope);
if (!onTypeBinding.isValidBinding()) {
classScope.problemReporter().invalidType(onType, onTypeBinding);
ignoreFurtherInvestigation = true;
}
}
+
+ private void resolveTypeParametersForITDOnGenericType() {
+ // we have to resolve this to the base type, and in the process
+ // check that the number of type variables matches.
+ // Then we work out how the letters in the ITD map onto the letters in
+ // the type declaration and swap them.
+
+ // XXX will this mess up error reporting and independent compliation?
+
+ ParameterizedSingleTypeReference pref = (ParameterizedSingleTypeReference) onType;
+ long pos = (((long)pref.sourceStart) << 32) | pref.sourceEnd;
+ onType = new SingleTypeReference(pref.token,pos);
+ }
protected void checkSpec() {
diff --git a/org.eclipse.jdt.core/jdtcore-for-aspectj-src.zip b/org.eclipse.jdt.core/jdtcore-for-aspectj-src.zip
index d4b892859..bb0ce9c06 100644
--- a/org.eclipse.jdt.core/jdtcore-for-aspectj-src.zip
+++ b/org.eclipse.jdt.core/jdtcore-for-aspectj-src.zip
Binary files differ
diff --git a/org.eclipse.jdt.core/jdtcore-for-aspectj.jar b/org.eclipse.jdt.core/jdtcore-for-aspectj.jar
index e0baf91e9..2b251f034 100644
--- a/org.eclipse.jdt.core/jdtcore-for-aspectj.jar
+++ b/org.eclipse.jdt.core/jdtcore-for-aspectj.jar
Binary files differ