=== END OF MODEL REPORT =========
=== RELATIONSHIPS REPORT ========= After a batch build
(targets=1) <pkg[AbstractBeanConfigurerAspect.class (binary)}AbstractBeanConfigurerAspect&afterReturning (advises) <test{Simple.java[Simple~Simple
-(targets=1) <pkg[AbstractBeanConfigurerAspect.class (binary)}AbstractBeanConfigurerAspect&before!2 (advises) <test{Simple.java[Simple~Simple
+(targets=1) <pkg[AbstractBeanConfigurerAspect.class (binary)}AbstractBeanConfigurerAspect&before (advises) <test{Simple.java[Simple~Simple
(targets=2) <test{Simple.java[Simple~Simple (advised by) <pkg[AbstractBeanConfigurerAspect.class (binary)}AbstractBeanConfigurerAspect&afterReturning
-(targets=2) <test{Simple.java[Simple~Simple (advised by) <pkg[AbstractBeanConfigurerAspect.class (binary)}AbstractBeanConfigurerAspect&before!2
+(targets=2) <test{Simple.java[Simple~Simple (advised by) <pkg[AbstractBeanConfigurerAspect.class (binary)}AbstractBeanConfigurerAspect&before
=== END OF RELATIONSHIPS REPORT ==
=== Properties of the model and relationships map =====
import reference=2
--- /dev/null
+package spacewar;
+
+//=Spacewar Example/src<spacewar*Handles.aj}Handles
+public aspect Handles {
+
+ // =Spacewar Example/src<spacewar*Handles.aj}Handles&before
+ before() : execution(* *..*()) {
+
+ }
+ // =Spacewar Example/src<spacewar*Handles.aj}Handles&before!2
+ before() : execution(* *..*()) {
+
+ }
+ // =Spacewar Example/src<spacewar*Handles.aj}Handles&before&I
+ before(int x) : execution(* *..*(int)) && args(x) {
+
+ }
+
+ // =Spacewar Example/src<spacewar*Handles.aj}Handles&before&I!2
+ before(int x) : execution(* *..*(int)) && args(x) {
+
+ }
+
+ // =Spacewar Example/src<spacewar*Handles.aj}Handles&after
+ after() : execution(* *..*()) {
+
+ }
+
+ // =Spacewar Example/src<spacewar*Handles.aj}Handles&afterReturning
+ after() returning() : execution(* *..*()) {
+
+ }
+
+ // =Spacewar Example/src<spacewar*Handles.aj}Handles&afterThrowing
+ after() throwing(): execution(* *..*()) {
+
+ }
+
+ // =Spacewar Example/src<spacewar*Handles.aj}Handles&afterThrowing&I
+ after(int x) throwing(): execution(* *..*(int)) && args(x) {
+
+ }
+
+}
+
package org.aspectj.systemtest.incremental.tools;
import java.io.File;
+import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
}
public void setSourceFolderFor(File sourceFile,String sourceFolder) {
- sourceFolders.put(sourceFile.getPath(),sourceFolder);
+ try {
+ System.out.println("Stored against "+sourceFile.getCanonicalPath());
+ sourceFolders.put(sourceFile.getCanonicalPath(),sourceFolder);
+ } catch (IOException e) {
+ e.printStackTrace();
+ throw new RuntimeException(e);
+ }
}
public void setOutputLocForResource(File f) {
}
public String getSourceFolderForFile(File sourceFile) {
- String f = (String)sourceFolders.get(sourceFile.getPath());
- return f;
+ try {
+ System.out.println("Looked up against "+sourceFile.getCanonicalPath());
+ String f = (String)sourceFolders.get(sourceFile.getCanonicalPath());
+ return f;
+ } catch (IOException e) {
+ e.printStackTrace();
+ throw new RuntimeException(e);
+ }
}
}
import org.aspectj.asm.internal.JDTLikeHandleProvider;
import org.aspectj.asm.internal.Relationship;
import org.aspectj.bridge.IMessage;
+import org.aspectj.bridge.SourceLocation;
import org.aspectj.tools.ajc.Ajc;
import org.aspectj.util.FileUtil;
dumptree(AsmManager.getDefault().getHierarchy().getRoot(), 0);
// incomplete
}
+
+ public void testAdviceHandlesAreJDTCompatible() {
+ String p = "AdviceHandles";
+ initialiseProject(p);
+ addSourceFolderForSourceFile(p, getProjectRelativePath(p, "src/Handles.aj"), "src");
+ build(p);
+ IProgramElement root = AsmManager.getDefault().getHierarchy().getRoot();
+ IProgramElement typeDecl = findElementAtLine(root,4);
+ assertEquals("=AdviceHandles/src<spacewar*Handles.aj}Handles",typeDecl.getHandleIdentifier());
+
+ IProgramElement advice1 = findElementAtLine(root,7);
+ assertEquals("=AdviceHandles/src<spacewar*Handles.aj}Handles&before",advice1.getHandleIdentifier());
+
+ IProgramElement advice2 = findElementAtLine(root,11);
+ assertEquals("=AdviceHandles/src<spacewar*Handles.aj}Handles&before!2",advice2.getHandleIdentifier());
+
+ IProgramElement advice3 = findElementAtLine(root,15);
+ assertEquals("=AdviceHandles/src<spacewar*Handles.aj}Handles&before&I",advice3.getHandleIdentifier());
+
+ IProgramElement advice4 = findElementAtLine(root,20);
+ assertEquals("=AdviceHandles/src<spacewar*Handles.aj}Handles&before&I!2",advice4.getHandleIdentifier());
+
+ IProgramElement advice5 = findElementAtLine(root,25);
+ assertEquals("=AdviceHandles/src<spacewar*Handles.aj}Handles&after",advice5.getHandleIdentifier());
+
+ IProgramElement advice6 = findElementAtLine(root,30);
+ assertEquals("=AdviceHandles/src<spacewar*Handles.aj}Handles&afterReturning",advice6.getHandleIdentifier());
+
+ IProgramElement advice7 = findElementAtLine(root,35);
+ assertEquals("=AdviceHandles/src<spacewar*Handles.aj}Handles&afterThrowing",advice7.getHandleIdentifier());
+
+ IProgramElement advice8 = findElementAtLine(root,40);
+ assertEquals("=AdviceHandles/src<spacewar*Handles.aj}Handles&afterThrowing&I",advice8.getHandleIdentifier());
+
+ }
+
+ private IProgramElement findElementAtLine(IProgramElement whereToLook, int line) {
+ if (whereToLook == null) {
+ return null;
+ }
+ if (whereToLook.getSourceLocation()!=null && whereToLook.getSourceLocation().getLine()==line) {
+ return whereToLook;
+ }
+ List kids = whereToLook.getChildren();
+ for (Iterator iterator = kids.iterator(); iterator.hasNext();) {
+ IProgramElement object = (IProgramElement) iterator.next();
+ if (object.getSourceLocation()!=null && object.getSourceLocation().getLine()==line) {
+ return object;
+ }
+ IProgramElement gotSomething = findElementAtLine(object,line);
+ if (gotSomething!=null) {
+ return gotSomething;
+ }
+ }
+ return null;
+ }
public void testModelWithMultipleSourceFolders() {
initialiseProject("MultiSource");