Re: Project question


Subject: Re: Project question
From: John Sung (john_j_sung@yahoo.com)
Date: Thu Feb 28 2002 - 19:37:10 EST


I would just like to point out two things.

The constructor methods in AspectJTraversal can throw
an Exception. You need to catch that and do something
with it. Most likely, print something out.

So, enclose your constructor call with try {
[constructor call] } catch (Exception e) {
System.out.println("Error: " + e);
}

Another error that you'll get is the one where there
is no path since there are no nodes in the class graph
named "here" or "there".

The cg that is passed to you from CreateClassGraph is
the class graph of the current running program from
DJ. That means that when you're running TraversalJ,
the class graph defined in the class dictionary will
be there. Thus, you should have a traversal that would
be valid in your class graph.

John
 

> Hey John,
>
> I'm still trying to get a feel for the project and
> I'm having difficulty
> with the AspectJTraversal.java file.
>
> Here's what I'm doing (just for test sake inside of
> MyListener class)...
>
> Aspect a = Aspect.parse("aspect MyTraversal { " +
> "declare traversal t1:
> \"from CompoundFile to SimpleFile\"; " + "declare
> traversal t2: \"from this
> to that\"; " + "}");
>
> AspectJTraversal ajt = new AspectJTraversal("t1",
> new TraversalGraph("from
> Aspect to *", cg));
>
> AspectJTraversal ajt2 = new AspectJTraversal(cg,
> "t1", "from this to that");
>
> ---> I'm getting the following error message:
>
> Running the compiler...
> gen/MyListener.java:41:28: unreported exception
>
edu.neu.ccs.demeter.aplib.NoSuchClassGraphNodeException;
> must be caught or
> declared to be thrown
> AspectJTraversal ajtrv = new
> AspectJTraversal("t1", new
> TraversalGraph("from Aspect to *", new_cg));
> ^
> gen/MyListener.java:43:29: unreported exception
>
edu.neu.ccs.demeter.aplib.NoSuchClassGraphNodeException;
> must be caught or
> declared to be thrown
> AspectJTraversal ajtrv2 = new
> AspectJTraversal(new_cg, "t1",
> "from Compound to SimpleFile");
> ^
> 2 errors
> Aborting, compiler exited with error value 255.
>
> ---> I've tried to pass in both the ClassGraph cg
> that is passed into
> MyListener and a new ClassGraph new_cg that I have
> created and I'm getting
> the same error...
>
>

__________________________________________________
Do You Yahoo!?
Yahoo! Greetings - Send FREE e-cards for every occasion!
http://greetings.yahoo.com



This archive was generated by hypermail 2b28 : Thu Feb 28 2002 - 19:37:13 EST