Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AJDT » When AsmManager.getDefault().getRelationshipMap().get(p) is null
When AsmManager.getDefault().getRelationshipMap().get(p) is null [message #599211] Wed, 05 November 2008 21:44
Laleh is currently offline Laleh
Messages: 10
Registered: July 2009
Junior Member
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: Fri Jul 25 11:21:20 EDT 2014

Powered by FUDForum. Page generated in 0.04534 seconds