Skip to content

Commit

Permalink
Consistent empty braces formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
losipiuk committed Oct 30, 2024
1 parent b3b52fb commit 40f2840
Show file tree
Hide file tree
Showing 214 changed files with 306 additions and 669 deletions.
8 changes: 2 additions & 6 deletions client/trino-cli/src/main/java/io/trino/cli/NullPrinter.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,8 @@ public class NullPrinter
implements OutputPrinter
{
@Override
public void printRows(List<List<?>> rows, boolean complete)
{
}
public void printRows(List<List<?>> rows, boolean complete) {}

@Override
public void finish()
{
}
public void finish() {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ private static String preprocessQueryInternal(Optional<String> catalog, Optional
CharStreams.copy(new InputStreamReader(inputStream, UTF_8), builder);
}
catch (IOException | RuntimeException ignored) {
// ignore
}
return builder.toString();
});
Expand Down Expand Up @@ -175,6 +176,7 @@ private static String preprocessQueryInternal(Optional<String> catalog, Optional
message = "\n===\n" + message + "\n===";
}
catch (Exception ignored) {
// ignore
}
throw new QueryPreprocessorException("Query preprocessor exited " + exitCode + message);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ private static KeyStore loadTrustStore(File trustStorePath, Optional<String> tru
}
}
catch (IOException | GeneralSecurityException ignored) {
// ignore
}

try (InputStream in = new FileInputStream(trustStorePath)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ else if ("ENCRYPTED".equals(keyType)) {
return keyFactory.generatePrivate(encodedKeySpec);
}
catch (InvalidKeySpecException ignore) {
// ignore
}
}
throw new InvalidKeySpecException("Key type must be one of " + algorithms);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@ class MemoryCachedKnownToken
private final Lock writeLock = lock.writeLock();
private Optional<Token> knownToken = Optional.empty();

private MemoryCachedKnownToken()
{
}
private MemoryCachedKnownToken() {}

@Override
public Optional<Token> getToken()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ private byte[] generateToken(String servicePrincipal)
}
}
catch (GSSException ignored) {
// ignore
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ public TokenPollResult pollForToken(URI tokenUri, Duration timeout)
}

@Override
public void tokenReceived(URI tokenUri)
{
}
public void tokenReceived(URI tokenUri) {}
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@

public class TestingRedirectHandlerInjector
{
private TestingRedirectHandlerInjector()
{
}
private TestingRedirectHandlerInjector() {}

public static void setRedirectHandler(Consumer<URI> redirectHandler)
{
Expand Down
4 changes: 1 addition & 3 deletions core/trino-main/src/main/java/io/trino/TrinoMediaTypes.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,5 @@ public final class TrinoMediaTypes
public static final String TRINO_PAGES = "application/x-trino-pages";
public static final MediaType TRINO_PAGES_TYPE = MediaType.create("application", "x-trino-pages");

private TrinoMediaTypes()
{
}
private TrinoMediaTypes() {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ public final class BlockSerdeUtil
public static final MethodHandle READ_BLOCK = methodHandle(BlockSerdeUtil.class, "readBlock", BlockEncodingSerde.class, Slice.class);
public static final MethodHandle READ_BLOCK_VALUE = methodHandle(BlockSerdeUtil.class, "readBlockValue", BlockEncodingSerde.class, Type.class, Slice.class);

private BlockSerdeUtil()
{
}
private BlockSerdeUtil() {}

public static Block readBlock(BlockEncodingSerde blockEncodingSerde, Slice slice)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ public ConnectorServices(Tracer tracer, CatalogHandle catalogHandle, Connector c
splitManager = connector.getSplitManager();
}
catch (UnsupportedOperationException _) {
// ignore
}
this.splitManager = Optional.ofNullable(splitManager);

Expand All @@ -135,6 +136,7 @@ public ConnectorServices(Tracer tracer, CatalogHandle catalogHandle, Connector c
requireNonNull(connectorPageSourceProviderFactory, format("Connector '%s' returned a null page source provider factory", catalogHandle));
}
catch (UnsupportedOperationException _) {
// ignore
}

try {
Expand All @@ -145,6 +147,7 @@ public ConnectorServices(Tracer tracer, CatalogHandle catalogHandle, Connector c
connectorPageSourceProviderFactory = () -> pageSourceProvider;
}
catch (UnsupportedOperationException _) {
// ignore
}
this.pageSourceProviderFactory = Optional.ofNullable(connectorPageSourceProviderFactory);

Expand All @@ -154,6 +157,7 @@ public ConnectorServices(Tracer tracer, CatalogHandle catalogHandle, Connector c
requireNonNull(connectorPageSinkProvider, format("Connector '%s' returned a null page sink provider", catalogHandle));
}
catch (UnsupportedOperationException _) {
// ignore
}
this.pageSinkProvider = Optional.ofNullable(connectorPageSinkProvider);

Expand All @@ -163,6 +167,7 @@ public ConnectorServices(Tracer tracer, CatalogHandle catalogHandle, Connector c
requireNonNull(indexProvider, format("Connector '%s' returned a null index provider", catalogHandle));
}
catch (UnsupportedOperationException _) {
// ignore
}
this.indexProvider = Optional.ofNullable(indexProvider);

Expand All @@ -172,6 +177,7 @@ public ConnectorServices(Tracer tracer, CatalogHandle catalogHandle, Connector c
requireNonNull(partitioningProvider, format("Connector '%s' returned a null partitioning provider", catalogHandle));
}
catch (UnsupportedOperationException _) {
// ignore
}
this.partitioningProvider = Optional.ofNullable(partitioningProvider);

Expand All @@ -180,6 +186,7 @@ public ConnectorServices(Tracer tracer, CatalogHandle catalogHandle, Connector c
accessControl = connector.getAccessControl();
}
catch (UnsupportedOperationException _) {
// ignore
}
verifyAccessControl(accessControl);
this.accessControl = Optional.ofNullable(accessControl);
Expand Down Expand Up @@ -405,6 +412,7 @@ private static void mustNotDeclareMethod(Class<?> clazz, String name, Class<?>..
name, Arrays.stream(parameterTypes).map(Class::getName).collect(Collectors.joining(", "))));
}
catch (ReflectiveOperationException _) {
// ignore
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ public class NoOpFailureInjector
implements FailureInjector
{
@Override
public void injectTaskFailure(String traceToken, int stageId, int partitionId, int attemptId, InjectedFailureType injectionType, Optional<ErrorType> errorType)
{
}
public void injectTaskFailure(String traceToken, int stageId, int partitionId, int attemptId, InjectedFailureType injectionType, Optional<ErrorType> errorType) {}

@Override
public Optional<InjectedFailure> getInjectedFailure(String traceToken, int stageId, int partitionId, int attemptId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ public boolean awaitReady()
wakeup.await();
}
catch (InterruptedException e) {
// ignore
}
}

Expand Down Expand Up @@ -199,6 +200,7 @@ public void awaitUnblock()
wakeup.await();
}
catch (InterruptedException e) {
// ignore
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ private synchronized void addRunnerThread()
executor.execute(versionEmbedder.embedVersion(new TaskRunner()));
}
catch (RejectedExecutionException _) {
// ignore
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,7 @@ public SplitPlacementResult computeAssignments(Set<Split> splits)
}

@Override
public void lockDownNodes()
{
}
public void lockDownNodes() {}

@Override
public List<InternalNode> allNodes()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,9 @@ public interface TaskLifecycleListener
TaskLifecycleListener NO_OP = new TaskLifecycleListener()
{
@Override
public void taskCreated(PlanFragmentId fragmentId, RemoteTask task)
{
}
public void taskCreated(PlanFragmentId fragmentId, RemoteTask task) {}

@Override
public void noMoreTasks(PlanFragmentId fragmentId)
{
}
public void noMoreTasks(PlanFragmentId fragmentId) {}
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -803,9 +803,7 @@ public long getRetainedSizeInBytes()
}

@Override
public void close()
{
}
public void close() {}
}

@NotThreadSafe
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ public Operator createOperator(DriverContext driverContext)
}

