Merge pull request #28494 from izeye
* pr/28494: Polish Closes gh-28494
This commit is contained in:
commit
f71e2198ca
|
@ -900,7 +900,7 @@ public class RabbitProperties {
|
|||
* Whether the container will support listeners that consume native stream
|
||||
* messages instead of Spring AMQP messages.
|
||||
*/
|
||||
boolean nativeListener;
|
||||
private boolean nativeListener;
|
||||
|
||||
public boolean isNativeListener() {
|
||||
return this.nativeListener;
|
||||
|
|
|
@ -18,7 +18,7 @@ package org.springframework.boot.autoconfigure.condition.scan;
|
|||
|
||||
public class ScanBean {
|
||||
|
||||
private String value;
|
||||
private final String value;
|
||||
|
||||
public ScanBean(String value) {
|
||||
this.value = value;
|
||||
|
|
|
@ -301,11 +301,11 @@ public class SpringApplication {
|
|||
prepareContext(bootstrapContext, context, environment, listeners, applicationArguments, printedBanner);
|
||||
refreshContext(context);
|
||||
afterRefresh(context, applicationArguments);
|
||||
Duration timeTakeToStartup = Duration.ofNanos(System.nanoTime() - startTime);
|
||||
Duration timeTakenToStartup = Duration.ofNanos(System.nanoTime() - startTime);
|
||||
if (this.logStartupInfo) {
|
||||
new StartupInfoLogger(this.mainApplicationClass).logStarted(getApplicationLog(), timeTakeToStartup);
|
||||
new StartupInfoLogger(this.mainApplicationClass).logStarted(getApplicationLog(), timeTakenToStartup);
|
||||
}
|
||||
listeners.started(context, timeTakeToStartup);
|
||||
listeners.started(context, timeTakenToStartup);
|
||||
callRunners(context, applicationArguments);
|
||||
}
|
||||
catch (Throwable ex) {
|
||||
|
|
|
@ -56,9 +56,9 @@ class StartupInfoLogger {
|
|||
applicationLog.debug(LogMessage.of(this::getRunningMessage));
|
||||
}
|
||||
|
||||
void logStarted(Log applicationLog, Duration timeTakeToStartup) {
|
||||
void logStarted(Log applicationLog, Duration timeTakenToStartup) {
|
||||
if (applicationLog.isInfoEnabled()) {
|
||||
applicationLog.info(getStartedMessage(timeTakeToStartup));
|
||||
applicationLog.info(getStartedMessage(timeTakenToStartup));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -83,12 +83,12 @@ class StartupInfoLogger {
|
|||
return message;
|
||||
}
|
||||
|
||||
private CharSequence getStartedMessage(Duration timeTakeToStartup) {
|
||||
private CharSequence getStartedMessage(Duration timeTakenToStartup) {
|
||||
StringBuilder message = new StringBuilder();
|
||||
message.append("Started ");
|
||||
appendApplicationName(message);
|
||||
message.append(" in ");
|
||||
message.append(timeTakeToStartup.toMillis() / 1000.0);
|
||||
message.append(timeTakenToStartup.toMillis() / 1000.0);
|
||||
message.append(" seconds");
|
||||
try {
|
||||
double uptime = ManagementFactory.getRuntimeMXBean().getUptime() / 1000.0;
|
||||
|
|
|
@ -604,7 +604,7 @@ public class SpringApplicationBuilder {
|
|||
/**
|
||||
* Whether to allow circular references between beans and automatically try to resolve
|
||||
* them.
|
||||
* @param allowCircularReferences whether circular references are allows
|
||||
* @param allowCircularReferences whether circular references are allowed
|
||||
* @return the current builder
|
||||
* @since 2.6.0
|
||||
* @see AbstractAutowireCapableBeanFactory#setAllowCircularReferences(boolean)
|
||||
|
|
|
@ -56,8 +56,8 @@ class StartupInfoLoggerTests {
|
|||
@Test
|
||||
void startedFormat() {
|
||||
given(this.log.isInfoEnabled()).willReturn(true);
|
||||
Duration timeTakeToStartup = Duration.ofMillis(10);
|
||||
new StartupInfoLogger(getClass()).logStarted(this.log, timeTakeToStartup);
|
||||
Duration timeTakenToStartup = Duration.ofMillis(10);
|
||||
new StartupInfoLogger(getClass()).logStarted(this.log, timeTakenToStartup);
|
||||
ArgumentCaptor<Object> captor = ArgumentCaptor.forClass(Object.class);
|
||||
verify(this.log).info(captor.capture());
|
||||
assertThat(captor.getValue().toString()).matches("Started " + getClass().getSimpleName()
|
||||
|
|
Loading…
Reference in New Issue