You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Howard M. Lewis Ship (JIRA)" <ji...@apache.org> on 2012/08/07 00:59:02 UTC
[jira] [Commented] (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
[ https://issues.apache.org/jira/browse/TAP5-1601?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13429549#comment-13429549 ]
Howard M. Lewis Ship commented on TAP5-1601:
--------------------------------------------
The fix for TAP5-1979 should, I think, fix this bug as well. How can we validate this so I can mark 1601 has fixed?
> 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