Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build: Bump com.palantir.baseline:gradle-baseline-java from 5.61.0 to 5.69.0 #11232

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/
package org.apache.iceberg.expressions;

import java.util.Locale;
import org.apache.iceberg.Accessor;
import org.apache.iceberg.StructLike;
import org.apache.iceberg.types.Type;
Expand Down Expand Up @@ -82,6 +83,7 @@ public Accessor<StructLike> accessor() {

@Override
public String toString() {
return String.format("ref(id=%d, accessor-type=%s)", field.fieldId(), accessor.type());
return String.format(
Locale.ROOT, "ref(id=%d, accessor-type=%s)", field.fieldId(), accessor.type());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import java.time.ZoneOffset;
import java.time.temporal.ChronoUnit;
import java.util.List;
import java.util.Locale;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import java.util.function.Function;
Expand Down Expand Up @@ -500,8 +501,10 @@ private static List<String> abbreviateValues(List<String> sanitizedValues) {
abbreviatedList.addAll(distinctValues);
abbreviatedList.add(
String.format(
Locale.ROOT,
"... (%d values hidden, %d in total)",
sanitizedValues.size() - distinctValues.size(), sanitizedValues.size()));
sanitizedValues.size() - distinctValues.size(),
sanitizedValues.size()));
return abbreviatedList;
}
}
Expand Down Expand Up @@ -633,7 +636,7 @@ private static String sanitizeString(CharSequence value, long now, int today) {

private static String sanitizeSimpleString(CharSequence value) {
// hash the value and return the hash as hex
return String.format("(hash-%08x)", HASH_FUNC.apply(value));
return String.format(Locale.ROOT, "(hash-%08x)", HASH_FUNC.apply(value));
}

private static PartitionSpec identitySpec(Schema schema, int... ids) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@
*/
package org.apache.iceberg.io;

import java.util.Locale;

public class BulkDeletionFailureException extends RuntimeException {
private final int numberFailedObjects;

public BulkDeletionFailureException(int numberFailedObjects) {
super(String.format("Failed to delete %d files", numberFailedObjects));
super(String.format(Locale.ROOT, "Failed to delete %d files", numberFailedObjects));
this.numberFailedObjects = numberFailedObjects;
}

Expand Down
19 changes: 15 additions & 4 deletions api/src/main/java/org/apache/iceberg/transforms/TransformUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import java.time.ZoneOffset;
import java.time.temporal.ChronoUnit;
import java.util.Base64;
import java.util.Locale;
import org.apache.iceberg.util.DateTimeUtil;

class TransformUtil {
Expand All @@ -36,19 +37,25 @@ private TransformUtil() {}
private static final int EPOCH_YEAR = EPOCH.getYear();

static String humanYear(int yearOrdinal) {
return String.format("%04d", EPOCH_YEAR + yearOrdinal);
return String.format(Locale.ROOT, "%04d", EPOCH_YEAR + yearOrdinal);
}

static String humanMonth(int monthOrdinal) {
return String.format(
Locale.ROOT,
"%04d-%02d",
EPOCH_YEAR + Math.floorDiv(monthOrdinal, 12), 1 + Math.floorMod(monthOrdinal, 12));
EPOCH_YEAR + Math.floorDiv(monthOrdinal, 12),
1 + Math.floorMod(monthOrdinal, 12));
}

static String humanDay(int dayOrdinal) {
OffsetDateTime day = EPOCH.plusDays(dayOrdinal);
return String.format(
"%04d-%02d-%02d", day.getYear(), day.getMonth().getValue(), day.getDayOfMonth());
Locale.ROOT,
"%04d-%02d-%02d",
day.getYear(),
day.getMonth().getValue(),
day.getDayOfMonth());
}

static String humanTime(Long microsFromMidnight) {
Expand All @@ -74,8 +81,12 @@ static String humanTimestampNanoWithoutZone(Long timestampNanos) {
static String humanHour(int hourOrdinal) {
OffsetDateTime time = EPOCH.plusHours(hourOrdinal);
return String.format(
Locale.ROOT,
"%04d-%02d-%02d-%02d",
time.getYear(), time.getMonth().getValue(), time.getDayOfMonth(), time.getHour());
time.getYear(),
time.getMonth().getValue(),
time.getDayOfMonth(),
time.getHour());
}

static String base64encode(ByteBuffer buffer) {
Expand Down
7 changes: 4 additions & 3 deletions api/src/main/java/org/apache/iceberg/types/Types.java
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ public TypeID typeId() {

@Override
public String toString() {
return String.format("fixed[%d]", length);
return String.format(Locale.ROOT, "fixed[%d]", length);
}

@Override
Expand Down Expand Up @@ -443,7 +443,7 @@ public TypeID typeId() {

@Override
public String toString() {
return String.format("decimal(%d, %d)", precision, scale);
return String.format(Locale.ROOT, "decimal(%d, %d)", precision, scale);
}

@Override
Expand Down Expand Up @@ -552,7 +552,8 @@ public String doc() {

@Override
public String toString() {
return String.format("%d: %s: %s %s", id, name, isOptional ? "optional" : "required", type)
return String.format(
Locale.ROOT, "%d: %s: %s %s", id, name, isOptional ? "optional" : "required", type)
+ (doc != null ? " (" + doc + ")" : "");
}

Expand Down
3 changes: 2 additions & 1 deletion api/src/main/java/org/apache/iceberg/util/DateTimeUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeFormatterBuilder;
import java.time.temporal.ChronoUnit;
import java.util.Locale;

public class DateTimeUtil {
private DateTimeUtil() {}
Expand All @@ -43,7 +44,7 @@ private DateTimeUtil() {}
.parseCaseInsensitive()
.append(DateTimeFormatter.ISO_LOCAL_DATE_TIME)
.appendOffset("+HH:MM:ss", "+00:00")
.toFormatter();
.toFormatter(Locale.ROOT);

public static LocalDate dateFromDays(int daysFromEpoch) {
return ChronoUnit.DAYS.addTo(EPOCH_DAY, daysFromEpoch);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package org.apache.iceberg.arrow.vectorized.parquet;

import java.util.Arrays;
import java.util.Locale;
import org.apache.arrow.vector.DecimalVector;
import org.apache.iceberg.relocated.com.google.common.annotations.VisibleForTesting;

Expand Down Expand Up @@ -62,7 +63,9 @@ static byte[] padBigEndianBytes(byte[] bigEndianBytes, int newLength) {
}
throw new IllegalArgumentException(
String.format(
Locale.ROOT,
"Buffer size of %d is larger than requested size of %d",
bigEndianBytes.length, newLength));
bigEndianBytes.length,
newLength));
}
}
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ buildscript {
}
dependencies {
classpath 'io.github.goooler.shadow:shadow-gradle-plugin:8.1.8'
classpath 'com.palantir.baseline:gradle-baseline-java:5.61.0'
classpath 'com.palantir.baseline:gradle-baseline-java:5.69.0'
classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.25.0'
classpath 'gradle.plugin.org.inferred:gradle-processors:3.7.0'
classpath 'me.champeau.jmh:jmh-gradle-plugin:0.7.2'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/
package org.apache.iceberg;

import java.util.Locale;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.atomic.AtomicReference;
Expand Down Expand Up @@ -327,7 +328,8 @@ private String newTableMetadataFilePath(TableMetadata meta, int newVersion) {
TableProperties.METADATA_COMPRESSION, TableProperties.METADATA_COMPRESSION_DEFAULT);
String fileExtension = TableMetadataParser.getFileExtension(codecName);
return metadataFileLocation(
meta, String.format("%05d-%s%s", newVersion, UUID.randomUUID(), fileExtension));
meta,
String.format(Locale.ROOT, "%05d-%s%s", newVersion, UUID.randomUUID(), fileExtension));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/org/apache/iceberg/MetricsModes.java
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public int length() {

@Override
public String toString() {
return String.format("truncate(%d)", length);
return String.format(Locale.ROOT, "truncate(%d)", length);
}

@Override
Expand Down
3 changes: 2 additions & 1 deletion core/src/main/java/org/apache/iceberg/ScanSummary.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import java.io.IOException;
import java.util.Comparator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.NavigableMap;
import java.util.Set;
Expand Down Expand Up @@ -346,7 +347,7 @@ public void update(K key, Function<V, V> updateFunc) {
while (map.size() > maxSize) {
if (throwIfLimited) {
throw new IllegalStateException(
String.format("Too many matching keys: more than %d", maxSize));
String.format(Locale.ROOT, "Too many matching keys: more than %d", maxSize));
}
this.cut = map.lastKey();
map.remove(cut);
Expand Down
7 changes: 6 additions & 1 deletion core/src/main/java/org/apache/iceberg/SnapshotProducer.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import java.math.RoundingMode;
import java.util.Arrays;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Queue;
import java.util.Set;
Expand Down Expand Up @@ -505,7 +506,11 @@ protected OutputFile manifestListPath() {
ops.metadataFileLocation(
FileFormat.AVRO.addExtension(
String.format(
"snap-%d-%d-%s", snapshotId(), attempt.incrementAndGet(), commitUUID))));
Locale.ROOT,
"snap-%d-%d-%s",
snapshotId(),
attempt.incrementAndGet(),
commitUUID))));
}

protected EncryptedOutputFile newManifestOutputFile() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import java.io.UncheckedIOException;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.Locale;
import java.util.Map;
import org.apache.avro.AvroRuntimeException;
import org.apache.avro.Schema;
Expand Down Expand Up @@ -138,7 +139,8 @@ public D decode(InputStream stream, D reuse) throws IOException {

if (IcebergEncoder.V1_HEADER[0] != header[0] || IcebergEncoder.V1_HEADER[1] != header[1]) {
throw new BadHeaderException(
String.format("Unrecognized header bytes: 0x%02X 0x%02X", header[0], header[1]));
String.format(
Locale.ROOT, "Unrecognized header bytes: 0x%02X 0x%02X", header[0], header[1]));
}

RawDecoder<D> decoder = getDecoder(FP_BUFFER.get().getLong(2));
Expand Down
5 changes: 4 additions & 1 deletion core/src/main/java/org/apache/iceberg/io/ContentCache.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import java.nio.ByteBuffer;
import java.time.Duration;
import java.util.List;
import java.util.Locale;
import org.apache.iceberg.exceptions.NotFoundException;
import org.apache.iceberg.exceptions.ValidationException;
import org.apache.iceberg.relocated.com.google.common.base.MoreObjects;
Expand Down Expand Up @@ -253,8 +254,10 @@ private static FileContent download(InputFile input) {
// IOException and let the caller fallback to non-caching input file.
throw new IOException(
String.format(
Locale.ROOT,
"Failed to read %d bytes: %d bytes in stream",
fileLength, fileLength - totalBytesToRead));
fileLength,
fileLength - totalBytesToRead));
} else {
buffers.add(ByteBuffer.wrap(buf));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import static org.apache.iceberg.TableProperties.DEFAULT_FILE_FORMAT;
import static org.apache.iceberg.TableProperties.DEFAULT_FILE_FORMAT_DEFAULT;

import java.util.Locale;
import java.util.UUID;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Supplier;
Expand Down Expand Up @@ -92,6 +93,7 @@ public static Builder builderFor(Table table, int partitionId, long taskId) {
private String generateFilename() {
return format.addExtension(
String.format(
Locale.ROOT,
"%05d-%d-%s-%05d%s",
partitionId,
taskId,
Expand Down
13 changes: 11 additions & 2 deletions core/src/main/java/org/apache/iceberg/jdbc/JdbcCatalog.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import java.util.AbstractMap;
import java.util.Arrays;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.function.Consumer;
Expand Down Expand Up @@ -798,7 +799,11 @@ private boolean insertProperties(Namespace namespace, Map<String, String> proper
}

throw new IllegalStateException(
String.format("Failed to insert: %d of %d succeeded", insertedRecords, properties.size()));
String.format(
Locale.ROOT,
"Failed to insert: %d of %d succeeded",
insertedRecords,
properties.size()));
}

private boolean updateProperties(Namespace namespace, Map<String, String> properties) {
Expand All @@ -818,7 +823,11 @@ private boolean updateProperties(Namespace namespace, Map<String, String> proper
}

throw new IllegalStateException(
String.format("Failed to update: %d of %d succeeded", updatedRecords, properties.size()));
String.format(
Locale.ROOT,
"Failed to update: %d of %d succeeded",
updatedRecords,
properties.size()));
}

private boolean deleteProperties(Namespace namespace, Set<String> properties) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/
package org.apache.iceberg.view;

import java.util.Locale;
import java.util.UUID;
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.Function;
Expand Down Expand Up @@ -157,7 +158,8 @@ private String newMetadataFilePath(ViewMetadata metadata, int newVersion) {
ViewProperties.METADATA_COMPRESSION, ViewProperties.METADATA_COMPRESSION_DEFAULT);
String fileExtension = TableMetadataParser.getFileExtension(codecName);
return metadataFileLocation(
metadata, String.format("%05d-%s%s", newVersion, UUID.randomUUID(), fileExtension));
metadata,
String.format(Locale.ROOT, "%05d-%s%s", newVersion, UUID.randomUUID(), fileExtension));
}

private String metadataFileLocation(ViewMetadata metadata, String filename) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/
package org.apache.iceberg.flink.sink;

import java.util.Locale;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Supplier;
Expand Down Expand Up @@ -59,6 +60,7 @@ class ManifestOutputFileFactory {
private String generatePath(long checkpointId) {
return FileFormat.AVRO.addExtension(
String.format(
Locale.ROOT,
"%s-%s-%05d-%d-%d-%05d",
flinkJobId,
operatorUniqueId,
Expand Down
Loading