Skip to content
Open
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
6 changes: 6 additions & 0 deletions .baseline/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@
<property name="format" value="Preconditions\.checkArgument\([^;]+%d[^;]+\);"/>
<property name="message" value="Preconditions.checkArgument does not support %d. use %s instead"/>
</module>
<module name="RegexpMultiline">
<property name="fileExtensions" value="java"/>
<property name="matchAcrossLines" value="true"/>
<property name="format" value="Preconditions\.checkState\([^;]+%d[^;]+\);"/>
<property name="message" value="Preconditions.checkState does not support %d. use %s instead"/>
</module>
<module name="RegexpMultiline">
<property name="format" value="^\s*import\s+static\s+(?!\Qorg.assertj.core.api.Assertions.\E).*\.assertThatThrownBy;"/>
<property name="message" value="assertThatThrownBy() should be statically imported from org.assertj.core.api.Assertions"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public interface PartitionStatistics extends StructLike {

static Schema schema(Types.StructType unifiedPartitionType, int formatVersion) {
Preconditions.checkState(!unifiedPartitionType.fields().isEmpty(), "Table must be partitioned");
Preconditions.checkState(formatVersion > 0, "Invalid format version: %d", formatVersion);
Preconditions.checkState(formatVersion > 0, "Invalid format version: %s", formatVersion);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how did the error msg look like before this fix?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the previous error message, without the fix applied:

Invalid format version: %d [0]


if (formatVersion <= 2) {
return v2Schema(unifiedPartitionType);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ public static Schema schema(StructType unifiedPartitionType, int formatVersion)
Preconditions.checkState(!unifiedPartitionType.fields().isEmpty(), "Table must be partitioned");
Preconditions.checkState(
formatVersion > 0 && formatVersion <= TableMetadata.SUPPORTED_TABLE_FORMAT_VERSION,
"Invalid format version: %d",
"Invalid format version: %s",
formatVersion);

if (formatVersion <= 2) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public SeekableInputStream newStream() {
long ciphertextLength = encryptedLength();
Preconditions.checkState(
ciphertextLength >= Ciphers.MIN_STREAM_LENGTH,
"Invalid encrypted stream: %d is shorter than the minimum possible stream length",
"Invalid encrypted stream: %s is shorter than the minimum possible stream length",
ciphertextLength);
return new AesGcmInputStream(sourceFile.newStream(), ciphertextLength, dataKey, fileAADPrefix);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ private void validateHeader() throws IOException {
int plainBlockSize = ByteBuffer.wrap(headerBytes, 4, 4).order(ByteOrder.LITTLE_ENDIAN).getInt();
Preconditions.checkState(
plainBlockSize == Ciphers.PLAIN_BLOCK_SIZE,
"Invalid GCM stream: block size %d != %d",
"Invalid GCM stream: block size %s != %s",
plainBlockSize,
Ciphers.PLAIN_BLOCK_SIZE);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ private void registerSubtaskGateway(SubtaskGateway gateway) {
int attemptNumber = gateway.getExecution().getAttemptNumber();
Preconditions.checkState(
!gateways.containsKey(attemptNumber),
"Coordinator of %s already has a subtask gateway for (#%d)",
"Coordinator of %s already has a subtask gateway for (#%s)",
operatorName,
attemptNumber);
LOG.debug("Coordinator of {} registers gateway for attempt {}", operatorName, attemptNumber);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ private void registerSubtaskGateway(OperatorCoordinator.SubtaskGateway gateway)
int attemptNumber = gateway.getExecution().getAttemptNumber();
Preconditions.checkState(
!gateways[subtaskIndex].containsKey(attemptNumber),
"Coordinator of %s already has a subtask gateway for %d (#%d)",
"Coordinator of %s already has a subtask gateway for %s (#%s)",
operatorName,
subtaskIndex,
attemptNumber);
Expand All @@ -481,7 +481,7 @@ private void unregisterSubtaskGateway(int subtaskIndex, int attemptNumber) {
private OperatorCoordinator.SubtaskGateway getSubtaskGateway(int subtaskIndex) {
Preconditions.checkState(
!gateways[subtaskIndex].isEmpty(),
"Coordinator of %s subtask %d is not ready yet to receive events",
"Coordinator of %s subtask %s is not ready yet to receive events",
operatorName,
subtaskIndex);
return Iterables.getOnlyElement(gateways[subtaskIndex].values());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ private void registerSubtaskGateway(SubtaskGateway gateway) {
int attemptNumber = gateway.getExecution().getAttemptNumber();
Preconditions.checkState(
!gateways.containsKey(attemptNumber),
"Coordinator of %s already has a subtask gateway for (#%d)",
"Coordinator of %s already has a subtask gateway for (#%s)",
operatorName,
attemptNumber);
LOG.debug("Coordinator of {} registers gateway for attempt {}", operatorName, attemptNumber);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ private void registerSubtaskGateway(OperatorCoordinator.SubtaskGateway gateway)
int attemptNumber = gateway.getExecution().getAttemptNumber();
Preconditions.checkState(
!gateways[subtaskIndex].containsKey(attemptNumber),
"Coordinator of %s already has a subtask gateway for %d (#%d)",
"Coordinator of %s already has a subtask gateway for %s (#%s)",
operatorName,
subtaskIndex,
attemptNumber);
Expand All @@ -481,7 +481,7 @@ private void unregisterSubtaskGateway(int subtaskIndex, int attemptNumber) {
private OperatorCoordinator.SubtaskGateway getSubtaskGateway(int subtaskIndex) {
Preconditions.checkState(
!gateways[subtaskIndex].isEmpty(),
"Coordinator of %s subtask %d is not ready yet to receive events",
"Coordinator of %s subtask %s is not ready yet to receive events",
operatorName,
subtaskIndex);
return Iterables.getOnlyElement(gateways[subtaskIndex].values());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ private void registerSubtaskGateway(SubtaskGateway gateway) {
int attemptNumber = gateway.getExecution().getAttemptNumber();
Preconditions.checkState(
!gateways.containsKey(attemptNumber),
"Coordinator of %s already has a subtask gateway for (#%d)",
"Coordinator of %s already has a subtask gateway for (#%s)",
operatorName,
attemptNumber);
LOG.debug("Coordinator of {} registers gateway for attempt {}", operatorName, attemptNumber);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ private void registerSubtaskGateway(OperatorCoordinator.SubtaskGateway gateway)
int attemptNumber = gateway.getExecution().getAttemptNumber();
Preconditions.checkState(
!gateways[subtaskIndex].containsKey(attemptNumber),
"Coordinator of %s already has a subtask gateway for %d (#%d)",
"Coordinator of %s already has a subtask gateway for %s (#%s)",
operatorName,
subtaskIndex,
attemptNumber);
Expand All @@ -481,7 +481,7 @@ private void unregisterSubtaskGateway(int subtaskIndex, int attemptNumber) {
private OperatorCoordinator.SubtaskGateway getSubtaskGateway(int subtaskIndex) {
Preconditions.checkState(
!gateways[subtaskIndex].isEmpty(),
"Coordinator of %s subtask %d is not ready yet to receive events",
"Coordinator of %s subtask %s is not ready yet to receive events",
operatorName,
subtaskIndex);
return Iterables.getOnlyElement(gateways[subtaskIndex].values());
Expand Down