summaryrefslogtreecommitdiffstats
path: root/org.aspectj.ajdt.core
diff options
context:
space:
mode:
authoraclement <aclement>2006-05-22 10:27:30 +0000
committeraclement <aclement>2006-05-22 10:27:30 +0000
commit4dea3ad2411d5ea80b6f49ed342e96e52a39a91a (patch)
tree02d2414065a8a07ab49cd1ff7ecb5b4f50416626 /org.aspectj.ajdt.core
parent0e6530f173f186e1668043abeb08df51b593c9de (diff)
downloadaspectj-4dea3ad2411d5ea80b6f49ed342e96e52a39a91a.tar.gz
aspectj-4dea3ad2411d5ea80b6f49ed342e96e52a39a91a.zip
test and fix for pr132349: itds on inner type of generic type
Diffstat (limited to 'org.aspectj.ajdt.core')
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/InterTypeDeclaration.java33
1 files changed, 32 insertions, 1 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 4c93be6ec..2d1c411dd 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
@@ -27,11 +27,13 @@ import org.aspectj.org.eclipse.jdt.core.compiler.CharOperation;
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.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.SingleTypeReference;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeReference;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ClassScope;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodScope;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ParameterizedTypeBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ProblemReferenceBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
@@ -177,6 +179,9 @@ public abstract class InterTypeDeclaration extends AjMethodDeclaration {
protected void resolveOnType(ClassScope classScope) {
checkSpec();
+
+ if (onType==null) return; // error reported elsewhere.
+
// If they did supply a parameterized single type reference, we need to do
// some extra checks...
if (onType instanceof ParameterizedSingleTypeReference) {
@@ -187,6 +192,15 @@ public abstract class InterTypeDeclaration extends AjMethodDeclaration {
classScope.problemReporter().invalidType(onType, onTypeBinding);
ignoreFurtherInvestigation = true;
}
+ if (onTypeBinding.isParameterizedType()) {
+ // might be OK... pr132349
+ ParameterizedTypeBinding ptb = (ParameterizedTypeBinding)onTypeBinding;
+ if (ptb.isNestedType()) {
+ if (ptb.typeVariables()==null || ptb.typeVariables().length==0) {
+ if (ptb.enclosingType().isRawType()) onTypeBinding = ptb.type;
+ }
+ }
+ }
}
}
@@ -350,9 +364,26 @@ public abstract class InterTypeDeclaration extends AjMethodDeclaration {
long pos = (((long)pref.sourceStart) << 32) | pref.sourceEnd;
ot = new SingleTypeReference(pref.token,pos);
}
-
+
// resolve it
ReferenceBinding rb = (ReferenceBinding)ot.getTypeBindingPublic(scope.parent);
+
+ if (ot instanceof ParameterizedQualifiedTypeReference) { // pr132349
+ ParameterizedQualifiedTypeReference pref = (ParameterizedQualifiedTypeReference) ot;
+ if (pref.typeArguments!=null && pref.typeArguments.length!=0) {
+ scope.problemReporter().signalError(sourceStart,sourceEnd,
+ "Cannot make inter-type declarations on parameterized types");
+ // to prevent disgusting cascading errors after this problem - lets null out what leads to them (pr105038)
+ this.arguments=null;
+ this.returnType=new SingleTypeReference(TypeReference.VOID,0L);
+
+ this.ignoreFurtherInvestigation=true;
+ ReferenceBinding closestMatch = null;
+ rb = new ProblemReferenceBinding(ot.getParameterizedTypeName(),closestMatch,0);
+ onType=null;
+ }
+ }
+
if (rb instanceof TypeVariableBinding) {
scope.problemReporter().signalError(sourceStart,sourceEnd,