Repository: ant
Updated Branches:
  refs/heads/master 82c2c3331 -> 2f0c40bc2


Remove redundant return

Project: http://git-wip-us.apache.org/repos/asf/ant/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/2f0c40bc
Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/2f0c40bc
Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/2f0c40bc

Branch: refs/heads/master
Commit: 2f0c40bc23dce7225a16acbd4e1cfa28e628e274
Parents: 82c2c33
Author: Gintas Grigelionis <gin...@apache.org>
Authored: Wed Apr 11 17:50:40 2018 +0200
Committer: Gintas Grigelionis <gin...@apache.org>
Committed: Wed Apr 11 17:50:40 2018 +0200

----------------------------------------------------------------------
 src/main/org/apache/tools/ant/util/ScriptRunnerBase.java | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ant/blob/2f0c40bc/src/main/org/apache/tools/ant/util/ScriptRunnerBase.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/util/ScriptRunnerBase.java 
b/src/main/org/apache/tools/ant/util/ScriptRunnerBase.java
index eae129d..1b36a7a 100644
--- a/src/main/org/apache/tools/ant/util/ScriptRunnerBase.java
+++ b/src/main/org/apache/tools/ant/util/ScriptRunnerBase.java
@@ -92,12 +92,10 @@ public abstract class ScriptRunnerBase {
      * @param bean the object to be stored in the script context.
      */
     public void addBean(String key, Object bean) {
-        if (key.isEmpty() || !Character.isJavaIdentifierStart(key.charAt(0))
-                || 
!key.chars().skip(1).allMatch(Character::isJavaIdentifierPart)) {
-            return;
+        if (!key.isEmpty() && Character.isJavaIdentifierStart(key.charAt(0))
+                && 
key.chars().skip(1).allMatch(Character::isJavaIdentifierPart)) {
+            beans.put(key, bean);
         }
-
-        beans.put(key, bean);
     }
 
     /**

Reply via email to