tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dmitry Gusev <dmitry.gu...@gmail.com>
Subject Re: Tapestry 5.5-beta-2 problem: @Parameter field access problem with anonymous classes
Date Fri, 12 Apr 2019 08:41:15 GMT
I ran some more tests and found the problem only exists in Java 11 target
compatibility, it works fine with Java 9 and 10.

Could be a bug in ASM, am I right we're using ASM 7.0 (judging by
plastic/LICENSE-ASM-7_0.txt)?

There's version 7.1 released 3 March 2019 with some bug fixes, I haven't
tried that yet.


On Thu, Apr 11, 2019 at 9:29 PM Dmitry Gusev <dmitry.gusev@gmail.com> wrote:

> Hi team!
>
> Just wanted to share an issue I found trying to upgrade to 5.5-beta-2 and
> Java 11, maybe anyone have seen anything similar before.
>
> In our pages/components it's quite common to build anonymous classes for
> Grid data sources, i.e. say if we have a <t:Grid source="sourceObject"> the
> sourceObject can be defined as anonymous class that's referencing some
> parameter object:
>
> @Parameter
> private Object parameterObject1;
>
> public GridDataSource getSourceObject()
> {
>     return new GridDataSource()
>     {
>         @Override
>         public int getAvailableRows()
>         {
>             return count(parameterObject1); // this does not read from
> parameter conduit
>         }
>     };
> }
>
> I've found that the read access for the parameterObject1 is not replaced
> in this case, and parameterObject1 reads its value from a field instead of
> a conduit.
>
> However, if parameter access is factored out from the anonymous class -
> the value is read as expected, i.e. this works fine:
>
> public GridDataSource getSourceObject()
> {
>     return new MyDataSource(parameterObject1); // this reads the value
> from conduit as expected
> }
>
> public class MyDataSource implements GridDataSource
> {
>     private final Object valueOfParameterObject1;
>
>     public MyDataSource(Object parameterObject1)
>     {
>         this.valueOfParameterObject1 = parameterObject1;
>     }
>
>     @Override
>     public int getAvailableRows()
>     {
>         return count(valueOfParameterObject1);
>     }
> }
>
> I haven't dig any further yet, but assume it can be related with some
> changes in ASM / byte code.
>
> Just thought I'd ask here before I continue.
>
> Best regards,
> Dmitry
>


-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message