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 2020/03/22 00:06:17 UTC

[groovy] branch master updated: ConversionHandler: Remove unnecessary null check for value of final field which is always initialized.

This is an automated email from the ASF dual-hosted git repository.

sunlan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git


The following commit(s) were added to refs/heads/master by this push:
     new 1b8c786  ConversionHandler: Remove unnecessary null check for value of final field which is always initialized.
1b8c786 is described below

commit 1b8c786787fa2289a6f32656fd03e1eababcee2d
Author: Pascal Schumacher <pa...@gmx.net>
AuthorDate: Sat Mar 21 14:12:50 2020 +0100

    ConversionHandler: Remove unnecessary null check for value of final field which is always initialized.
---
 src/main/java/org/codehaus/groovy/runtime/ConversionHandler.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/java/org/codehaus/groovy/runtime/ConversionHandler.java b/src/main/java/org/codehaus/groovy/runtime/ConversionHandler.java
index 77a92f6..04870c9 100644
--- a/src/main/java/org/codehaus/groovy/runtime/ConversionHandler.java
+++ b/src/main/java/org/codehaus/groovy/runtime/ConversionHandler.java
@@ -92,7 +92,7 @@ public abstract class ConversionHandler implements InvocationHandler, Serializab
      * @see InvocationHandler#invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
      */
     public Object invoke(final Object proxy, Method method, Object[] args) throws Throwable {
-        if (handleCache != null && isDefaultMethod(method) && !defaultOverridden(method)) {
+        if (isDefaultMethod(method) && !defaultOverridden(method)) {
             final VMPlugin plugin = VMPluginFactory.getPlugin();
             Object handle = handleCache.computeIfAbsent(method, m -> plugin.getInvokeSpecialHandle(m, proxy));
             return plugin.invokeHandle(handle, args);