@Override
public void noMoreOperators()
{
}
public void noMoreOperators() {}

@Override
public OperatorFactory duplicate()
Expand Down Expand Up @@ -72,9 +70,7 @@ public boolean needsInput()
}

@Override
public void addInput(Page page)
{
}
public void addInput(Page page) {}

@Override
public Page getOutput()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ public OperatorContext getOperatorContext()
}

@Override
public void finish()
{
}
public void finish() {}

@Override
public boolean isFinished()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,7 @@ default ListenableFuture<Void> startMemoryRevoke()
* Clean up and release resources after completed memory revoking. Called by driver
* once future returned by startMemoryRevoke is completed.
*/
default void finishMemoryRevoke()
{
}
default void finishMemoryRevoke() {}

/**
* Notifies the operator that no more pages will be added and the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@

public class PositionSearcher
{
private PositionSearcher()
{
}
private PositionSearcher() {}

/**
* @param startPosition - inclusive
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,7 @@ public Page getOutput()
}

@Override
public void finish()
{
}
public void finish() {}

@Override
public void close()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ private static Function<List<Supplier<Object>>, WindowAccumulator> createWindowA
};
}
catch (ReflectiveOperationException _) {
// ignore
}

try {
Expand All @@ -343,6 +344,7 @@ private static Function<List<Supplier<Object>>, WindowAccumulator> createWindowA
};
}
catch (ReflectiveOperationException _) {
// ignore
}
throw new RuntimeException(format("Window accumulator class %s does not have a constructor with a single List argument or a no-argument constructor", windowAccumulator.getName()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ public final class DoubleHistogramAggregation
{
public static final int ENTRY_BUFFER_SIZE = 100;

private DoubleHistogramAggregation()
{
}
private DoubleHistogramAggregation() {}

@AccumulatorStateMetadata(stateSerializerClass = DoubleHistogramStateSerializer.class, stateFactoryClass = NumericHistogramStateFactory.class)
public interface State
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,7 @@ public void updateMemory()
}

@Override
public void close()
{
}
public void close() {}

@Override
public ListenableFuture<Void> startMemoryRevoke()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,9 +329,7 @@ private int findFirstNullPosition(int markerChannel)
return end;
}

public record PassThroughColumnSpecification(boolean isPartitioningColumn, int inputChannel, int indexChannel)
{
}
public record PassThroughColumnSpecification(boolean isPartitioningColumn, int inputChannel, int indexChannel) {}

private PassThroughColumnProvider createColumnProvider(PassThroughColumnSpecification specification)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,8 +428,6 @@ public void appendTo(long position, PageBuilder pageBuilder, int outputChannelOf
}

@Override
public void close()
{
}
public void close() {}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,5 @@ public void appendTo(long position, PageBuilder pageBuilder, int outputChannelOf
}

@Override
public void close()
{
}
public void close() {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@ public Operator createOperator(DriverContext driverContext)
}

@Override
public void noMoreOperators()
{
}
public void noMoreOperators() {}

@Override
public OperatorFactory duplicate()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,6 @@ public boolean isNull(int field)
}

@Override
public void close()
{
}
public void close() {}
}
}
Loading

0 comments on commit 40f2840

Please sign in to comment.