[ 
https://issues.apache.org/jira/browse/GROOVY-3056?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18149583#comment-18149583
 ] 

ASF GitHub Bot commented on GROOVY-3056:
----------------------------------------

testlens-app[bot] commented on PR #3346:
URL: https://github.com/apache/groovy/pull/3346#issuecomment-7092874918

   ## ✅ All tests passed ✅
   
   🏷️ Commit: 10b98d8fc3522734894e71847d159387ddfbb8c3
   ▶️ Tests:  144956 executed
   ⚪️ Checks: 27/27 completed
   
   ---
   _Learn more about TestLens at 
[testlens.app/docs](https://testlens.app/docs/features/pr-comment/)._
   




> Cannot override getter of property starting with "_" using ExpandoMetaClass
> ---------------------------------------------------------------------------
>
>                 Key: GROOVY-3056
>                 URL: https://issues.apache.org/jira/browse/GROOVY-3056
>             Project: Groovy
>          Issue Type: Bug
>          Components: groovy-runtime
>    Affects Versions: 1.5.6
>            Reporter: Peter Ledbrook
>            Assignee: Daniel Sun
>            Priority: Major
>         Attachments: ExpandoMetaClassUnderscoreTests.groovy
>
>
> For most properties you can use code like this to override property read 
> access:
> {code}
> MyClass.metaClass.getMyProp = {-> return "New value" }
> {code}
> Groovy's {{getProperty()}} method will then call the above code so objects of 
> class {{MyClass}} will appear to have the new value for that property. 
> However, if the property starts with an underscore, this behaviour breaks 
> down:
> {code}
> MyClass.metaClass.get_ajax = {-> return "Some value" }
> {code}
> The above method will not be called if one uses {{getProperty("_ajax")}}. 
> Test case attached.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to