I have a java file as follows
package sample;
public class Profile
{
public static String myName(String name)
{
myhobby("Football");
return name;
}
public static String myhobby(String hobby)
{
return hobby;
}
}
I build this file and added the jar file into the below code...
import sample.Profile;
public class Hello
{
public static String sayHello(String name)
{
String enter=Test.myName("Ganguly");
return name;
}
public static void main(String[] args)
{
String next = sayHello("Company");
}
}
And I wrote aspect as follows...
pointcut printMessage(String name) : call(public static String myhobby(..)) && args (name));
before(String name) : printMessage(name) {
System.out.println("value is: "+ name);
}
But when I run the program...it doesn't printed the parameter value of the function hobby... can any one correct me if I am wrong... Thanks in advance...