Freewind
Freewind

Reputation: 198218

Can AspectJ find all variable declarations and log them in a method?

For example, I have a java method like this:

public void hello() {
   String name = "Freewind";
   String message = "Welcome";
   System.out.println(message + name);
}

Then I want to use AspectJ to log the variables:

public void hello() {
   String name = "Freewind";
   log("New variable: name");           // by aspectj
   String message = "Welcome";
   log("New variable: message");           // by aspectj
   System.out.println(message + name);
}

Is it possible with AspectJ?

Upvotes: 0

Views: 166

Answers (1)

kriegaex
kriegaex

Reputation: 67297

No.

Sorry for the brief answer, but there is not much more to say about it.

Upvotes: 3

Related Questions