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 2019/11/22 11:28:22 UTC
[GitHub] [groovy] eric-milles commented on issue #1101: SecureASTCustomizer
double star imports extension
eric-milles commented on issue #1101: SecureASTCustomizer double star imports extension
URL: https://github.com/apache/groovy/pull/1101#issuecomment-557497123
@martin-grofcik Is it possible to implement this feature without adding two lists? That is, could the starImportsWhitelist support "*" and "**" syntax?
```groovy
def configuration = new CompilerConfiguration()
def customizer = new SecureASTCustomizer()
customizer.starImportsBlacklist = ['javax.**', 'jdk.internal.*']
configuration.addCompilationCustomizers(customizer)
def shell = new GroovyShell(configuration)
shell.evaluate '''
import java.util.List // okay
import javax.swing.Action // error
'''
```
----------------------------------------------------------------
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
With regards,
Apache Git Services