groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Grant Haywood <mrgranthayw...@gmail.com>
Subject Re: Moving from (3.0 alpha 4 -> beta 1) causes access error to arise
Date Thu, 08 Aug 2019 06:25:47 GMT
This bug is still present in beta 3.

with this code (access public field of current class inside a closure)


@TypeChecked
@CompileStatic
class KvOp extends KvdnOperation implements KVOperation {
    public KVData D

....


            startOperation(this.valueType, TXTYPE.KV_SUBMIT, key, content, {
                D.getMap(this.strAddr, { AsyncResult<AsyncMap> res ->
......

I get

123: Access to java.lang.Object#D is forbidden @ line 123, column 17.
                   D.getMap(this.strAddr, { AsyncResult<AsyncMap> res ->

It looks like I cannot access any class field from inside an
anonamyous closure.

If i change the line to
                session.D.getMap(this.strAddr, { AsyncResult<AsyncMap> res ->
I get
/home/g/kvdn/src/main/groovy/net/iowntheinter/kvdn/storage/kv/impl/KvOp.groovy:
124: Access to java.lang.Object#session is forbidden @ line 124,
column 17.
                   session.D.getMap(this.strAddr, { AsyncResult<AsyncMap> res ->






On 7/15/19, Grant Haywood <mrgranthaywood@gmail.com> wrote:
> This bug is still present in 3.0.0-beta2
>
> On Sun, May 26, 2019 at 2:45 PM Grant Haywood <mrgranthaywood@gmail.com>
> wrote:
>
>> I have attempted a build against 3.0.0-20190525.075505-1086 (are
>> groovy-json build numbers out of sync?
>> i ended up using                        3.0.0-20190525.183916-1086 for
>> groovy-json)
>>
>> I still get the same error, however this time line information is
>> available!
>>
>> KvOp.groovy: 115: Access to java.lang.Object#D is forbidden @ line 115,
>> column 13.
>>                D.getMap(this.strAddr, { AsyncResult<AsyncMap> res ->
>>                ^
>>
>> That is progress, I still don't know why there is access forbidden here
>> however :/
>>
>> On Sun, May 26, 2019 at 9:13 PM Paul King <paulk@asert.com.au> wrote:
>>
>>> There are a couple of bugs fixed already which sound similar. If you can
>>> try a snapshot version (see downloads page), and see if your problems
>>> are
>>> already fixed, that would be great.
>>>
>>> On Mon, May 27, 2019 at 7:09 AM Grant Haywood <mrgranthaywood@gmail.com>
>>> wrote:
>>>
>>>> Hello;
>>>> Building my project on groovy 3.0 beta 1 causes an error I have not
>>>> seen
>>>> before.
>>>>
>>>>     -1: Access to java.lang.Object#D is forbidden @ line -1, column -1.
>>>>
>>>> The line information seems to be suppressed  or lost
>>>>
>>>> D is declared typed at the top of the class
>>>>     public KVData D
>>>>
>>>> it is assigned in the constructor
>>>>     this.D = session.D
>>>>
>>>> and used in several methods, always in the form D.getMap(.....
>>>>
>>>> in session (where D is assigned from) it is also declared typed and
>>>> public
>>>>     public KVData D, M
>>>>
>>>> Has any one else had this type of issue with beta-1?
>>>>
>>>>
>


-- 


-Grant Haywood

Mime
View raw message