Skip to content
Closed

Polish #43498

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
2 changes: 1 addition & 1 deletion CONTRIBUTING.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ None of these is essential for a pull request, but they will all help. They can
added after the original pull request but before a merge.

* We use the https://github.com/spring-io/spring-javaformat/[Spring JavaFormat] project to apply code formatting conventions.
If you use Eclipse and you follow the https://github.com/spring-projects/spring-boot/wiki/Working-with-the-Code#importing-into-eclipse["Importing into eclipse"] instructions you should get project specific formatting automatically.
If you use Eclipse and you follow the https://github.com/spring-projects/spring-boot/wiki/Working-with-the-Code#importing-into-eclipse["Importing into Eclipse"] instructions you should get project-specific formatting automatically.
You can also install the https://github.com/spring-io/spring-javaformat/#intellij-idea[Spring JavaFormat IntelliJ Plugin] or format the code from the Gradle build by running `./gradlew format`.
Note that if you have format violations in `buildSrc`, you can fix them by running `./gradlew -p buildSrc format` from the project root directory.
* The build includes Checkstyle rules for many of our code conventions. Run `./gradlew checkstyleMain checkstyleTest` if you want to check your changes are compliant.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ private File resolveBom(Library library, String alignsWithBom) {
.getResolvedConfiguration()
.getResolvedArtifacts();
if (artifacts.size() != 1) {
throw new IllegalStateException("Expected a single file but '%s' resolved to %d artifacts"
throw new IllegalStateException("Expected a single artifact but '%s' resolved to %d artifacts"
.formatted(coordinates, artifacts.size()));
}
return artifacts.iterator().next().getFile();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,13 @@ class OnEnabledLoggingExportCondition extends SpringBootCondition {
public ConditionOutcome getMatchOutcome(ConditionContext context, AnnotatedTypeMetadata metadata) {
String loggingExporter = getExporterName(metadata);
if (StringUtils.hasLength(loggingExporter)) {
String formattedExporterProperty = EXPORTER_PROPERTY.formatted(loggingExporter);
Boolean exporterLoggingEnabled = context.getEnvironment()
.getProperty(EXPORTER_PROPERTY.formatted(loggingExporter), Boolean.class);
.getProperty(formattedExporterProperty, Boolean.class);
if (exporterLoggingEnabled != null) {
return new ConditionOutcome(exporterLoggingEnabled,
ConditionMessage.forCondition(ConditionalOnEnabledLoggingExport.class)
.because(EXPORTER_PROPERTY.formatted(loggingExporter) + " is " + exporterLoggingEnabled));
.because(formattedExporterProperty + " is " + exporterLoggingEnabled));
}
}
Boolean globalLoggingEnabled = context.getEnvironment().getProperty(GLOBAL_PROPERTY, Boolean.class);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,58 +1,58 @@
CREATE TABLE PREFIX_JOB_INSTANCE (
JOB_INSTANCE_ID BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY ,
VERSION BIGINT ,
JOB_INSTANCE_ID BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
VERSION BIGINT,
JOB_NAME VARCHAR(100) NOT NULL,
JOB_KEY VARCHAR(32) NOT NULL,
constraint JOB_INST_UN unique (JOB_NAME, JOB_KEY)
) ;

CREATE TABLE PREFIX_JOB_EXECUTION (
JOB_EXECUTION_ID BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY ,
VERSION BIGINT ,
JOB_EXECUTION_ID BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
VERSION BIGINT,
JOB_INSTANCE_ID BIGINT NOT NULL,
CREATE_TIME TIMESTAMP NOT NULL,
START_TIME TIMESTAMP DEFAULT NULL ,
END_TIME TIMESTAMP DEFAULT NULL ,
STATUS VARCHAR(10) ,
EXIT_CODE VARCHAR(2500) ,
EXIT_MESSAGE VARCHAR(2500) ,
START_TIME TIMESTAMP DEFAULT NULL,
END_TIME TIMESTAMP DEFAULT NULL,
STATUS VARCHAR(10),
EXIT_CODE VARCHAR(2500),
EXIT_MESSAGE VARCHAR(2500),
LAST_UPDATED TIMESTAMP,
JOB_CONFIGURATION_LOCATION VARCHAR(2500) NULL,
constraint JOB_INST_EXEC_FK foreign key (JOB_INSTANCE_ID)
references PREFIX_JOB_INSTANCE(JOB_INSTANCE_ID)
) ;

CREATE TABLE PREFIX_JOB_EXECUTION_PARAMS (
JOB_EXECUTION_ID BIGINT NOT NULL ,
TYPE_CD VARCHAR(6) NOT NULL ,
KEY_NAME VARCHAR(100) NOT NULL ,
STRING_VAL VARCHAR(250) ,
DATE_VAL TIMESTAMP DEFAULT NULL ,
LONG_VAL BIGINT ,
DOUBLE_VAL DOUBLE PRECISION ,
IDENTIFYING CHAR(1) NOT NULL ,
JOB_EXECUTION_ID BIGINT NOT NULL,
TYPE_CD VARCHAR(6) NOT NULL,
KEY_NAME VARCHAR(100) NOT NULL,
STRING_VAL VARCHAR(250),
DATE_VAL TIMESTAMP DEFAULT NULL,
LONG_VAL BIGINT,
DOUBLE_VAL DOUBLE PRECISION,
IDENTIFYING CHAR(1) NOT NULL,
constraint JOB_EXEC_PARAMS_FK foreign key (JOB_EXECUTION_ID)
references PREFIX_JOB_EXECUTION(JOB_EXECUTION_ID)
) ;

CREATE TABLE PREFIX_STEP_EXECUTION (
STEP_EXECUTION_ID BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY ,
STEP_EXECUTION_ID BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
VERSION BIGINT NOT NULL,
STEP_NAME VARCHAR(100) NOT NULL,
JOB_EXECUTION_ID BIGINT NOT NULL,
START_TIME TIMESTAMP NOT NULL ,
END_TIME TIMESTAMP DEFAULT NULL ,
STATUS VARCHAR(10) ,
COMMIT_COUNT BIGINT ,
READ_COUNT BIGINT ,
FILTER_COUNT BIGINT ,
WRITE_COUNT BIGINT ,
READ_SKIP_COUNT BIGINT ,
WRITE_SKIP_COUNT BIGINT ,
PROCESS_SKIP_COUNT BIGINT ,
ROLLBACK_COUNT BIGINT ,
EXIT_CODE VARCHAR(2500) ,
EXIT_MESSAGE VARCHAR(2500) ,
START_TIME TIMESTAMP NOT NULL,
END_TIME TIMESTAMP DEFAULT NULL,
STATUS VARCHAR(10),
COMMIT_COUNT BIGINT,
READ_COUNT BIGINT,
FILTER_COUNT BIGINT,
WRITE_COUNT BIGINT,
READ_SKIP_COUNT BIGINT,
WRITE_SKIP_COUNT BIGINT,
PROCESS_SKIP_COUNT BIGINT,
ROLLBACK_COUNT BIGINT,
EXIT_CODE VARCHAR(2500),
EXIT_MESSAGE VARCHAR(2500),
LAST_UPDATED TIMESTAMP,
constraint JOB_EXEC_STEP_FK foreign key (JOB_EXECUTION_ID)
references PREFIX_JOB_EXECUTION(JOB_EXECUTION_ID)
Expand All @@ -61,15 +61,15 @@ CREATE TABLE PREFIX_STEP_EXECUTION (
CREATE TABLE PREFIX_STEP_EXECUTION_CONTEXT (
STEP_EXECUTION_ID BIGINT NOT NULL PRIMARY KEY,
SHORT_CONTEXT VARCHAR(2500) NOT NULL,
SERIALIZED_CONTEXT LONGVARCHAR ,
SERIALIZED_CONTEXT LONGVARCHAR,
constraint STEP_EXEC_CTX_FK foreign key (STEP_EXECUTION_ID)
references PREFIX_STEP_EXECUTION(STEP_EXECUTION_ID)
) ;

CREATE TABLE PREFIX_JOB_EXECUTION_CONTEXT (
JOB_EXECUTION_ID BIGINT NOT NULL PRIMARY KEY,
SHORT_CONTEXT VARCHAR(2500) NOT NULL,
SERIALIZED_CONTEXT LONGVARCHAR ,
SERIALIZED_CONTEXT LONGVARCHAR,
constraint JOB_EXEC_CTX_FK foreign key (JOB_EXECUTION_ID)
references PREFIX_JOB_EXECUTION(JOB_EXECUTION_ID)
) ;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,8 @@ If multiple clients are available on the classpath, and not global configuration
[[io.rest-client.clienthttprequestfactory.configuration]]
=== Global HTTP Client Configuration

If the the auto-detected HTTP client does not meet your needs, you can use the configprop:spring.http.client.factory[] property to pick a specific factory.
For example, if you have Apache HttpClient on your classpath, but you prefer Jetty's javadoc:org.eclipse.jetty.client.HttpClient[] you can add use the following:
If the auto-detected HTTP client does not meet your needs, you can use the configprop:spring.http.client.factory[] property to pick a specific factory.
For example, if you have Apache HttpClient on your classpath, but you prefer Jetty's javadoc:org.eclipse.jetty.client.HttpClient[] you can add the following:

[configprops,yaml]
----
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import java.net.http.HttpClient
class MyClientHttpConfiguration {

@Bean
fun clientHttpRequestFactoryBuilder(proxySelector: ProxySelector): ClientHttpRequestFactoryBuilder<*>? {
fun clientHttpRequestFactoryBuilder(proxySelector: ProxySelector): ClientHttpRequestFactoryBuilder<*> {
return ClientHttpRequestFactoryBuilder.jdk()
.withHttpClientCustomizer { builder -> builder.proxy(proxySelector) }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ static class Deserializer extends JsonObjectDeserializer<ExampleCustomObject> {
protected ExampleCustomObject deserializeObject(JsonParser jsonParser, DeserializationContext context,
ObjectCodec codec, JsonNode tree) throws IOException {
String value = nullSafeValue(tree.get("value"), String.class);
Date date = nullSafeValue(tree.get("date"), Integer.class, Date::new);
Date date = nullSafeValue(tree.get("date"), Long.class, Date::new);
UUID uuid = nullSafeValue(tree.get("uuid"), String.class, UUID::fromString);
return new ExampleCustomObject(value, date, uuid);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,7 @@ public static String quote(String data) {
/**
* Wraps the given object if necessary.
* <p>
* If the object is null or , returns {@link #NULL}. If the object is a
* If the object is null or, returns {@link #NULL}. If the object is a
* {@code JSONArray} or {@code JSONObject}, no wrapping is necessary. If the object is
* {@code NULL}, no wrapping is necessary. If the object is an array or
* {@code Collection}, returns an equivalent {@code JSONArray}. If the object is a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,9 @@ public T instantiate(ClassLoader classLoader, String name) {
}

/**
* Instantiate the given set of classes, injecting constructor arguments as necessary.
* @param type the types to instantiate
* @return a list of instantiated instances
* Instantiate the given class, injecting constructor arguments as necessary.
* @param type the type to instantiate
* @return an instantiated instance
* @since 3.4.0
*/
public T instantiateType(Class<?> type) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ this.errorHandler, this.basicAuthentication, append(this.defaultHeaders, name, v

/**
* Sets the {@link ClientHttpRequestFactorySettings}. This will replace any previously
* set {@link #connectTimeout(Duration) connectTimeout} ,{@link #readTimeout(Duration)
* set {@link #connectTimeout(Duration) connectTimeout}, {@link #readTimeout(Duration)
* readTimeout} and {@link #sslBundle(SslBundle) sslBundle} values.
* @param requestFactorySettings the request factory settings
* @return a new builder instance
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
* {@link Value @Value} or obtained through the {@link Environment}.
* <p>
* If the {@link WebServerInitializedEvent} has a
* {@link WebServerApplicationContext#getServerNamespace() server namespace} , it will be
* {@link WebServerApplicationContext#getServerNamespace() server namespace}, it will be
* used to construct the property name. For example, the "management" actuator context
* will have the property name {@literal "local.management.port"}.
* <p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,9 @@ private void cleanupCaches() {
private AbstractApplicationLauncher getAbstractApplicationLauncher(Application application,
Class<? extends AbstractApplicationLauncher> launcherClass) {
String cacheKey = application.getContainer() + ":" + application.getPackaging() + ":" + launcherClass.getName();
if (this.launcherCache.containsKey(cacheKey)) {
return this.launcherCache.get(cacheKey);
AbstractApplicationLauncher cachedLauncher = this.launcherCache.get(cacheKey);
if (cachedLauncher != null) {
return cachedLauncher;
}
AbstractApplicationLauncher launcher = ReflectionUtils.newInstance(launcherClass, application,
new File(buildOutput.getRootLocation(), "app-launcher-" + UUID.randomUUID()));
Expand Down
Loading