]> source.dussan.org Git - aspectj.git/commitdiff
test and fix for 115607 (declare @type): patch from helen.
authoraclement <aclement>
Mon, 21 Nov 2005 16:33:56 +0000 (16:33 +0000)
committeraclement <aclement>
Mon, 21 Nov 2005 16:33:56 +0000 (16:33 +0000)
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceLocation.java
tests/bugs150/pr115607.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
tests/src/org/aspectj/systemtest/ajc150/ajc150.xml

index 6b395c6e0299d7f2f38bf175d212820fe0380e21..2a4329fe556910990b4fad9a2d3e8c7b23f002b9 100644 (file)
@@ -88,6 +88,8 @@ public class EclipseSourceLocation implements ISourceLocation {
                 } else {
                     column = 0;
                 }
+            } else if (0 < lineNumber && lineNumber == result.lineSeparatorPositions.length) {
+               column = 0;
             }
         }
                return column;
diff --git a/tests/bugs150/pr115607.java b/tests/bugs150/pr115607.java
new file mode 100644 (file)
index 0000000..dfbcd28
--- /dev/null
@@ -0,0 +1,7 @@
+@interface I {}
+
+class Simple {}
+
+public aspect pr115607 {
+  declare @type: Simple : @I;
+}
\ No newline at end of file
index 253a9fe7215428b5f16da630cdedbc7908fd02e0..4a2ff9f6be0e4c16b9ae64e3243f886d649d450d 100644 (file)
@@ -77,6 +77,7 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
 
   public void testVarargsITD_pr110906() { runTest("ITD varargs problem");}
   public void testBadRenderer_pr86903() { runTest("bcelrenderer bad");}
+ // public void testSelfBoundGenerics_pr117296() { runTest("self bounding generic types");}
   
   public void testIncompatibleClassChangeError_pr113630_1() {runTest("IncompatibleClassChangeError - errorscenario");}
   public void testIncompatibleClassChangeError_pr113630_2() {runTest("IncompatibleClassChangeError - workingscenario");}
@@ -731,7 +732,18 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
   public void testXlintMessageForImproperAnnotationType_pr115252_Parameter() {runTest("xlint message for improper annotated parameter type");}  
   public void testXlintMessageForImproperAnnotationType_pr115252_Throws() {runTest("xlint message for improper annotated throws pattern");}  
   public void testXlintMessageForImproperAnnotationType_pr115252_MoreThanOne() {runTest("xlint message for more than one improper annotated parameter type");}  
-    
+  
+  public void testDeclareAtTypeInStructureModel_pr115607() {
+      AsmManager.setReporting("c:/debug.txt",true,true,true,true);
+         runTest("declare at type appears correctly in structure model");  
+         IHierarchy top = AsmManager.getDefault().getHierarchy();
+         IProgramElement pe = top.findElementForLabel(top.getRoot(),
+                         IProgramElement.Kind.DECLARE_ANNOTATION_AT_TYPE,"declare @type: Simple : @I");                 
+         assertNotNull("Couldn't find 'declare @type: Simple : @I' element in the tree",pe);
+         List l = AsmManager.getDefault().getRelationshipMap().get(pe);        
+         assertNotNull("Should have some relationships but does not",l);
+  }
+  
   // helper methods.....
   
   public SyntheticRepository createRepos(File cpentry) {
index 5239733cab5a17f1a71a8c0648619b6f32eb1f0a..8c9354fe4aa3bfb2d5519a57c6bfb10a8e39f77d 100644 (file)
     <ajc-test dir="bugs150" pr="112756" title="pointcut expression containing 'assert'">
      <compile files="Pr112756.aj" options="-warn:assertIdentifier -Xdev:Pinpoint"/>
     </ajc-test>
+    
+    <ajc-test dir="bugs150" pr="117296" title="self bounding generic types">
+     <compile files="PropertySupport.java" options="-1.5"/>
+    </ajc-test>
 
        <ajc-test dir="java5/reflection" title="pointcut parsing with ajc compiled pointcut references">
                <compile files="PointcutLibrary.aj,ReflectOnAjcCompiledPointcuts.java"></compile>
         </compile>
     </ajc-test>
 
+       <ajc-test dir="bugs150" title="declare at type appears correctly in structure model">
+        <compile files="pr115607.java" options="-1.5,-emacssym">
+        </compile>
+    </ajc-test>
+
     <!-- ============================================================================ -->
     <!-- ============================================================================ -->