Skip to content

Commit cc11892

Browse files
committed
Add "final" to method parameters where they were missing.
1 parent f6bdeb0 commit cc11892

File tree

10 files changed

+40
-40
lines changed

10 files changed

+40
-40
lines changed

pom.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,11 @@ under the License.
9494

9595
<!-- System-wide properties -->
9696
<maven.version>3.6.3</maven.version>
97-
<java.version>21</java.version>
98-
<jvm-ffm-flag>--enable-preview</jvm-ffm-flag>
97+
<java.version>22</java.version>
98+
<jvm-arguments></jvm-arguments>
9999
<maven.compiler.source>${java.version}</maven.compiler.source>
100100
<maven.compiler.target>${java.version}</maven.compiler.target>
101-
<argLine>-Xmx4g -Duser.language=en -Duser.country=US -Dfile.encoding=UTF-8 ${jvm-ffm-flag}</argLine>
101+
<argLine>-Xmx4g -Duser.language=en -Duser.country=US -Dfile.encoding=UTF-8 ${jvm-arguments}</argLine>
102102
<charset.encoding>UTF-8</charset.encoding>
103103
<project.build.sourceEncoding>${charset.encoding}</project.build.sourceEncoding>
104104
<project.build.resourceEncoding>${charset.encoding}</project.build.resourceEncoding>
@@ -164,7 +164,7 @@ under the License.
164164
<version>${maven-compiler-plugin.version}</version>
165165
<configuration>
166166
<compilerArgs>
167-
<arg>${jvm-ffm-flag}</arg>
167+
<arg>${jvm-arguments}</arg>
168168
</compilerArgs>
169169
</configuration>
170170
</plugin>
@@ -190,7 +190,7 @@ under the License.
190190
<configuration>
191191
<rules>
192192
<requireJavaVersion>
193-
<version>[21,)</version> <!-- java.version -->
193+
<version>[22,)</version> <!-- java.version -->
194194
</requireJavaVersion>
195195
<requireMavenVersion>
196196
<version>[${maven.version},4.0.0)</version>
@@ -239,7 +239,7 @@ under the License.
239239
<show>public</show>
240240
<doclint>all,-missing</doclint>
241241
<additionalJOptions>
242-
<additionalJOption>${jvm-ffm-flag}</additionalJOption>
242+
<additionalJOption>${jvm-arguments}</additionalJOption>
243243
</additionalJOptions>
244244
</configuration>
245245
<executions>
@@ -285,7 +285,7 @@ under the License.
285285
<artifactId>maven-surefire-plugin</artifactId>
286286
<version>${maven-surefire-failsafe-plugins.version}</version>
287287
<configuration>
288-
<argLine>${jvm-ffm-flag}</argLine>
288+
<argLine>${jvm-arguments}</argLine>
289289
<trimStackTrace>false</trimStackTrace>
290290
<useManifestOnlyJar>false</useManifestOnlyJar>
291291
<redirectTestOutputToFile>true</redirectTestOutputToFile>

