Skip to main content



      Home
Home » Language IDEs » AspectJ » When AsmManager.getDefault().getRelationshipMap().get(p) is null
When AsmManager.getDefault().getRelationshipMap().get(p) is null [message #599211] Wed, 05 November 2008 21:44
Eclipse UserFriend
Hello Everyone,

I am working an a small project in which we are interested in collecting
information about the method being advised. I looked in sample codes where
ASM packages is used. But I have a problem, in code below:

// .. some code
String[] args = new String[files.length + 1];
args[0] = "-emacssym";
for (int i = 0; i < files.length; i++) {
args[i + 1] = files[i].getAbsolutePath();
}
runMain(args, false);
}

public void runMain(String[] args, boolean useSystemExit) {
super.runMain(args, useSystemExit);
IProgramElement hierarchyRoot =
AsmManager.getDefault().getHierarchy().getRoot();
hierarchyRoot.walk(new MyHierarchyWalker());
}
and then in class MyHierarchyWalker I have the follwing:

public class MyHierarchyWalker extends HierarchyWalker{

public void preProcess(IProgramElement p) {

if (p.getKind().equals(IProgramElement.Kind.METHOD)) {

List relationships = AsmManager.getDefault().getRelationshipMap().get(p);
if (relationships != null){
for (Iterator it = relationships.iterator(); it.hasNext(); ) {
IRelationship relation = (IRelationship)it.next();

// .. some code}
}}

The problem is that "relationships" is null so I cannot do anything with
it. I checked it with different case studies all in AspectJ examples
package. For space war example the "relationships" is null but for
"Tracing Example" and "Telecomm Example" it is working and it gives all
the methods being advised.
Can any one tell me why it is working for one example and not for the
other?

THANKS A LOT
Previous Topic:ArrayIndexOutOfBoundsException on around advice (CTW, not LTW)
Next Topic:Bundle 'org.aspectj.runtime' cannot be resolved
Goto Forum:
  


Current Time: Thu Jul 10 01:33:47 EDT 2025

Powered by FUDForum. Page generated in 0.04093 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top