[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [eclipselink-users] Is this duplication expected, or something i'm doing?
|
Oddly enough I've been able to recreate the same thing you are seeing. It
seems to occur only with property access, when the property name does not
match the field name. The duplication should not have any adverse effects,
but is odd.
I think I have a fix that I will check into 1.1 shortly.
I logged the bug,
https://bugs.eclipse.org/bugs/show_bug.cgi?id=261034
Dave Brosius-2 wrote:
>
> The weave task is only executed once, (I've added echo statements at the
> start and end of the weave task) and they are only seen once.
>
> As for versions, i am using
>
> java version "1.5.0_16"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16-b02)
> Java HotSpot(TM) Server VM (build 1.5.0_16-b02, mixed mode)
>
>
> i'm not sure how i would know with Dynamic weaving. as i don't have the
> class files in that case.
>
>
> -----Original Message-----
> From: "James Sutherland" <jamesssss@xxxxxxxxx>
> Sent: Tuesday, January 13, 2009 10:25am
> To: eclipselink-users@xxxxxxxxxxx
> Subject: Re: [eclipselink-users] Is this duplication expected, or
> something i'm doing?
>
>
> That is very odd. Are you running the static weaver multiple times on the
> same jar? What JVM are you using? Can you try using dynamic weaving and
> see if you see the same duplication.
>
>
>
> Dave Brosius-2 wrote:
>>
>> When I javap on all of my classes that are weaved by eclipselink, i see
>> the same method called three times in a row (see below for javap):
>>
>> As in the getter (a synthetic method) _persistence_checkFetched
>>
>> and the setter (my getter) getGlobalFlagValue:()Ljava/lang/String;
>>
>> Obviously, i am calling the getter once.
>>
>> I am using static weaving, in an ant task called from maven
>>
>>
>>
>> classname="org.eclipse.persistence.tools.weaving.jpa.StaticWeave"
>> classpathref="maven.runtime.classpath" fork="true">
>>
>>
>>
>>
>>
>> Here's the JavaP
>>
>> public java.lang.String getGlobalFlagValue();
>> Code:
>> Stack=2, Locals=1, Args_size=1
>> 0: aload_0
>> 1: ldc #138; //String globalFlagValue
>> 3: invokevirtual #87; //Method
>> _persistence_checkFetched:(Ljava/lang/String;)V
>> 6: aload_0
>> 7: ldc #138; //String globalFlagValue
>> 9: invokevirtual #87; //Method
>> _persistence_checkFetched:(Ljava/lang/String;)V
>> 12: aload_0
>> 13: ldc #138; //String globalFlagValue
>> 15: invokevirtual #87; //Method
>> _persistence_checkFetched:(Ljava/lang/String;)V
>> 18: aload_0
>> 19: invokevirtual #140; //Method
>> getGlobalFlag:()Ljava/lang/Boolean;
>> 22: ifnull 38
>> 25: aload_0
>> 26: invokevirtual #140; //Method
>> getGlobalFlag:()Ljava/lang/Boolean;
>> 29: invokevirtual #95; //Method
>> java/lang/Boolean.booleanValue:()Z
>> 32: ifeq 38
>> 35: ldc #97; //String Y
>> 37: areturn
>> 38: ldc #99; //String N
>> 40: areturn
>> LocalVariableTable:
>> Start Length Slot Name Signature
>> 6 35 0 this Lcom/primavera/pr/model/User;
>>
>> LineNumberTable:
>> line 120: 6
>> line 122: 35
>> line 126: 38
>>
>> RuntimeVisibleAnnotations: length = 0xF
>> 00 02 01 FFFFFF94 00 00 01 FFFFFF8C 00 01 01 FFFFFF8D 73 01 FFFFFF9B
>>
>> public void setGlobalFlagValue(java.lang.String);
>> Code:
>> Stack=4, Locals=3, Args_size=2
>> 0: aload_0
>> 1: invokevirtual #143; //Method
>> getGlobalFlagValue:()Ljava/lang/String;
>> 4: astore_2
>> 5: aload_0
>> 6: invokevirtual #143; //Method
>> getGlobalFlagValue:()Ljava/lang/String;
>> 9: astore_2
>> 10: aload_0
>> 11: invokevirtual #143; //Method
>> getGlobalFlagValue:()Ljava/lang/String;
>> 14: astore_2
>> 15: aload_0
>> 16: ldc #97; //String Y
>> 18: aload_1
>> 19: invokevirtual #108; //Method
>> java/lang/String.equals:(Ljava/lang/Object;)Z
>> 22: invokestatic #112; //Method
>> java/lang/Boolean.valueOf:(Z)Ljava/lang/Boolean;
>> 25: putfield #135; //Field globalFlag:Ljava/lang/Boolean;
>> 28: aload_0
>> 29: ldc #138; //String globalFlagValue
>> 31: aload_2
>> 32: aload_1
>> 33: invokevirtual #116; //Method
>> _persistence_propertyChange:(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V
>> 36: return
>> LocalVariableTable:
>> Start Length Slot Name Signature
>> 5 32 0 this Lcom/primavera/pr/model/User;
>> 5 32 1 globalFlag Ljava/lang/String;
>>
>> LineNumberTable:
>> line 132: 5
>> line 133: 28
>>
>>
>
>
-----
---
http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland
http://www.eclipse.org/eclipselink/
EclipseLink , http://www.oracle.com/technology/products/ias/toplink/
TopLink
Wiki: http://wiki.eclipse.org/EclipseLink EclipseLink ,
http://wiki.oracle.com/page/TopLink TopLink
Forums: http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink ,
http://www.nabble.com/EclipseLink-f26430.html EclipseLink
Book: http://en.wikibooks.org/wiki/Java_Persistence Java Persistence
--
View this message in context: http://www.nabble.com/Is-this-duplication-expected%2C-or-something-i%27m-doing--tp21421829p21458943.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.