Skip to content

Commit

Permalink
Reformat code
Browse files Browse the repository at this point in the history
  • Loading branch information
mp911de committed Jun 26, 2020
1 parent 9e85d3d commit 440b45d
Show file tree
Hide file tree
Showing 98 changed files with 161 additions and 64 deletions.
40 changes: 22 additions & 18 deletions intellij-style.xml
Original file line number Diff line number Diff line change
@@ -1,26 +1,30 @@
<code_scheme name="Project" version="173">
<option name="RIGHT_MARGIN" value="200" />
<option name="FORMATTER_TAGS_ENABLED" value="true" />
<option name="WRAP_COMMENTS" value="true" />
<option name="SOFT_MARGINS" value="200" />
<code_scheme name="R2DBC" version="173">
<option name="RIGHT_MARGIN" value="200"/>
<option name="FORMATTER_TAGS_ENABLED" value="true"/>
<option name="SOFT_MARGINS" value="200"/>
<JavaCodeStyleSettings>
<option name="CLASS_NAMES_IN_JAVADOC" value="3" />
<option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="999" />
<option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="999" />
<option name="CLASS_NAMES_IN_JAVADOC" value="3"/>
<option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="999"/>
<option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="999"/>
</JavaCodeStyleSettings>
<XML>
<option name="XML_LEGACY_SETTINGS_IMPORTED" value="true" />
<option name="XML_LEGACY_SETTINGS_IMPORTED" value="true"/>
</XML>
<codeStyleSettings language="JAVA">
<option name="BLANK_LINES_BEFORE_PACKAGE" value="1" />
<option name="BLANK_LINES_AROUND_FIELD" value="1" />
<option name="BLANK_LINES_AROUND_FIELD_IN_INTERFACE" value="1" />
<option name="BLANK_LINES_AFTER_CLASS_HEADER" value="1" />
<option name="BLANK_LINES_AFTER_ANONYMOUS_CLASS_HEADER" value="1" />
<option name="IF_BRACE_FORCE" value="3" />
<option name="WRAP_LONG_LINES" value="true" />
<option name="KEEP_BLANK_LINES_IN_DECLARATIONS" value="1"/>
<option name="KEEP_BLANK_LINES_IN_CODE" value="1"/>
<option name="KEEP_BLANK_LINES_BETWEEN_PACKAGE_DECLARATION_AND_HEADER" value="1"/>
<option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="1"/>
<option name="BLANK_LINES_BEFORE_PACKAGE" value="1"/>
<option name="BLANK_LINES_AROUND_FIELD" value="1"/>
<option name="BLANK_LINES_AROUND_FIELD_IN_INTERFACE" value="1"/>
<option name="BLANK_LINES_AFTER_CLASS_HEADER" value="1"/>
<option name="BLANK_LINES_AFTER_ANONYMOUS_CLASS_HEADER" value="1"/>
<option name="BLANK_LINES_BEFORE_CLASS_END" value="1"/>
<option name="IF_BRACE_FORCE" value="3"/>
<option name="WRAP_LONG_LINES" value="true"/>
<indentOptions>
<option name="CONTINUATION_INDENT_SIZE" value="4" />
<option name="CONTINUATION_INDENT_SIZE" value="4"/>
</indentOptions>
<arrangement>
<rules>
Expand Down Expand Up @@ -446,4 +450,4 @@
<codeStyleSettings language="TypeScript">
<option name="WRAP_COMMENTS" value="true" />
</codeStyleSettings>
</code_scheme>
</code_scheme>
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ public void setup() {
throw new RuntimeException(e);
}
}

}

@Benchmark
Expand Down
1 change: 1 addition & 0 deletions src/jmh/java/io/r2dbc/postgresql/StatementBenchmarks.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public ConnectionHolder() {
throw new RuntimeException(e);
}
}

}

@Benchmark
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/io/r2dbc/postgresql/BoundedStatementCache.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ public Mono<String> getName(Binding binding, String sql) {
.doOnNext(preparedName -> put(key, preparedName));
}


