Skip to content

Commit

Permalink
Remove unnecessary use of final on private and static methods
Browse files Browse the repository at this point in the history
  • Loading branch information
elharo committed May 30, 2024
1 parent 3cb1e6f commit ab51711
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ private List<?> createValues(float filterRate)
}
}

private final Object createValue(Type type, float filterRate)
private Object createValue(Type type, float filterRate)
{
if (BOOLEAN.equals(type)) {
switch (withNulls) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ private static Page createInputPage()
return pageBuilder.build();
}

private final RowExpression createFilterExpression(FunctionAndTypeManager functionAndTypeManager)
private RowExpression createFilterExpression(FunctionAndTypeManager functionAndTypeManager)
{
if (filterFails.equals("never")) {
return new ConstantExpression(true, BOOLEAN);
Expand Down Expand Up @@ -265,7 +265,7 @@ else if (filterFails.equals("always")) {
}
}

private final RowExpression createProjectExpression(FunctionAndTypeManager functionAndTypeManager)
private RowExpression createProjectExpression(FunctionAndTypeManager functionAndTypeManager)
{
switch (projectionDataType) {
case "BIGINT":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ private List<?> createValues(Type type, float filterRate)
}
}

private final Object createValue(Type type, float filterRate)
private Object createValue(Type type, float filterRate)
{
if (type == BOOLEAN) {
// We need to specialize BOOLEAN case because we can't specify filterRate by manipulating the filter value in getFilter.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ private BytesUtils()
{
}

public static final int getInt(byte[] byteBuffer, int offset)
public static int getInt(byte[] byteBuffer, int offset)
{
int ch0 = byteBuffer[offset + 0] & 255;
int ch1 = byteBuffer[offset + 1] & 255;
Expand All @@ -29,7 +29,7 @@ public static final int getInt(byte[] byteBuffer, int offset)
return (ch3 << 24) + (ch2 << 16) + (ch1 << 8) + ch0;
}

public static final long getLong(byte[] byteBuffer, int offset)
public static long getLong(byte[] byteBuffer, int offset)
{
int ch0 = byteBuffer[offset + 0];
int ch1 = byteBuffer[offset + 1];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public static FlatDecoders readFlatPage(DataPage page, RichColumnDescriptor colu
}
}

private static final ValuesDecoder createValuesDecoder(ColumnDescriptor columnDescriptor, Dictionary dictionary, int valueCount, ParquetEncoding encoding, byte[] buffer, int offset, int length)
private static ValuesDecoder createValuesDecoder(ColumnDescriptor columnDescriptor, Dictionary dictionary, int valueCount, ParquetEncoding encoding, byte[] buffer, int offset, int length)
throws IOException
{
final PrimitiveTypeName type = columnDescriptor.getPrimitiveType().getPrimitiveTypeName();
Expand Down Expand Up @@ -268,7 +268,7 @@ private static NestedDecoders readNestedPageV2(DataPageV2 pageV2, RichColumnDesc
createValuesDecoderV2(pageV2, columnDescriptor, dictionary));
}

private static final RepetitionLevelDecoder createRepetitionLevelDecoderV2(int valueCount, RichColumnDescriptor columnDescriptor, Slice repetitionLevelBuffer)
private static RepetitionLevelDecoder createRepetitionLevelDecoderV2(int valueCount, RichColumnDescriptor columnDescriptor, Slice repetitionLevelBuffer)
{
final int maxRepetitionLevel = columnDescriptor.getMaxRepetitionLevel();
final int repetitionLevelBitWidth = getWidthFromMaxInt(maxRepetitionLevel);
Expand All @@ -278,7 +278,7 @@ private static final RepetitionLevelDecoder createRepetitionLevelDecoderV2(int v
return new RepetitionLevelDecoder(valueCount, repetitionLevelBitWidth, new ByteArrayInputStream(repetitionLevelBuffer.getBytes()));
}

private static final DefinitionLevelDecoder createDefinitionLevelDecoderV2(int valueCount, RichColumnDescriptor columnDescriptor, Slice definitionLevelBuffer)
private static DefinitionLevelDecoder createDefinitionLevelDecoderV2(int valueCount, RichColumnDescriptor columnDescriptor, Slice definitionLevelBuffer)
{
final int maxDefinitionLevel = columnDescriptor.getMaxDefinitionLevel();
final int definitionLevelBitWidth = getWidthFromMaxInt(maxDefinitionLevel);
Expand All @@ -288,14 +288,14 @@ private static final DefinitionLevelDecoder createDefinitionLevelDecoderV2(int v
return new DefinitionLevelDecoder(valueCount, definitionLevelBitWidth, new ByteArrayInputStream(definitionLevelBuffer.getBytes()));
}

private static final ValuesDecoder createValuesDecoderV2(DataPageV2 pageV2, RichColumnDescriptor columnDescriptor, Dictionary dictionary)
private static ValuesDecoder createValuesDecoderV2(DataPageV2 pageV2, RichColumnDescriptor columnDescriptor, Dictionary dictionary)
throws IOException
{
final byte[] valueBuffer = pageV2.getSlice().getBytes();
return createValuesDecoder(columnDescriptor, dictionary, pageV2.getValueCount(), pageV2.getDataEncoding(), valueBuffer, 0, valueBuffer.length);
}

private static final FlatDefinitionLevelDecoder createFlatDefinitionLevelDecoder(ParquetEncoding encoding, boolean isRequired, int maxLevelValue, int valueCount, ByteBuffer buffer)
private static FlatDefinitionLevelDecoder createFlatDefinitionLevelDecoder(ParquetEncoding encoding, boolean isRequired, int maxLevelValue, int valueCount, ByteBuffer buffer)
throws IOException
{
if (isRequired) {
Expand All @@ -320,7 +320,7 @@ private static final FlatDefinitionLevelDecoder createFlatDefinitionLevelDecoder
return definitionLevelDecoder;
}

public static final RepetitionLevelDecoder createRepetitionLevelDecoder(ParquetEncoding encoding, int maxLevelValue, int valueCount, ByteBuffer buffer)
public static RepetitionLevelDecoder createRepetitionLevelDecoder(ParquetEncoding encoding, int maxLevelValue, int valueCount, ByteBuffer buffer)
throws IOException
{
final int bitWidth = getWidthFromMaxInt(maxLevelValue);
Expand All @@ -337,7 +337,7 @@ public static final RepetitionLevelDecoder createRepetitionLevelDecoder(ParquetE
return repetitionLevelDecoder;
}

public static final DefinitionLevelDecoder createDefinitionLevelDecoder(ParquetEncoding encoding, int maxLevelValue, int valueCount, ByteBuffer buffer)
public static DefinitionLevelDecoder createDefinitionLevelDecoder(ParquetEncoding encoding, int maxLevelValue, int valueCount, ByteBuffer buffer)
throws IOException
{
final int bitWidth = getWidthFromMaxInt(maxLevelValue);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public PrometheusMetricResult(
}

@JsonSetter("value")
private final void setTimeSeriesValues(PrometheusTimeSeriesValue timeSeriesValue)
private void setTimeSeriesValues(PrometheusTimeSeriesValue timeSeriesValue)
{
this.timeSeriesValues = new PrometheusTimeSeriesValueArray(Arrays.asList(timeSeriesValue));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public boolean equals(Object obj)
//

// Check if the string matches [_a-z0-9]+ , but without the overhead of regex
private static final boolean isIdMatchPattern(String id)
private static boolean isIdMatchPattern(String id)
{
if (id.length() == 0) {
return false;
Expand Down

0 comments on commit ab51711

Please sign in to comment.