]> source.dussan.org Git - aspectj.git/commitdiff
test and fix for 136258
authoraclement <aclement>
Thu, 13 Apr 2006 09:24:46 +0000 (09:24 +0000)
committeraclement <aclement>
Thu, 13 Apr 2006 09:24:46 +0000 (09:24 +0000)
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java
tests/bugs152/pr136258/StatisticsTypeImpl.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java
tests/src/org/aspectj/systemtest/ajc152/ajc152.xml

index e562f353830b877d0b3e59d0c47fbc9aa4d3b53a..8b54db3dcd5024e17adfb43e914dfd9cadec7f20 100644 (file)
@@ -298,14 +298,14 @@ public class AjLookupEnvironment extends LookupEnvironment implements AnonymousC
        public void doSupertypesFirst(ReferenceBinding rb,Collection yetToProcess) {
            if (rb instanceof SourceTypeBinding) {
                    if (yetToProcess.contains(rb)) {
-                       collectAllITDsAndDeclares((SourceTypeBinding)rb, yetToProcess);
+                               collectAllITDsAndDeclares((SourceTypeBinding)rb, yetToProcess);
                    }
            } else if (rb instanceof ParameterizedTypeBinding) {
                // If its a PTB we need to pull the SourceTypeBinding out of it.
-               ParameterizedTypeBinding ptb = (ParameterizedTypeBinding)rb;
-               if (ptb.type instanceof SourceTypeBinding && yetToProcess.contains(ptb.type)) {
-                       collectAllITDsAndDeclares((SourceTypeBinding)ptb.type, yetToProcess);
-               }
+                       ParameterizedTypeBinding ptb = (ParameterizedTypeBinding)rb;
+                       if (ptb.type instanceof SourceTypeBinding && yetToProcess.contains(ptb.type)) {
+                               collectAllITDsAndDeclares((SourceTypeBinding)ptb.type, yetToProcess);
+                       }
            }
        }
        /**
@@ -316,8 +316,9 @@ public class AjLookupEnvironment extends LookupEnvironment implements AnonymousC
         */
        private void collectAllITDsAndDeclares(SourceTypeBinding sourceType, Collection yetToProcess) {
                // Look at the supertype first
-               ContextToken tok = CompilationAndWeavingContext.enteringPhase(CompilationAndWeavingContext.COLLECTING_ITDS_AND_DECLARES, sourceType.sourceName);
-               
+               //ContextToken tok = CompilationAndWeavingContext.enteringPhase(CompilationAndWeavingContext.COLLECTING_ITDS_AND_DECLARES, sourceType.sourceName);
+
+         yetToProcess.remove(sourceType);
                // look out our direct supertype
                doSupertypesFirst(sourceType.superclass(),yetToProcess);
            
@@ -331,8 +332,7 @@ public class AjLookupEnvironment extends LookupEnvironment implements AnonymousC
                
         buildInterTypeAndPerClause(sourceType.scope);
         addCrosscuttingStructures(sourceType.scope);
-        yetToProcess.remove(sourceType);
-               CompilationAndWeavingContext.leavingPhase(tok);
+               //CompilationAndWeavingContext.leavingPhase(tok);
        }
        
        /**
diff --git a/tests/bugs152/pr136258/StatisticsTypeImpl.java b/tests/bugs152/pr136258/StatisticsTypeImpl.java
new file mode 100644 (file)
index 0000000..0837f41
--- /dev/null
@@ -0,0 +1,14 @@
+interface StatisticsType {
+}
+
+public class StatisticsTypeImpl implements StatisticsType {
+    static class UIStatisticsType extends UofwStatisticsType {
+    };
+
+    public static void main(String argz[]) {
+        System.out.println(new UIStatisticsType().toString());
+    }
+}
+
+class UofwStatisticsType extends StatisticsTypeImpl {
+}
\ No newline at end of file
index 18baacb7e0f5da6f5ea2e53d8bd73224c1b8495e..06c11766c3d7bacc42ace00f4aad80c39bb043fb 100644 (file)
@@ -16,8 +16,9 @@ import junit.framework.Test;
 import org.aspectj.testing.XMLBasedAjcTestCase;
 
 public class Ajc152Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
+       
   public void testAspectLibrariesAndASM_pr135001() { runTest("aspect libraries and asm");}
-  
+  public void testStackOverflow_pr136258() { runTest("stack overflow");}
   
   /////////////////////////////////////////
   public static Test suite() {
index 75c8c07cfdbb8bcd4462128c1070dc8211c13e50..f020e6dc619a77ad2c81bc90a39eb85d1602603b 100644 (file)
@@ -15,4 +15,9 @@
       </run>
     </ajc-test>
     
+    <ajc-test dir="bugs152/pr136258" title="stack overflow">
+      <compile files="StatisticsTypeImpl.java" options="-1.5"/>
+      <run class="StatisticsTypeImpl"/>
+    </ajc-test>
+    
 </suite>
\ No newline at end of file