/**
* Synchronized cache access: Return all statement names.
*
Expand Down Expand Up @@ -195,5 +194,7 @@ public int hashCode() {
result = 31 * result + Arrays.hashCode(this.parameterTypes);
return result;
}

}

}
4 changes: 3 additions & 1 deletion src/main/java/io/r2dbc/postgresql/ConnectionContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ final class ConnectionContext {

private final PortalNameSupplier portalNameSupplier;

ConnectionContext(Client client, Codecs codecs, PostgresqlConnection connection, PostgresqlConnectionConfiguration configuration, PortalNameSupplier portalNameSupplier, StatementCache statementCache) {
ConnectionContext(Client client, Codecs codecs, PostgresqlConnection connection, PostgresqlConnectionConfiguration configuration, PortalNameSupplier portalNameSupplier,
StatementCache statementCache) {
this.client = client;
this.codecs = codecs;
this.connection = connection;
Expand Down Expand Up @@ -83,4 +84,5 @@ public String toString() {
", statementCache=" + this.statementCache +
'}';
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,5 @@ public String toString() {
"client=" + this.client +
'}';
}

}
7 changes: 7 additions & 0 deletions src/main/java/io/r2dbc/postgresql/ExceptionFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ static final class PostgresqlBadGrammarException extends R2dbcBadGrammarExceptio
public ErrorDetails getErrorDetails() {
return this.errorDetails;
}

}

/**
Expand All @@ -147,6 +148,7 @@ static final class PostgresqlDataIntegrityViolationException extends R2dbcDataIn
public ErrorDetails getErrorDetails() {
return this.errorDetails;
}

}

/**
Expand All @@ -165,6 +167,7 @@ static final class PostgresqlNonTransientResourceException extends R2dbcNonTrans
public ErrorDetails getErrorDetails() {
return this.errorDetails;
}

}

/**
Expand All @@ -183,6 +186,7 @@ static final class PostgresqlPermissionDeniedException extends R2dbcPermissionDe
public ErrorDetails getErrorDetails() {
return this.errorDetails;
}

}

/**
Expand All @@ -201,6 +205,7 @@ static final class PostgresqlRollbackException extends R2dbcRollbackException im
public ErrorDetails getErrorDetails() {
return this.errorDetails;
}

}

/**
Expand All @@ -219,6 +224,7 @@ static final class PostgresqlTransientException extends R2dbcTransientException
public ErrorDetails getErrorDetails() {
return this.errorDetails;
}

}

/**
Expand All @@ -237,6 +243,7 @@ static final class PostgresqlAuthenticationFailure extends R2dbcPermissionDenied
public ErrorDetails getErrorDetails() {
return this.errorDetails;
}

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ private Binding getCurrent() {

return this.current;
}

}

}
1 change: 1 addition & 0 deletions src/main/java/io/r2dbc/postgresql/Extensions.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,5 @@ Extensions mergeWith(Extensions other) {
public int size() {
return this.extensions.size();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,5 @@ private Mono<String> parse(String sql, int[] types) {
.then(Mono.just(name))
.cache();
}

}
1 change: 1 addition & 0 deletions src/main/java/io/r2dbc/postgresql/KeepAliveMessage.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,5 @@ public ByteBuf encode(ByteBufAllocator allocator) {

return out;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,5 @@ public String toString() {
"parameter=" + getParameter() +
'}';
}

}
5 changes: 4 additions & 1 deletion src/main/java/io/r2dbc/postgresql/OptionMapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ public interface Source<T> {
* @param consumer the runnable that should be invoked.
*/
Otherwise to(Runnable consumer);

}

