You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2024/08/18 12:49:37 UTC

(commons-beanutils) 26/32: Merge nested ifs

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

ggregory pushed a commit to branch 1.X
in repository https://gitbox.apache.org/repos/asf/commons-beanutils.git

commit 351c0143c251a4112aeac89de074d9614ee6c7a1
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun Aug 18 08:46:22 2024 -0400

    Merge nested ifs
---
 src/main/java/org/apache/commons/beanutils/MethodUtils.java | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/main/java/org/apache/commons/beanutils/MethodUtils.java b/src/main/java/org/apache/commons/beanutils/MethodUtils.java
index 29ceb43d..578628b3 100644
--- a/src/main/java/org/apache/commons/beanutils/MethodUtils.java
+++ b/src/main/java/org/apache/commons/beanutils/MethodUtils.java
@@ -176,10 +176,8 @@ public class MethodUtils {
      * @param method The method to cache
      */
     private static void cacheMethod(final MethodDescriptor md, final Method method) {
-        if (CACHE_METHODS) {
-            if (method != null) {
-                cache.put(md, new WeakReference<>(method));
-            }
+        if (CACHE_METHODS && (method != null)) {
+            cache.put(md, new WeakReference<>(method));
         }
     }