]> source.dussan.org Git - aspectj.git/commitdiff
260384: guards for npes that could occur due to other errors in the source
authoraclement <aclement>
Fri, 9 Jan 2009 20:06:55 +0000 (20:06 +0000)
committeraclement <aclement>
Fri, 9 Jan 2009 20:06:55 +0000 (20:06 +0000)
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/PointcutDeclaration.java
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java

index 4e6b642762d1ac1e73463acf508ab8436441c310..a95a3e7f946f0c8c3428b9b1df260024f136885d 100644 (file)
@@ -217,6 +217,10 @@ public class PointcutDeclaration extends AjMethodDeclaration {
        public ResolvedPointcutDefinition makeResolvedPointcutDefinition(EclipseFactory inWorld) {
                if (resolvedPointcutDeclaration != null)
                        return resolvedPointcutDeclaration;
+               if (binding == null) {
+                   // other errors exist that will be reported separately
+                       return null;  
+               }
                // System.out.println("pc: " + getPointcut() + ", " + getPointcut().state);
                ReferenceBinding declaringClass = binding.declaringClass;
                TypeBinding[] parameters = binding.parameters;
index 11c7fe9854fcb8670ae1e46335bc29fc27ab9e63..c59e8c4fd4579537aa1a317e178cfaf1e43ee86d 100644 (file)
@@ -397,6 +397,10 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate {
                ResolvedMember[] pointcuts = getDeclaredPointcuts();
                boolean sawError = false;
                for (int i = 0, len = pointcuts.length; i < len; i++) {
+                       if (pointcuts[i]==null) {
+                               // Something else is broken in this file and will be reported separately
+                               continue; 
+                       }
                        if (pointcuts[i].isAbstract()) {
                                if (!this.isAspect()) {
                                        eclipseWorld().showMessage(IMessage.ERROR, "abstract pointcut only allowed in aspect" + pointcuts[i].getName(),
@@ -410,6 +414,10 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate {
                        }
 
                        for (int j = i + 1; j < len; j++) {
+                               if (pointcuts[j]==null) {
+                                       // Something else is broken in this file and will be reported separately
+                                       continue; 
+                               }
                                if (pointcuts[i].getName().equals(pointcuts[j].getName())) {
                                        eclipseWorld().showMessage(IMessage.ERROR, "duplicate pointcut name: " + pointcuts[j].getName(),
                                                        pointcuts[i].getSourceLocation(), pointcuts[j].getSourceLocation());