Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] AspectJ and Axis

On a quick read, looks like
https://bugs.eclipse.org/bugs/show_bug.cgi?id=194314 that is already
raised on Aj bugzilla.

Andy.

On 18/07/07, Thilo Focke <thilo.focke@xxxxxxxxx> wrote:
Hi,

because the problem still exists for me and is really annoying, some
more information. I used the DJ java decompiler and decompiled the class
file that was not weaved by aspectj and in the next step the class file
that was weaved by aspectj.

The decompiled class without aspectj looks like this:

public class MyClass {

    public MyClass () {
    }

    public Result doSomething(String firstname, String lastname, String
nickname, boolean someFlag) throws ServiceException {
        MyService myService = SpringBeanFactory.getMyService();
        return myService.doSomething(firstname, lastname, nickname,
someFlag);
    }
}



This class is published as a WebService by Apache Axis. The generated
WSDL files contains the correct parameter names (firstname, lastname,
nickname, someFlag).
The decompiled class that was woven by aspectj looks like this:


public class MyClass  implements SecurityAccess {

    public MyClass  () {
    }

    public Result doSomething(String s, String s1, String s2, boolean
flag) throws ServiceException {
        String s3 = s;
        String s4 = s1;
        String s5 = s2;
        boolean flag1 = flag;
        return (Result )doSomething_aroundBody1$advice(this, s3, s4, s5,
flag1, SecurityAccessController.aspectOf(), this, null, ajc$tjp_0);
    }

    private static final Result doSomething_aroundBody0(MyClass this,
String firstname, String lastname, String nickname, boolean someFlag) {
        MyService myService = SpringBeanFactory.getMyService();
        return myService.doSomething(firstname, lastname, nickname,
someFlag);
    }

    private static final Object
doSomething_aroundBody1$advice(SecurityAccessController this, Object
controller, AroundClosure ajc_aroundClosure,
org.aspectj.lang.JoinPoint.StaticPart thisJoinPointStaticPart,
MessageContext context, String userInformation, String user, String
className,
            String methodName) {
            // ** some security handling here **
           return doSomething_aroundBody0((MyClass)s5, ((String)
(controller)), ajc_aroundClosure, thisJoinPointStaticPart, context);
    }

    private static final org.aspectj.lang.JoinPoint.StaticPart
ajc$tjp_0; /* synthetic field */

    static
    {
        Factory factory = new Factory("MyClass.java",
Class.forName("MyClass"));
        ajc$tjp_0 = factory.makeSJP("method-execution",
factory.makeMethodSig("1", "doSomething", "MyClass",
"java.lang.String:java.lang.String:java.lang.String:boolean:",
"firstname:lastname:nickname:someFlag:", "ServiceException:", "Result"),
11);
    }


This class is now also published as a WebService by Apache Axis. The
generated WSDL files does NOT contain the correct parameter names
(firstname, lastname, nickname, someFlag). Instead it contains only the
parameter names "in0, in1, in2, in3". The real parameter names are lost.
This is because the signature of the WebService class for method
doSomething does not contain the real parameter names anymore, the
signature "String firstname, String lastname, String nickname, boolean
someFlag" changed to "String s, String s1, String s2, boolean flag".

Does anyone know how to force aspectj from changing the parameter names
of the method?

Thanks for any help!!!
_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users



Back to the top