@@ -79,25 +79,7 @@ class DirectArrayOfDoublesQuickSelectSketch extends ArrayOfDoublesQuickSelectSke
7979 final int numValues ,
8080 final long seed ,
8181 final MemorySegment dstSeg ) {
82- this (checkMemorySegment (nomEntries , lgResizeFactor , numValues , dstSeg ),
83- //SpotBugs CT_CONSTRUCTOR_THROW is false positive.
84- //this construction scheme is compliant with SEI CERT Oracle Coding Standard for Java / OBJ11-J
85- nomEntries ,
86- lgResizeFactor ,
87- samplingProbability ,
88- numValues ,
89- seed ,
90- dstSeg );
91- }
92-
93- private DirectArrayOfDoublesQuickSelectSketch (
94- @ SuppressWarnings ("unused" ) final boolean secure , //required part of Finalizer Attack prevention
95- final int nomEntries ,
96- final int lgResizeFactor ,
97- final float samplingProbability ,
98- final int numValues ,
99- final long seed ,
100- final MemorySegment dstSeg ) {
82+ checkMemorySegment (nomEntries , lgResizeFactor , numValues , dstSeg );
10183 super (numValues , seed );
10284 seg_ = dstSeg ;
10385 final int startingCapacity = Util .getStartingCapacity (nomEntries , lgResizeFactor );
@@ -126,14 +108,13 @@ private DirectArrayOfDoublesQuickSelectSketch(
126108 setRebuildThreshold ();
127109 }
128110
129- private static final boolean checkMemorySegment (
111+ private static final void checkMemorySegment (
130112 final int nomEntries ,
131113 final int lgResizeFactor ,
132114 final int numValues ,
133115 final MemorySegment dstSeg ) {
134116 final int startingCapacity = Util .getStartingCapacity (nomEntries , lgResizeFactor );
135117 checkMemorySegmentSize (dstSeg , startingCapacity , numValues );
136- return true ;
137118 }
138119
139120 /**
@@ -144,15 +125,7 @@ private static final boolean checkMemorySegment(
144125 DirectArrayOfDoublesQuickSelectSketch (
145126 final MemorySegment seg ,
146127 final long seed ) {
147- this (checkSerVer (seg ), seg , seed );
148- //SpotBugs CT_CONSTRUCTOR_THROW is false positive.
149- //this construction scheme is compliant with SEI CERT Oracle Coding Standard for Java / OBJ11-J
150- }
151-
152- private DirectArrayOfDoublesQuickSelectSketch (
153- @ SuppressWarnings ("unused" ) final boolean secure , //required part of Finalizer Attack prevention
154- final MemorySegment seg ,
155- final long seed ) {
128+ checkSerVer (seg );
156129 super (seg .get (JAVA_BYTE , NUM_VALUES_BYTE ), seed );
157130 seg_ = seg ;
158131 SerializerDeserializer .validateFamily (seg .get (JAVA_BYTE , FAMILY_ID_BYTE ),
@@ -170,13 +143,12 @@ private DirectArrayOfDoublesQuickSelectSketch(
170143 setRebuildThreshold ();
171144 }
172145
173- private static final boolean checkSerVer (final MemorySegment seg ) {
146+ private static final void checkSerVer (final MemorySegment seg ) {
174147 final byte version = seg .get (JAVA_BYTE , SERIAL_VERSION_BYTE );
175148 if (version != serialVersionUID ) {
176149 throw new SketchesArgumentException ("Serial version mismatch. Expected: " + serialVersionUID
177150 + ", actual: " + version );
178151 }
179- return true ;
180152 }
181153
182154 @ Override
0 commit comments