groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pa...@apache.org
Subject groovy git commit: trivial refactor: some tidying up of comments and switch away from using pop() method to avoid potential problems if we fix GROOVY-6396
Date Sun, 11 Sep 2016 02:09:12 GMT
Repository: groovy
Updated Branches:
  refs/heads/master 1c10e3474 -> 84f6288b9


trivial refactor: some tidying up of comments and switch away from using pop() method to avoid
potential problems if we fix GROOVY-6396


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/84f6288b
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/84f6288b
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/84f6288b

Branch: refs/heads/master
Commit: 84f6288b972d0eb864f26df654dde48dc17ab194
Parents: 1c10e34
Author: paulk <paulk@asert.com.au>
Authored: Sun Sep 11 12:08:55 2016 +1000
Committer: paulk <paulk@asert.com.au>
Committed: Sun Sep 11 12:08:55 2016 +1000

----------------------------------------------------------------------
 src/main/groovy/util/ConfigSlurper.groovy | 30 ++++++++++++++------------
 1 file changed, 16 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/84f6288b/src/main/groovy/util/ConfigSlurper.groovy
----------------------------------------------------------------------
diff --git a/src/main/groovy/util/ConfigSlurper.groovy b/src/main/groovy/util/ConfigSlurper.groovy
index a587019..20d0723 100644
--- a/src/main/groovy/util/ConfigSlurper.groovy
+++ b/src/main/groovy/util/ConfigSlurper.groovy
@@ -21,21 +21,20 @@ package groovy.util
 import org.codehaus.groovy.runtime.InvokerHelper
 
 /**
- * <p>
  * ConfigSlurper is a utility class for reading configuration files defined in the form of
Groovy
- * scripts. Configuration settings can be defined using dot notation or scoped using closures
+ * scripts. Configuration settings can be defined using dot notation or scoped using closures:
  *
  * <pre><code>
- *   grails.webflow.stateless = true
- *    smtp {
- *        mail.host = 'smtp.myisp.com'
- *        mail.auth.user = 'server'
- *    }
- *    resources.URL = "http://localhost:80/resources"
- * </pre></code>
+ * grails.webflow.stateless = true
+ * smtp {
+ *     mail.host = 'smtp.myisp.com'
+ *     mail.auth.user = 'server'
+ * }
+ * resources.URL = "http://localhost:80/resources"
+ * </code></pre>
  *
- * <p>Settings can either be bound into nested maps or onto a specified JavaBean instance.
In the case
- * of the latter an error will be thrown if a property cannot be bound.
+ * Settings can either be bound into nested maps or onto a specified JavaBean instance.
+ * In the latter case, an error will be thrown if a property cannot be bound.
  *
  * @author Graeme Rocher
  * @author Andres Almiray
@@ -55,6 +54,7 @@ class ConfigSlurper {
 
     /**
      * Constructs a new ConfigSlurper instance using the given environment
+     *
      * @param env The Environment to use
      */
     ConfigSlurper(String env) {
@@ -92,6 +92,7 @@ class ConfigSlurper {
 
     /**
      * Parses a ConfigObject instances from an instance of java.util.Properties
+     *
      * @param The java.util.Properties instance
      */
     ConfigObject parse(Properties properties) {
@@ -153,6 +154,7 @@ class ConfigSlurper {
     /**
      * Parse the given script into a configuration object (a Map)
      * (This method creates a new class to parse the script each time it is called.)
+     *
      * @param script The script to parse
      * @return A Map of maps that can be navigating with dot de-referencing syntax to obtain
configuration entries
      */
@@ -241,7 +243,7 @@ class ConfigSlurper {
                         } finally {
                             currentConditionalBlock.push(conditionalBlockKey)
                         }
-                        stack.pop()
+                        stack.removeLast()
                     }
                 } else {
                     def co
@@ -254,7 +256,7 @@ class ConfigSlurper {
                     assignName.call(name, co)
                     pushStack.call(co)
                     args[0].call()
-                    stack.pop()
+                    stack.removeLast()
                 }
             } else if (args.length == 2 && args[1] instanceof Closure) {
                 try {
@@ -292,7 +294,7 @@ class ConfigSlurper {
 }
 
 /**
- * Since Groovy Script doesn't support overriding setProperty, we have to using a trick with
the Binding to provide this
+ * Since Groovy Script doesn't support overriding setProperty, we use a trick with the Binding
to provide this
  * functionality
  */
 class ConfigBinding extends Binding {


Mime
View raw message