You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ti...@apache.org on 2021/11/14 11:26:51 UTC

svn commit: r1895024 - /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/util/IterativeMergeSort.java

Author: tilman
Date: Sun Nov 14 11:26:51 2021
New Revision: 1895024

URL: http://svn.apache.org/viewvc?rev=1895024&view=rev
Log:
PDFBOX-5308: Sonar fix

Modified:
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/util/IterativeMergeSort.java

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/util/IterativeMergeSort.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/util/IterativeMergeSort.java?rev=1895024&r1=1895023&r2=1895024&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/util/IterativeMergeSort.java (original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/util/IterativeMergeSort.java Sun Nov 14 11:26:51 2021
@@ -43,9 +43,13 @@ import java.util.ListIterator;
  * @see https://en.wikipedia.org/wiki/Merge_sort
  *
  */
-public class IterativeMergeSort
+public final class IterativeMergeSort
 {
-
+    private IterativeMergeSort()
+    {
+        // utility class
+    }
+    
     /**
      * Sorts this list according to the order induced by the specified
      * {@link Comparator}.
@@ -95,7 +99,6 @@ public class IterativeMergeSort
                 merge(arr, aux, start, start + blockSize, start + (blockSize << 1), cmp);
             }
         }
-        return;
     }
 
     /**
@@ -121,7 +124,8 @@ public class IterativeMergeSort
         {
             to = arr.length;
         }
-        int i = from, j = mid;
+        int i = from;
+        int j = mid;
         for (int k = from; k < to; k++)
         {
             if (i == mid)