Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AspectJ » When AsmManager.getDefault().getRelationshipMap().get(p) is null
When AsmManager.getDefault().getRelationshipMap().get(p) is null [message #599211] Thu, 06 November 2008 02:44
Laleh is currently offline LalehFriend
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: Thu Apr 25 22:25:04 GMT 2024

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

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

Back to the top