summaryrefslogtreecommitdiffstats
path: root/org.aspectj.ajdt.core
diff options
context:
space:
mode:
authoraclement <aclement>2006-10-16 14:23:57 +0000
committeraclement <aclement>2006-10-16 14:23:57 +0000
commit3ff7b362b50714806abc449bac38545361313237 (patch)
tree7f6a9c2b9bb6b4bcac2ee70cf910d7ef0fab3983 /org.aspectj.ajdt.core
parentfc750075fd91edcdd5e73cf04593ea3c822a746a (diff)
downloadaspectj-3ff7b362b50714806abc449bac38545361313237.tar.gz
aspectj-3ff7b362b50714806abc449bac38545361313237.zip
corrected some problems with parameterized types in packages
Diffstat (limited to 'org.aspectj.ajdt.core')
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/InterTypeDeclaration.java37
1 files changed, 25 insertions, 12 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 63a6714bd..a97c2fd99 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
@@ -29,6 +29,7 @@ import org.aspectj.org.eclipse.jdt.internal.compiler.CompilationResult;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Annotation;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ParameterizedQualifiedTypeReference;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ParameterizedSingleTypeReference;
+import org.aspectj.org.eclipse.jdt.internal.compiler.ast.QualifiedTypeReference;
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.ClassScope;
@@ -184,7 +185,7 @@ public abstract class InterTypeDeclaration extends AjMethodDeclaration {
// If they did supply a parameterized single type reference, we need to do
// some extra checks...
- if (onType instanceof ParameterizedSingleTypeReference) {
+ if (onType instanceof ParameterizedSingleTypeReference || onType instanceof ParameterizedQualifiedTypeReference) {
resolveTypeParametersForITDOnGenericType(classScope);
} else {
onTypeBinding = (ReferenceBinding)onType.getTypeBindingPublic(classScope);
@@ -214,9 +215,16 @@ public abstract class InterTypeDeclaration extends AjMethodDeclaration {
private void resolveTypeParametersForITDOnGenericType(ClassScope classScope) {
// Collapse the parameterized reference to its generic type
+ if (onType instanceof ParameterizedSingleTypeReference) {
ParameterizedSingleTypeReference pref = (ParameterizedSingleTypeReference) onType;
long pos = (((long)pref.sourceStart) << 32) | pref.sourceEnd;
onType = new SingleTypeReference(pref.token,pos);
+ } else {
+ ParameterizedQualifiedTypeReference pref = (ParameterizedQualifiedTypeReference) onType;
+ long pos = (((long)pref.sourceStart) << 32) | pref.sourceEnd;
+ onType = new QualifiedTypeReference(pref.tokens,new long[]{pos});
+
+ }
onTypeBinding = (ReferenceBinding)onType.getTypeBindingPublic(classScope);
if (!onTypeBinding.isValidBinding()) {
@@ -357,16 +365,7 @@ public abstract class InterTypeDeclaration extends AjMethodDeclaration {
MethodScope scope = this.scope;
TypeReference ot = onType;
-
- // Work out the real base type
- if (ot instanceof ParameterizedSingleTypeReference) {
- ParameterizedSingleTypeReference pref = (ParameterizedSingleTypeReference) ot;
- long pos = (((long)pref.sourceStart) << 32) | pref.sourceEnd;
- ot = new SingleTypeReference(pref.token,pos);
- }
-
- // resolve it
- ReferenceBinding rb = (ReferenceBinding)ot.getTypeBindingPublic(scope.parent);
+ ReferenceBinding rb = null;
if (ot instanceof ParameterizedQualifiedTypeReference) { // pr132349
ParameterizedQualifiedTypeReference pref = (ParameterizedQualifiedTypeReference) ot;
@@ -383,8 +382,22 @@ public abstract class InterTypeDeclaration extends AjMethodDeclaration {
onType=null;
}
}
-
+ // Work out the real base type
+ if (ot instanceof ParameterizedSingleTypeReference) {
+ ParameterizedSingleTypeReference pref = (ParameterizedSingleTypeReference) ot;
+ long pos = (((long)pref.sourceStart) << 32) | pref.sourceEnd;
+ ot = new SingleTypeReference(pref.token,pos);
+ } else if (ot instanceof ParameterizedQualifiedTypeReference) {
+ ParameterizedQualifiedTypeReference pref = (ParameterizedQualifiedTypeReference) ot;
+ long pos = (((long)pref.sourceStart) << 32) | pref.sourceEnd;
+ ot = new QualifiedTypeReference(pref.tokens,new long[]{pos});//SingleTypeReference(pref.Quatoken,pos);
+ }
+
+ // resolve it
+ if (rb==null) {
+ rb = (ReferenceBinding)ot.getTypeBindingPublic(scope.parent);
+ }
if (rb instanceof TypeVariableBinding) {
scope.problemReporter().signalError(sourceStart,sourceEnd,
"Cannot make inter-type declarations on type variables, use an interface and declare parents");