You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ah...@apache.org on 2022/09/09 16:30:25 UTC

[commons-numbers] branch complex-gsoc-2022 updated: Move static constants to inner class where they are used

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

aherbert pushed a commit to branch complex-gsoc-2022
in repository https://gitbox.apache.org/repos/asf/commons-numbers.git


The following commit(s) were added to refs/heads/complex-gsoc-2022 by this push:
     new b5e91646 Move static constants to inner class where they are used
b5e91646 is described below

commit b5e916467da1853af6ace6a44247c3bef96bc8c6
Author: aherbert <ah...@apache.org>
AuthorDate: Fri Sep 9 17:30:12 2022 +0100

    Move static constants to inner class where they are used
---
 .../numbers/complex/arrays/ComplexList.java        | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/commons-numbers-complex-arrays/src/main/java/org/apache/commons/numbers/complex/arrays/ComplexList.java b/commons-numbers-complex-arrays/src/main/java/org/apache/commons/numbers/complex/arrays/ComplexList.java
index 52bc258d..79f83abe 100644
--- a/commons-numbers-complex-arrays/src/main/java/org/apache/commons/numbers/complex/arrays/ComplexList.java
+++ b/commons-numbers-complex-arrays/src/main/java/org/apache/commons/numbers/complex/arrays/ComplexList.java
@@ -37,17 +37,6 @@ import java.util.Objects;
  */
 public abstract class ComplexList extends AbstractList<Complex> {
 
-    /**
-     * The maximum size of array to allocate.
-     * Ensuring max capacity is even with additional space for VM array headers.
-     */
-    private static final int MAX_ARRAY_SIZE = Integer.MAX_VALUE - 9;
-    /** Max capacity for size of complex numbers in the list. */
-    private static final int MAX_CAPACITY = MAX_ARRAY_SIZE / 2;
-    /** Error in case of allocation above max capacity. */
-    private static final String OOM_ERROR_STRING = "cannot allocate capacity %s greater than max " + MAX_CAPACITY;
-    /** Default initial capacity. */
-    private static final int DEFAULT_CAPACITY = 8;
     /** Size label message. */
     private static final String SIZE_MSG = ", Size: ";
     /** Index position label message. */
@@ -292,6 +281,17 @@ public abstract class ComplexList extends AbstractList<Complex> {
      * <p>This list does not support {@code null} Complex objects.
      */
     private static class ComplexInterleavedList extends ComplexList {
+        /**
+         * The maximum size of array to allocate.
+         * Ensuring max capacity is even with additional space for VM array headers.
+         */
+        private static final int MAX_ARRAY_SIZE = Integer.MAX_VALUE - 9;
+        /** Default initial capacity. */
+        private static final int DEFAULT_CAPACITY = 8;
+        /** Max capacity for size of complex numbers in the list. */
+        private static final int MAX_CAPACITY = MAX_ARRAY_SIZE / 2;
+        /** Error in case of allocation above max capacity. */
+        private static final String OOM_ERROR_STRING = "cannot allocate capacity %s greater than max " + MAX_CAPACITY;
 
         /**
          * Storage for the complex numbers.