src/main/java/org/apache/datasketches/quantilescommon/DoublesSortedView.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public interface DoublesSortedView extends SortedView {
6060
* @return a discrete CDF array of m+1 double ranks (or cumulative probabilities) on the interval [0.0, 1.0].
6161
* @throws IllegalArgumentException if sketch is empty.
6262
*/
63-
default double[] getCDF(double[] splitPoints, QuantileSearchCriteria searchCrit) {
63+
default double[] getCDF(final double[] splitPoints, final QuantileSearchCriteria searchCrit) {
6464
QuantilesUtil.checkDoublesSplitPointsOrder(splitPoints);
6565
final int len = splitPoints.length + 1;
6666
final double[] buckets = new double[len];
@@ -129,7 +129,7 @@ default double[] getCDF(double[] splitPoints, QuantileSearchCriteria searchCrit)
129129
* @return a PMF array of m+1 probability masses as doubles on the interval [0.0, 1.0].
130130
* @throws IllegalArgumentException if sketch is empty.
131131
*/
132-
default double[] getPMF(double[] splitPoints, QuantileSearchCriteria searchCrit) {
132+
default double[] getPMF(final double[] splitPoints, final QuantileSearchCriteria searchCrit) {
133133
final double[] buckets = getCDF(splitPoints, searchCrit);
134134
final int len = buckets.length;
135135
for (int i = len; i-- > 1; ) {

src/main/java/org/apache/datasketches/quantilescommon/FloatsSortedView.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public interface FloatsSortedView extends SortedView {
6060
* @return a discrete CDF array of m+1 double ranks (or cumulative probabilities) on the interval [0.0, 1.0].
6161
* @throws IllegalArgumentException if sketch is empty.
6262
*/
63-
default double[] getCDF(float[] splitPoints, QuantileSearchCriteria searchCrit) {
63+
default double[] getCDF(final float[] splitPoints, final QuantileSearchCriteria searchCrit) {
6464
QuantilesUtil.checkFloatsSplitPointsOrder(splitPoints);
6565
final int len = splitPoints.length + 1;
6666
final double[] buckets = new double[len];
@@ -129,7 +129,7 @@ default double[] getCDF(float[] splitPoints, QuantileSearchCriteria searchCrit)
129129
* @return a PMF array of m+1 probability masses as doubles on the interval [0.0, 1.0].
130130
* @throws IllegalArgumentException if sketch is empty.
131131
*/
132-
default double[] getPMF(float[] splitPoints, QuantileSearchCriteria searchCrit) {
132+
default double[] getPMF(final float[] splitPoints, final QuantileSearchCriteria searchCrit) {
133133
final double[] buckets = getCDF(splitPoints, searchCrit);
134134
final int len = buckets.length;
135135
for (int i = len; i-- > 1; ) {

src/main/java/org/apache/datasketches/quantilescommon/LongsSortedView.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public interface LongsSortedView extends SortedView {
6060
* @return a discrete CDF array of m+1 double ranks (or cumulative probabilities) on the interval [0.0, 1.0].
6161
* @throws IllegalArgumentException if sketch is empty.
6262
*/
63-
default double[] getCDF(long[] splitPoints, QuantileSearchCriteria searchCrit) {
63+
default double[] getCDF(final long[] splitPoints, final QuantileSearchCriteria searchCrit) {
6464
QuantilesUtil.checkLongsSplitPointsOrder(splitPoints);
6565
final int len = splitPoints.length + 1;
6666
final double[] buckets = new double[len];
@@ -129,7 +129,7 @@ default double[] getCDF(long[] splitPoints, QuantileSearchCriteria searchCrit) {
129129
* @return a PMF array of m+1 probability masses as doubles on the interval [0.0, 1.0].
130130
* @throws IllegalArgumentException if sketch is empty.
131131
*/
132-
default double[] getPMF(long[] splitPoints, QuantileSearchCriteria searchCrit) {
132+
default double[] getPMF(final long[] splitPoints, final QuantileSearchCriteria searchCrit) {
133133
final double[] buckets = getCDF(splitPoints, searchCrit);
134134
final int len = buckets.length;
135135
for (int i = len; i-- > 1; ) {

src/main/java/org/apache/datasketches/quantilescommon/PartitioningFeature.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public interface PartitioningFeature<T> {
5353
*
5454
* @return an instance of {@link GenericPartitionBoundaries GenericPartitionBoundaries}.
5555
*/
56-
default GenericPartitionBoundaries<T> getPartitionBoundariesFromNumParts(int numEquallySizedParts) {
56+
default GenericPartitionBoundaries<T> getPartitionBoundariesFromNumParts(final int numEquallySizedParts) {
5757
return getPartitionBoundariesFromNumParts(numEquallySizedParts, INCLUSIVE);
5858
}
5959

@@ -106,7 +106,7 @@ GenericPartitionBoundaries<T> getPartitionBoundariesFromNumParts(
106106
*
107107
* @return an instance of {@link GenericPartitionBoundaries GenericPartitionBoundaries}.
108108
*/
109-
default GenericPartitionBoundaries<T> getPartitionBoundariesFromPartSize(long nominalPartSizeItems) {
109+
default GenericPartitionBoundaries<T> getPartitionBoundariesFromPartSize(final long nominalPartSizeItems) {
110110
return getPartitionBoundariesFromPartSize(nominalPartSizeItems, INCLUSIVE);
111111
}
112112

src/main/java/org/apache/datasketches/quantilescommon/QuantilesDoublesAPI.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public interface QuantilesDoublesAPI extends QuantilesAPI {
3535
* @return a discrete CDF array of m+1 double ranks (or cumulative probabilities) on the interval [0.0, 1.0].
3636
* @throws IllegalArgumentException if sketch is empty.
3737
*/
38-
default double[] getCDF(double[] splitPoints) {
38+
default double[] getCDF(final double[] splitPoints) {
3939
return getCDF(splitPoints, INCLUSIVE);
4040
}
4141

@@ -98,7 +98,7 @@ default double[] getCDF(double[] splitPoints) {
9898
* @return a PMF array of m+1 probability masses as doubles on the interval [0.0, 1.0].
9999
* @throws IllegalArgumentException if sketch is empty.
100100
*/
101-
default double[] getPMF(double[] splitPoints) {
101+
default double[] getPMF(final double[] splitPoints) {
102102
return getPMF(splitPoints, INCLUSIVE);
103103
}
104104

@@ -150,7 +150,7 @@ default double[] getPMF(double[] splitPoints) {
150150
* @return the approximate quantile given the normalized rank.
151151
* @throws IllegalArgumentException if sketch is empty.
152152
*/
153-
default double getQuantile(double rank) {
153+
default double getQuantile(final double rank) {
154154
return getQuantile(rank, INCLUSIVE);
155155
}
156156

@@ -207,7 +207,7 @@ default double getQuantile(double rank) {
207207
* @return an array of quantiles corresponding to the given array of normalized ranks.
208208
* @throws IllegalArgumentException if sketch is empty.
209209
*/
210-
default double[] getQuantiles(double[] ranks) {
210+
default double[] getQuantiles(final double[] ranks) {
211211
return getQuantiles(ranks, INCLUSIVE);
212212
}
213213

@@ -230,7 +230,7 @@ default double[] getQuantiles(double[] ranks) {
230230
* @return the normalized rank corresponding to the given quantile
231231
* @throws IllegalArgumentException if sketch is empty.
232232
*/
233-
default double getRank(double quantile) {
233+
default double getRank(final double quantile) {
234234
return getRank(quantile, INCLUSIVE);
235235
}
236236

@@ -251,7 +251,7 @@ default double getRank(double quantile) {
251251
* @return an array of normalized ranks corresponding to the given array of quantiles.
252252
* @throws IllegalArgumentException if sketch is empty.
253253
*/
254-
default double[] getRanks(double[] quantiles) {
254+
default double[] getRanks(final double[] quantiles) {
255255
return getRanks(quantiles, INCLUSIVE);
256256
}
257257

src/main/java/org/apache/datasketches/quantilescommon/QuantilesFloatsAPI.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public interface QuantilesFloatsAPI extends QuantilesAPI {
3434
* @return a discrete CDF array of m+1 double ranks (or cumulative probabilities) on the interval [0.0, 1.0].
3535
* @throws IllegalArgumentException if sketch is empty.
3636
*/
37-
default double[] getCDF(float[] splitPoints) {
37+
default double[] getCDF(final float[] splitPoints) {
3838
return getCDF(splitPoints, INCLUSIVE);
3939
}
4040

@@ -97,7 +97,7 @@ default double[] getCDF(float[] splitPoints) {
9797
* @return a PMF array of m+1 probability masses as doubles on the interval [0.0, 1.0].
9898
* @throws IllegalArgumentException if sketch is empty.
9999
*/
100-
default double[] getPMF(float[] splitPoints) {
100+
default double[] getPMF(final float[] splitPoints) {
101101
return getPMF(splitPoints, INCLUSIVE);
102102
}
103103

@@ -149,7 +149,7 @@ default double[] getPMF(float[] splitPoints) {
149149
* @return the approximate quantile given the normalized rank.
150150
* @throws IllegalArgumentException if sketch is empty.
151151
*/
152-
default float getQuantile(double rank) {
152+
default float getQuantile(final double rank) {
153153
return getQuantile(rank, INCLUSIVE);
154154
}
155155

@@ -206,7 +206,7 @@ default float getQuantile(double rank) {
206206
* @return an array of quantiles corresponding to the given array of normalized ranks.
207207
* @throws IllegalArgumentException if sketch is empty.
208208
*/
209-
default float[] getQuantiles(double[] ranks) {
209+
default float[] getQuantiles(final double[] ranks) {
210210
return getQuantiles(ranks, INCLUSIVE);
211211
}
212212

@@ -229,7 +229,7 @@ default float[] getQuantiles(double[] ranks) {
229229
* @return the normalized rank corresponding to the given quantile.
230230
* @throws IllegalArgumentException if sketch is empty.
231231
*/
232-
default double getRank(float quantile) {
232+
default double getRank(final float quantile) {
233233
return getRank(quantile, INCLUSIVE);
234234
}
235235

@@ -250,7 +250,7 @@ default double getRank(float quantile) {
250250
* @return an array of normalized ranks corresponding to the given array of quantiles.
251251
* @throws IllegalArgumentException if sketch is empty.
252252
*/
253-
default double[] getRanks(float[] quantiles) {
253+
default double[] getRanks(final float[] quantiles) {
254254
return getRanks(quantiles, INCLUSIVE);
255255
}
256256

src/main/java/org/apache/datasketches/quantilescommon/QuantilesGenericAPI.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public interface QuantilesGenericAPI<T> extends QuantilesAPI, PartitioningFeatur
3838
* @return a discrete CDF array of m+1 double ranks (or cumulative probabilities) on the interval [0.0, 1.0].
3939
* @throws IllegalArgumentException if sketch is empty.
4040
*/
41-
default double[] getCDF(T[] splitPoints) {
41+
default double[] getCDF(final T[] splitPoints) {
4242
return getCDF(splitPoints, INCLUSIVE);
4343
}
4444

@@ -118,7 +118,7 @@ default int getMaxPartitions() {
118118
* @return a PMF array of m+1 probability masses as doubles on the interval [0.0, 1.0].
119119
* @throws IllegalArgumentException if sketch is empty.
120120
*/
121-
default double[] getPMF(T[] splitPoints) {
121+
default double[] getPMF(final T[] splitPoints) {
122122
return getPMF(splitPoints, INCLUSIVE);
123123
}
124124

@@ -170,7 +170,7 @@ default double[] getPMF(T[] splitPoints) {
170170
* @return the approximate quantile given the normalized rank.
171171
* @throws IllegalArgumentException if sketch is empty.
172172
*/
173-
default T getQuantile(double rank) {
173+
default T getQuantile(final double rank) {
174174
return getQuantile(rank, INCLUSIVE);
175175
}
176176

@@ -227,7 +227,7 @@ default T getQuantile(double rank) {
227227
* @return an array of quantiles corresponding to the given array of normalized ranks.
228228
* @throws IllegalArgumentException if sketch is empty.
229229
*/
230-
default T[] getQuantiles(double[] ranks) {
230+
default T[] getQuantiles(final double[] ranks) {
231231
return getQuantiles(ranks, INCLUSIVE);
232232
}
233233

@@ -250,7 +250,7 @@ default T[] getQuantiles(double[] ranks) {
250250
* @return the normalized rank corresponding to the given quantile.
251251
* @throws IllegalArgumentException if sketch is empty.
252252
*/
253-
default double getRank(T quantile) {
253+
default double getRank(final T quantile) {
254254
return getRank(quantile, INCLUSIVE);
255255
}
256256

@@ -271,7 +271,7 @@ default double getRank(T quantile) {
271271
* @return an array of normalized ranks corresponding to the given array of quantiles.
272272
* @throws IllegalArgumentException if sketch is empty.
273273
*/
274-
default double[] getRanks(T[] quantiles) {
274+
default double[] getRanks(final T[] quantiles) {
275275
return getRanks(quantiles, INCLUSIVE);
276276
}
277277

src/main/java/org/apache/datasketches/quantilescommon/QuantilesLongsAPI.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public interface QuantilesLongsAPI extends QuantilesAPI {
3535
* @return a discrete CDF array of m+1 double ranks (or cumulative probabilities) on the interval [0.0, 1.0].
3636
* @throws IllegalArgumentException if sketch is empty.
3737
*/
38-
default double[] getCDF(long[] splitPoints) {
38+
default double[] getCDF(final long[] splitPoints) {
3939
return getCDF(splitPoints, INCLUSIVE);
4040
}
4141

@@ -98,7 +98,7 @@ default double[] getCDF(long[] splitPoints) {
9898
* @return a PMF array of m+1 probability masses as doubles on the interval [0.0, 1.0].
9999
* @throws IllegalArgumentException if sketch is empty.
100100
*/
101-
default double[] getPMF(long[] splitPoints) {
101+
default double[] getPMF(final long[] splitPoints) {
102102
return getPMF(splitPoints, INCLUSIVE);
103103
}
104104

@@ -150,7 +150,7 @@ default double[] getPMF(long[] splitPoints) {
150150
* @return the approximate quantile given the normalized rank.
151151
* @throws IllegalArgumentException if sketch is empty.
152152
*/
153-
default long getQuantile(double rank) {
153+
default long getQuantile(final double rank) {
154154
return getQuantile(rank, INCLUSIVE);
155155
}
156156

@@ -207,7 +207,7 @@ default long getQuantile(double rank) {
207207
* @return an array of quantiles corresponding to the given array of normalized ranks.
208208
* @throws IllegalArgumentException if sketch is empty.
209209
*/
210-
default long[] getQuantiles(double[] ranks) {
210+
default long[] getQuantiles(final double[] ranks) {
211211
return getQuantiles(ranks, INCLUSIVE);
212212
}
213213

@@ -230,7 +230,7 @@ default long[] getQuantiles(double[] ranks) {
230230
* @return the normalized rank corresponding to the given quantile
231231
* @throws IllegalArgumentException if sketch is empty.
232232
*/
233-
default double getRank(long quantile) {
233+
default double getRank(final long quantile) {
234234
return getRank(quantile, INCLUSIVE);
235235
}
236236

@@ -251,7 +251,7 @@ default double getRank(long quantile) {
251251
* @return an array of normalized ranks corresponding to the given array of quantiles.
252252
* @throws IllegalArgumentException if sketch is empty.
253253
*/
254-
default double[] getRanks(long[] quantiles) {
254+
default double[] getRanks(final long[] quantiles) {
255255
return getRanks(quantiles, INCLUSIVE);
256256
}
257257

src/main/java/org/apache/datasketches/theta/ConcurrentSharedThetaSketch.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ interface ConcurrentSharedThetaSketch extends MemoryStatus {
3636
long NOT_SINGLE_HASH = -1L;
3737
double MIN_ERROR = 0.0000001;
3838

39-
static long computeExactLimit(long k, double error) {
39+
static long computeExactLimit(final long k, final double error) {
4040
return 2 * Math.min(k, (long) Math.ceil(1.0 / Math.pow(Math.max(error,MIN_ERROR), 2.0)));
4141
}
4242

0 commit comments

Comments
 (0)