Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] How do I write this aspect.

Title: Message
Folks,
 
I have the following situation.
 
Class X {
    ...
    Rtype foo(int i, int j) {
        switch (..) {
        ...
        case ..:
            ...
            new Long(bar(..));
            ...
            break;
        case ..:
            ...
            new Double(bar(..));
            ...
        ...
        }
        ...
    }
    ...
    String bar(..) {
        ...
    }
    ...
}
 
I want to write an advice such that if a new Long(String) is performed in X.foo() then I want to replace that String with a String processed by my advice. I am having trouble writing it.
 
cheers,
pdhoolia

Back to the top