Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Modified classes of the Jar files in Inpath (which shouldn't be modified)

Ok, now we have a clue :)
It's a shame that I haven't tried -verbose before, sorry. Anyways..

Now the modified class has in its disassembled code, at the top below class
names etc:
org.aspectj.weaver.WeaverVersion: length = 0xC
   00 03 00 00 00 00 00 00 00 00 00 00 
  org.aspectj.weaver.WeaverState: length = 0x1231
   53 00 00 00 01 00 30 63 6F 6D 2E 73 69 65 6D 65
   6E 73 2E 70 6F 65 74 69 63 2E 61 73 70 65 63 74
   2E 50 6F 65 74 69 63 54 72 61 6E 73 66 6F 72 6D...
.................

and at the bottom of the constants section:
const #484 = Asciz	org.aspectj.weaver.WeaverVersion;
const #485 = Asciz	org.aspectj.weaver.WeaverState;
const #486 = Asciz	LineNumberTable;

and this stuff scattered around:
LineNumberTable: 
   line 1: 0

So there still remains some questions for me:
1. Why does Jad create the same java files when they are decompiled?
2. Why are these instructions added even though this class is not advised by
my aspect?
3. What is the LineNumberTable thing for? (curious)
4. What is the binary stuff at the top? (curious)
5. Is it possible to stop this class from being modified, without
restricting the classes to be weaved by AspectJ? I mean using the language
consructs...

And here is a code snippet:
public aspect ClassAPatch {
	
	pointcut methodAExecution(ClassB b, String s) :
		within(ClassA) &&
		execution(public static ClassB ClassA.getClassB(ClassB, String)) &&
		args(b, s);
	
	ClassB around(ClassB b, String s) 
		throws SomeException
		: methodAExecution(b, s) {
		
    		// do stuff
		// proceed() etc
	}
}

Here ClassA should be modified but ClassB turns out to be modified too...

Thanks.



Andy Clement wrote:
> 
> Use "javap -private -verbose" to see everything in the class.
> 
> On 27/02/07, bora.erbas <bora.erbas@xxxxxxxxx> wrote:
>>
>>
>> Hi there, thanks a lot for the response.
>>
>> At the moment I am not able to provide a code snippet.
>>
>> When using javap I used -c -private to create the assembly codes, and
>> compared both files using WinMerge which actually compares every bit of
>> them. There is no single difference.
>>
>> Now I will try the command line stuff as you suggested and see what
>> happens.
>> I will try to come back with more details, and a snippet of code too.
>>
>> When I mentioned that there is a side-effect class file; I didn't mean
>> that
>> a class file appears as a side effect, I meant a class file is modified
>> even
>> though (I think) it shouldn't be modified; the side effect is not the
>> file
>> itself, it is it being modified. Anyway, I hope I managed to make this
>> clearer, because I think it is not clear in my original post. The class
>> file
>> is just an ordinary class file from the 3rd party framework, which
>> happens
>> to be used as an argument in the advice that causes it to be modified.
>> Can
>> this be a clue? But the advice does not apply to it...
>>
>> Anyway, I will come back with more info.
>> Thanks a lot.
>>
>>
>>
>> Andy Clement wrote:
>> >
>> > If you are able to include a snippet of code that always helps makes
>> > the situation easier for us to understand.  What is the name of the
>> > 'side effect file'?  If AspectJ is unable to implement inlining for
>> > around advice, you will get closure classes generated during weaving.
>> > You say you used javap to compare the two files - did you compare
>> > every part of them, not just the method contents but everything - was
>> > there a large attribute in the larger of the two?  Did you use
>> > '-private' when you ran javap?
>> >
>> > As I say - a bit of code that demonstrates what you are seeing would
>> > help immensely.  I cannot recreate this without more info.  Have you
>> > tried performing your compilation step outside of AJDT, does it behave
>> > in the same unusual way on the command line?
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Modified-classes-of-the-Jar-files-in-Inpath-%28which-shouldn%27t-be-modified%29-tf3299223.html#a9179471
>> Sent from the AspectJ - users mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> aspectj-users mailing list
>> aspectj-users@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
> 
> 

-- 
View this message in context: http://www.nabble.com/Modified-classes-of-the-Jar-files-in-Inpath-%28which-shouldn%27t-be-modified%29-tf3299223.html#a9180659
Sent from the AspectJ - users mailing list archive at Nabble.com.



Back to the top