public interface Otherwise {
Expand All @@ -170,6 +171,7 @@ public interface Otherwise {
* @param consumer the runnable that should be invoked.
*/
void otherwise(Runnable consumer);

}

private enum Otherwises implements Otherwise {
Expand All @@ -187,7 +189,6 @@ public void otherwise(Runnable consumer) {
}
}


@SuppressWarnings({"unchecked", "rawtypes"})
private enum NullSource implements Source<Object> {

Expand Down Expand Up @@ -267,5 +268,7 @@ public Otherwise to(Consumer<T> consumer) {
public Otherwise to(Runnable consumer) {
return to(ignore -> consumer.run());
}

}

}
4 changes: 3 additions & 1 deletion src/main/java/io/r2dbc/postgresql/PostgresqlConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ final class PostgresqlConnection implements io.r2dbc.postgresql.api.PostgresqlCo

private volatile IsolationLevel isolationLevel;

PostgresqlConnection(Client client, Codecs codecs, PortalNameSupplier portalNameSupplier, StatementCache statementCache, IsolationLevel isolationLevel, PostgresqlConnectionConfiguration configuration) {
PostgresqlConnection(Client client, Codecs codecs, PortalNameSupplier portalNameSupplier, StatementCache statementCache, IsolationLevel isolationLevel,
PostgresqlConnectionConfiguration configuration) {
this.context = new ConnectionContext(client, codecs, this, configuration, portalNameSupplier, statementCache);
this.client = Assert.requireNonNull(client, "client must not be null");
this.codecs = Assert.requireNonNull(codecs, "codecs must not be null");
Expand Down Expand Up @@ -418,6 +419,7 @@ public void onComplete() {
Flux<Notification> getEvents() {
return this.processor;
}

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -770,6 +770,7 @@ private Supplier<SslProvider> createSslProvider() {
.defaultConfiguration(TCP)
.build();
}

}

static class FixedFetchSize implements ToIntFunction<String> {
Expand All @@ -789,5 +790,7 @@ public int applyAsInt(String value) {
public String toString() {
return "" + this.fetchSize;
}

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ static class PostgresConnectionException extends R2dbcNonTransientResourceExcept
public PostgresConnectionException(String msg, @Nullable Throwable cause) {
super(msg, cause);
}

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,5 @@ private PostgresqlConnectionFactoryMetadata() {
public String getName() {
return NAME;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -267,4 +267,5 @@ private static Map<String, String> convertToMap(Object options) {

return result;
}

}
1 change: 1 addition & 0 deletions src/main/java/io/r2dbc/postgresql/PostgresqlRow.java
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ public String toString() {
", context=" + this.context +
'}';
}

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -135,5 +135,4 @@ private Collection<String> getColumnNames(List<PostgresqlColumnMetadata> columnM
return columnNames;
}


}
1 change: 1 addition & 0 deletions src/main/java/io/r2dbc/postgresql/StatementCache.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@ static StatementCache fromPreparedStatementCacheQueries(Client client, int prepa
}
return new BoundedStatementCache(client, preparedStatementCacheQueries);
}

}
1 change: 0 additions & 1 deletion src/main/java/io/r2dbc/postgresql/api/ErrorDetails.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ public final class ErrorDetails {

private final String where;


/**
* Create new {@link ErrorDetails} from {@link List} of {@link Field fields}.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,5 @@ public interface PostgresqlResult extends Result {
*/
@Override
<T> Flux<T> map(BiFunction<Row, RowMetadata, ? extends T> mappingFunction);

}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ public SASLAuthenticationHandler(CharSequence password, String username) {
this.username = Assert.requireNonNull(username, "username must not be null");
}


/**
* Returns whether this {@link AuthenticationHandler} can support authentication for a given authentication message response.
*
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/io/r2dbc/postgresql/client/Binding.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
* A collection of {@link Parameter}s for a single bind invocation of an {@link ExtendedQueryMessageFlow}.
*/
public final class Binding {

public static final Binding EMPTY = new Binding(0);

private static final Parameter UNSPECIFIED = new Parameter(Format.FORMAT_BINARY, -1, Mono.never());
Expand Down Expand Up @@ -181,7 +182,6 @@ private <T> List<T> getTransformedParameters(Function<Parameter, T> transformer)
transformed = new ArrayList<>(this.parameters.size());
}


transformed.add(transformer.apply(parameter));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ public Builder sslConfig(SSLConfig sslConfig) {
this.sslConfig = Assert.requireNonNull(sslConfig, "sslConfig must not be null");
return this;
}

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -231,4 +231,5 @@ private static Collection<Format> resultFormat(boolean forceBinary) {
return Collections.emptyList();
}
}

}
1 change: 1 addition & 0 deletions src/main/java/io/r2dbc/postgresql/client/QueryLogger.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ final class QueryLogger {
static void logQuery(String query) {
QUERY_LOGGER.debug("Executing query: {}", query);
}

}
Loading

0 comments on commit 440b45d

Please sign in to comment.