Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] jpsp.getSignature().getDeclaringTypeName() returns java.lang.ClassNotFoundException

Hello,

So I am using AspectJ to profile some methods and would like to extract the
method name and enclosing class via:
1. jpsp.getSignature().getName() for method name
2. jpsp.getSignature().getDeclaringTypeName() for declaring class name

However, the catch is that my java code is first instrumented by AspectJ and
*then obfuscated by Zelix KlassMaster*. Because of this
jpsp.getSignature().getDeclaringTypeName() returns
"java.lang.ClassNotFoundException".

I used JAD to decompile the AspectJ-generated code and saw that the
following code is inserted into the woven class (hmil.Print):
/Factory factory = new Factory("Print.java", hmil / Print);
ajc$tjp_0 = factory.makeSJP("method-execution",
factory.makeMethodSig("echo", "hmil.Print", "int", "num", "", "int"), 40);/

Even after Zelix KlassMaster runs (and basically renames the class
hmil.Print to a.Print), the AspectJ inserted code simply changes to:
/Factory factory = *new Factory("Print.java", a / Print);*
ajc$tjp_0 = factory.makeSJP("method-execution",
factory.makeMethodSig("echo", "hmil.Print", "int", "num", "", "int"), 40);/


Because of this, I believe that the static joinpoint still contains the
enclosing class name ("hmil.Print"). How can I access this information
without getting a ClassNotFoundException?

Thanks in advance.



--
View this message in context: http://aspectj.2085585.n4.nabble.com/jpsp-getSignature-getDeclaringTypeName-returns-java-lang-ClassNotFoundException-tp4650751.html
Sent from the AspectJ - users mailing list archive at Nabble.com.


Back to the top