You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by GitBox <gi...@apache.org> on 2020/08/07 04:06:59 UTC
[GitHub] [groovy] paulk-asert opened a new pull request #1342: GROOVY-9675: There should be a mechanism to disable individual macro …
paulk-asert opened a new pull request #1342:
URL: https://github.com/apache/groovy/pull/1342
…methods & extension methods
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [groovy] paulk-asert commented on pull request #1342: GROOVY-9675: There should be a mechanism to disable individual macro …
Posted by GitBox <gi...@apache.org>.
paulk-asert commented on pull request #1342:
URL: https://github.com/apache/groovy/pull/1342#issuecomment-670772378
We could probably do the `-Dgroovy.macro.disable=foo,bar` variant. We want something that is going to be fast, so I'd avoid Patterns.
A compiler configuration option isn't enough - it doesn't cover dynamic Groovy and I think it might be a little messy trying to block off access to extensions/macros once they are in our caches. Good news though for @CompileStatic code is that you only need the switch during compilation.
We could get fancier trying to disable particular variants of extensions/macros but I felt YAGNI calling. I imagine disabling would mostly be for folks already using methods with those names when new macros are introduced. They'd just want to block all variants and perhaps consider refactoring and removing the disable switch later.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [groovy] danielsun1106 commented on pull request #1342: GROOVY-9675: There should be a mechanism to disable individual macro …
Posted by GitBox <gi...@apache.org>.
danielsun1106 commented on pull request #1342:
URL: https://github.com/apache/groovy/pull/1342#issuecomment-671006159
Merged. Thanks.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [groovy] paulk-asert commented on pull request #1342: GROOVY-9675: There should be a mechanism to disable individual macro …
Posted by GitBox <gi...@apache.org>.
paulk-asert commented on pull request #1342:
URL: https://github.com/apache/groovy/pull/1342#issuecomment-670818274
@eric-milles adjusted as per your suggestion
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [groovy] eric-milles commented on pull request #1342: GROOVY-9675: There should be a mechanism to disable individual macro …
Posted by GitBox <gi...@apache.org>.
eric-milles commented on pull request #1342:
URL: https://github.com/apache/groovy/pull/1342#issuecomment-670514899
Is there ever a reason to set one of these properties to true? Instead how about one property that is set the the name(s) of the disabled macros or extensions? Like, `-Dgroovy.macro.disable=*` or `-Dgroovy.macro.disable=foo,bar` or a pattern that could be compiled once and matched against the names.
Will it be possible to disable macros or extensions using compiler configuration? Or is this just a system property mechanism? IMO there are too many special system property controls/switches.
If I want to disable just one instance of `each` or `getAt` (for example) is that possible or must it be all or none?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [groovy] danielsun1106 merged pull request #1342: GROOVY-9675: There should be a mechanism to disable individual macro …
Posted by GitBox <gi...@apache.org>.
danielsun1106 merged pull request #1342:
URL: https://github.com/apache/groovy/pull/1342
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [groovy] paulk-asert commented on pull request #1342: GROOVY-9675: There should be a mechanism to disable individual macro …
Posted by GitBox <gi...@apache.org>.
paulk-asert commented on pull request #1342:
URL: https://github.com/apache/groovy/pull/1342#issuecomment-670311104
Since checking individual methods could have a performance impact, I have used a single system property to turn on the disabling feature. E.g.
```
-Dgroovy.macro.disable=true // turn on globally
-Dgroovy.macro.disable.foo=true // disable the 'foo' macro (any macro with that name)
-Dgroovy.extension.disable=true // turn on globally
-Dgroovy.extension.disable.dump=true // disable the 'dump' extension method (any with that name)
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org