You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by su...@apache.org on 2018/08/04 00:49:20 UTC

[2/4] groovy git commit: Trivial refactoring: simplify the condition expression

Trivial refactoring: simplify the condition expression

(cherry picked from commit b0b53090b977db250baa67d8ee35fb0fd08c3d7b)


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

Branch: refs/heads/GROOVY_2_5_X
Commit: 81418e177846540bd39de741b88504a9a853f13e
Parents: 925d3b1
Author: Daniel Sun <su...@apache.org>
Authored: Sat Aug 4 06:57:35 2018 +0800
Committer: Daniel Sun <su...@apache.org>
Committed: Sat Aug 4 08:48:13 2018 +0800

----------------------------------------------------------------------
 src/main/groovy/groovy/lang/GroovyClassLoader.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/81418e17/src/main/groovy/groovy/lang/GroovyClassLoader.java
----------------------------------------------------------------------
diff --git a/src/main/groovy/groovy/lang/GroovyClassLoader.java b/src/main/groovy/groovy/lang/GroovyClassLoader.java
index 616ceb1..ad8aae0 100644
--- a/src/main/groovy/groovy/lang/GroovyClassLoader.java
+++ b/src/main/groovy/groovy/lang/GroovyClassLoader.java
@@ -801,7 +801,7 @@ public class GroovyClassLoader extends URLClassLoader {
     protected Class recompile(URL source, String className, Class oldClass) throws CompilationFailedException, IOException {
         if (source != null) {
             // found a source, compile it if newer
-            if ((oldClass != null && isSourceNewer(source, oldClass)) || (oldClass == null)) {
+            if (oldClass == null || isSourceNewer(source, oldClass)) {
                 String name = source.toExternalForm();
 
                 sourceCache.remove(name);