tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andy Blower (Updated) (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (TAP5-1601) Under as yet unknown circumstances, a method that references a field with a conduit will not be instrumented, resulting in an NPE accessing the field itself
Date Wed, 26 Oct 2011 16:41:33 GMT

     [ https://issues.apache.org/jira/browse/TAP5-1601?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Andy Blower updated TAP5-1601:
------------------------------

    Attachment: AtCached-issue.zip

Using 5.3-beta-27 this still happens. I found it occurring in other components today as well,
and chose a small simple one to include with PageLayoutBasic. I've attached a zip file with
java & class files of these classes working and not working along with exceptions thrown
and tml file.

I hope that comparing these two, and having a smaller simpler component may help narrow down
what is happening. Again this only seems to occur when running the WAR file in tomcat and
not Jetty from Eclipse, but as far as I can see the JVMs being used are the same.
                
> Under as yet unknown circumstances, a method that references a field with a conduit will
not be instrumented, resulting in an NPE accessing the field itself
> ------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1601
>                 URL: https://issues.apache.org/jira/browse/TAP5-1601
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: plastic, tapestry-core
>    Affects Versions: 5.3
>            Reporter: Howard M. Lewis Ship
>            Assignee: Howard M. Lewis Ship
>            Priority: Blocker
>              Labels: class-transformation
>         Attachments: AtCached-issue.zip
>
>
> From ProQuest, they have a component that has this code:
> public class Layout {
>   @Inject
>   private ComponentResources resources;
>   @Cached
>   public Component getPage() { return resources.getContainer(); }
> }
> The generated bytecode for the advised method looks ok:
>   public getPage()Lorg/apache/tapestry5/runtime/Component;
>   @Lorg/apache/tapestry5/annotations/Cached;()
>     NEW com/proquest/apps/onesearch/components/PageLayoutBasic$Invocation_getPage_123876a5ccf1f215
>     DUP
>     ALOAD 0
>     ALOAD 0
>     GETFIELD com/proquest/apps/onesearch/components/PageLayoutBasic.instanceContext :
Lorg/apache/tapestry5/plastic/InstanceContext;
>     ALOAD 0
>     GETFIELD com/proquest/apps/onesearch/components/PageLayoutBasic.methodinvocationbundle_getPage_123876a5ccf1f22d
: Lorg/apache/tapestry5/internal/plastic/MethodInvocationBundle;
>     INVOKESPECIAL com/proquest/apps/onesearch/components/PageLayoutBasic$Invocation_getPage_123876a5ccf1f215.<init>
(Ljava/lang/Object;Lorg/apache/tapestry5/plastic/InstanceContext;Lorg/apache/tapestry5/internal/plastic/MethodInvocationBundle;)V
>    L0
>     DUP
>     ASTORE 1
>     INVOKEVIRTUAL org/apache/tapestry5/internal/plastic/AbstractMethodInvocation.proceed
()Lorg/apache/tapestry5/plastic/MethodInvocation;
>     ALOAD 1
>     GETFIELD com/proquest/apps/onesearch/components/PageLayoutBasic$Invocation_getPage_123876a5ccf1f215.returnValue
: Lorg/apache/tapestry5/runtime/Component;
>     ARETURN
>    L1
>     LOCALVARIABLE var0 Lcom/proquest/apps/onesearch/components/PageLayoutBasic$Invocation_getPage_123876a5ccf1f215;
L0 L1 1
>     MAXSTACK = 1
>     MAXLOCALS = 1
> ... but the bytecode for the advised method is not instrumented:
>   public advised$getPage_123876a5ccf1f216()Lorg/apache/tapestry5/runtime/Component;
>   @Lorg/apache/tapestry5/annotations/Cached;()
>     ALOAD 0
>     GETFIELD com/proquest/apps/onesearch/components/PageLayoutBasic.resources : Lorg/apache/tapestry5/ComponentResources;
>     INVOKEINTERFACE org/apache/tapestry5/ComponentResources.getContainer ()Lorg/apache/tapestry5/runtime/Component;
>     ARETURN
>     MAXSTACK = 1
>     MAXLOCALS = 1
> ... even though the necessary field conduit support method is present:
>   // access flags 0x1010
>   final getfieldvalue_resources()Lorg/apache/tapestry5/ComponentResources;
>     ALOAD 0
>     GETFIELD com/proquest/apps/onesearch/components/PageLayoutBasic.resources_FieldConduit
: Lorg/apache/tapestry5/plastic/FieldConduit;
>     ALOAD 0
>     ALOAD 0
>     GETFIELD com/proquest/apps/onesearch/components/PageLayoutBasic.instanceContext :
Lorg/apache/tapestry5/plastic/InstanceContext;
>     INVOKEINTERFACE org/apache/tapestry5/plastic/FieldConduit.get (Ljava/lang/Object;Lorg/apache/tapestry5/plastic/InstanceContext;)Ljava/lang/Object;
>     CHECKCAST org/apache/tapestry5/ComponentResources
>     DUP
>     ALOAD 0
>     SWAP
>     PUTFIELD com/proquest/apps/onesearch/components/PageLayoutBasic.resources : Lorg/apache/tapestry5/ComponentResources;
>     ARETURN
>     MAXSTACK = 0
>     MAXLOCALS = 0
> ... also, looking at the real class, from the client, as transformed, many other methods
containing references to the field are being transformed.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message