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/07/26 15:31:18 UTC

(commons-beanutils) 09/37: Remove redundant parentheses

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 82d553730fe82117a36db800c8f1ee85cda7f18d
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Fri Jul 26 11:13:44 2024 -0400

    Remove redundant parentheses
    
    - Use diamonds
---
 .../java/org/apache/commons/beanutils/bugs/Jira347TestCase.java  | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/test/java/org/apache/commons/beanutils/bugs/Jira347TestCase.java b/src/test/java/org/apache/commons/beanutils/bugs/Jira347TestCase.java
index 55ce6b75..fd6ccb1d 100644
--- a/src/test/java/org/apache/commons/beanutils/bugs/Jira347TestCase.java
+++ b/src/test/java/org/apache/commons/beanutils/bugs/Jira347TestCase.java
@@ -102,14 +102,14 @@ public class Jira347TestCase extends TestCase {
      */
     private void forceGarbageCollection() throws Exception {
         // Fill up memory
-        final SoftReference<Object> ref = new SoftReference<Object>(new Object());
+        final SoftReference<Object> ref = new SoftReference<>(new Object());
         int count = 0;
         while(ref.get() != null && count++ < 5) {
-            ArrayList<Object> list = new ArrayList<Object>();
+            ArrayList<Object> list = new ArrayList<>();
             try {
                 long i = 0;
                 while (true && ref.get() != null) {
-                    list.add("A Big String A Big String A Big String A Big String A Big String A Big String A Big String A Big String A Big String A Big String " + (i++));
+                    list.add("A Big String A Big String A Big String A Big String A Big String A Big String A Big String A Big String A Big String A Big String " + i++);
                 }
             } catch (final Throwable ignored) {
             }
@@ -147,7 +147,6 @@ public class Jira347TestCase extends TestCase {
         final String classLocation = newString.toString();
         //System.out.println("classlocation: " + classLocation);
 
-        final URLClassLoader theLoader = URLClassLoader.newInstance(new URL[]{new URL(classLocation)},null);
-        return theLoader;
+        return URLClassLoader.newInstance(new URL[]{new URL(classLocation)},null);
     }
 }