]> source.dussan.org Git - aspectj.git/commitdiff
fixed for graceful error handling (i.e. the compiler doesn't dump stack ;-)
authorjhugunin <jhugunin>
Wed, 12 Mar 2003 23:22:11 +0000 (23:22 +0000)
committerjhugunin <jhugunin>
Wed, 12 Mar 2003 23:22:11 +0000 (23:22 +0000)
in response to tests now moved out of failing

org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AccessForInlineVisitor.java
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/InterTypeFieldDeclaration.java
tests/ajcTests.xml
tests/ajcTestsFailing.xml
tests/jimTests.xml

index 166a44cd8e7b448ed9cfeb9af0cec391adda86b4..3697f6be7dabecc8bc5b481cc375816c91f2b97c 100644 (file)
@@ -177,6 +177,7 @@ public class AccessForInlineVisitor extends AbstractSyntaxTreeVisitorAdapter {
        }
 
        private void makePublic(TypeBinding binding) {
+               if (binding == null || !binding.isValidBinding()) return;  // has already produced an error
                if (binding instanceof ReferenceBinding) {
                        ReferenceBinding rb = (ReferenceBinding)binding;
                        if (!rb.isPublic()) handler.notePrivilegedTypeAccess(rb, null); //???
index ef833b13eb9cfc43eb5d91eb373f8c197faa0304..2c45f3d1ab14157af045c6cca0d779325008ec2b 100644 (file)
@@ -137,7 +137,7 @@ public class InterTypeFieldDeclaration extends InterTypeDeclaration {
                EclipseFactory world = EclipseFactory.fromScopeLookupEnvironment(classScope);
                resolveOnType(classScope);
                
-               if (classScope.referenceContext.binding == null) return null;
+               if (ignoreFurtherInvestigation) return null;
                
                binding = classScope.referenceContext.binding.resolveTypesFor(binding);
                if (ignoreFurtherInvestigation) return null;
index 40998854bc891cbeda693e493eaf56ca2b49473e..1e192ba8a1d2eab0a252d05b41ac6efc35142bdb 100644 (file)
         <compile files="CflowBindingOrig.java"/>
         <run class="CflowBindingOrig"/>
     </ajc-test>
+    
+    <ajc-test dir="errors"  
+               title="type not imported in around advice">
+        <compile files="TypeNotImportedInAroundCE.java">
+               <message kind="error" line="10"/>
+        </compile>
+       </ajc-test>
+
+    <ajc-test dir="errors"  
+               title="type not imported in aspect">
+        <compile files="TypeInAspectNotImportedCE.java">
+               <message kind="error" line="6"/>
+        </compile>
+       </ajc-test>
 </suite>
index 4f31f40871dc3d653b9b7e74ca550f6ee1d1227f..578f0aa7529b915fa7d5a035359ffecab3d7a5ed 100644 (file)
         <run class="AspectInitError"/>
     </ajc-test>
 
-    <ajc-test dir="errors"  
-               title="type not imported in around advice">
-        <compile files="TypeNotImportedInAroundCE.java">
-               <message kind="error" line="10"/>
-        </compile>
-       </ajc-test>
-
-    <ajc-test dir="errors"  
-               title="type not imported in aspect">
-        <compile files="TypeInAspectNotImportedCE.java">
-               <message kind="error" line="6"/>
-        </compile>
-       </ajc-test>
-
 </suite>
index c03e61f44397a076f3acabbb46e58f31d4091bc7..f4adb0f97b4169c97f1ff3bb7378fea2527ed510 100644 (file)
@@ -1,19 +1,7 @@
 <!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd">
 <suite>
 
-    <ajc-test dir="errors"  
-               title="type not imported in around advice">
-        <compile files="TypeNotImportedInAroundCE.java">
-               <message kind="error" line="10"/>
-        </compile>
-       </ajc-test>
 
-    <ajc-test dir="errors"  
-               title="type not imported in aspect">
-        <compile files="TypeInAspectNotImportedCE.java">
-               <message kind="error" line="6"/>
-        </compile>
-       </ajc-test>
 
 
     <!--