summaryrefslogtreecommitdiffstats
path: root/org.aspectj.ajdt.core
diff options
context:
space:
mode:
authorjhugunin <jhugunin>2003-03-11 21:04:59 +0000
committerjhugunin <jhugunin>2003-03-11 21:04:59 +0000
commitd6b8b38cd0a707741788f8d4fae3850b213f50a4 (patch)
tree89d0af7f7012388a9b58aac2f1e0b5ce0b3e716d /org.aspectj.ajdt.core
parentbb66774ab4a5afb36d36bc8274ff265f10d666db (diff)
downloadaspectj-d6b8b38cd0a707741788f8d4fae3850b213f50a4.tar.gz
aspectj-d6b8b38cd0a707741788f8d4fae3850b213f50a4.zip
added tests and fixes
fixed two bugs in ajcTestsFailing
Diffstat (limited to 'org.aspectj.ajdt.core')
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/InterTypeFieldDeclaration.java10
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java3
2 files changed, 12 insertions, 1 deletions
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/InterTypeFieldDeclaration.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/InterTypeFieldDeclaration.java
index 583edca78..ef833b13e 100644
--- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/InterTypeFieldDeclaration.java
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/InterTypeFieldDeclaration.java
@@ -67,6 +67,14 @@ public class InterTypeFieldDeclaration extends InterTypeDeclaration {
EclipseFactory world = EclipseFactory.fromScopeLookupEnvironment(upperScope);
ResolvedMember sig = munger.getSignature();
TypeX aspectType = EclipseFactory.fromBinding(upperScope.referenceContext.binding);
+
+ if (sig.getReturnType() == ResolvedTypeX.VOID ||
+ (sig.getReturnType().isArray() && (sig.getReturnType().getComponentType() == ResolvedTypeX.VOID)))
+ {
+ upperScope.problemReporter().signalError(sourceStart, sourceEnd,
+ "field type can not be void");
+ }
+
//
// System.err.println("sig: " + sig);
// System.err.println("field: " + world.makeFieldBinding(
@@ -129,6 +137,8 @@ public class InterTypeFieldDeclaration extends InterTypeDeclaration {
EclipseFactory world = EclipseFactory.fromScopeLookupEnvironment(classScope);
resolveOnType(classScope);
+ if (classScope.referenceContext.binding == null) return null;
+
binding = classScope.referenceContext.binding.resolveTypesFor(binding);
if (ignoreFurtherInvestigation) return null;
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 d1744dafb..68c875bfc 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
@@ -108,13 +108,14 @@ public class EclipseFactory {
if (binding instanceof HelperInterfaceBinding) {
return ((HelperInterfaceBinding) binding).getTypeX();
}
- if (binding.qualifiedSourceName() == null) {
+ if (binding == null || binding.qualifiedSourceName() == null) {
return ResolvedTypeX.MISSING;
}
return TypeX.forName(getName(binding));
}
public static TypeX[] fromBindings(TypeBinding[] bindings) {
+ if (bindings == null) return TypeX.NONE;
int len = bindings.length;
TypeX[] ret = new TypeX[len];
for (int i=0; i<len; i++) {