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 10:35:41 UTC

[GitHub] [groovy] martin-grofcik opened a new pull request #1101: SecureASTCustomizer double star imports extension

martin-grofcik opened a new pull request #1101: SecureASTCustomizer double star imports extension
URL: https://github.com/apache/groovy/pull/1101
 
 
   adding ** convention to imports
   ```
       void testDoubleStarImportWhiteList() {
           def shell = new GroovyShell(configuration)
           customizer.doubleStarImportsWhitelist = ['java.util.**']
           shell.evaluate("""
               import java.util.ArrayList
               new ArrayList()
           """)
   
           shell.evaluate("""
               import java.util.concurrent.atomic.AtomicInteger
               new AtomicInteger(0)
           """)
           shell.evaluate("""
               import java.util.*
               import java.util.concurrent.atomic.*
               new ArrayList()
               new AtomicInteger(0)
           """)
           assert hasSecurityException {
               shell.evaluate("""
               import java.math.BigDecimal
               new BigDecimal("35")
           """)
           }
       }
   ```

----------------------------------------------------------------
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