You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (Jira)" <ji...@apache.org> on 2020/09/15 03:25:00 UTC
[jira] [Resolved] (GROOVY-9700) SC: set groovy property written for
variable expression assignment that should be direct setter call
[ https://issues.apache.org/jira/browse/GROOVY-9700?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Paul King resolved GROOVY-9700.
-------------------------------
Fix Version/s: 3.0.6
4.0.0-alpha-1
Resolution: Fixed
> SC: set groovy property written for variable expression assignment that should be direct setter call
> ----------------------------------------------------------------------------------------------------
>
> Key: GROOVY-9700
> URL: https://issues.apache.org/jira/browse/GROOVY-9700
> Project: Groovy
> Issue Type: Bug
> Reporter: Eric Milles
> Assignee: Eric Milles
> Priority: Major
> Fix For: 4.0.0-alpha-1, 3.0.6
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> Consider the following:
> {code:groovy}
> class A {
> void setX(Date value) {}
> void setX(Long value) {}
> }
> class B extends A {
> void m() {
> x = 42L
> x = new Date()
> }
> }
> {code}
> When compiled with {{@compileStatic}} the method "m" contains calls to {{ScriptBytecodeAdapter.setGroovyObjectProperty}} for the assignment statements. If "x" is replaced by "this.x" direct setter calls are written instead, as expected.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)