Skip to content

Commit

Permalink
Merge pull request #28494 from izeye
Browse files Browse the repository at this point in the history
* pr/28494:
  Polish

Closes gh-28494
  • Loading branch information
snicoll committed Nov 1, 2021
2 parents 51dc02e + 5d8dce7 commit f71e219
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,7 @@ public static class StreamContainer extends BaseContainer {
* 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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

public class ScanBean {

private String value;
private final String value;

public ScanBean(String value) {
this.value = value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,11 +301,11 @@ public ConfigurableApplicationContext run(String... args) {
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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ void logStarting(Log applicationLog) {
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));
}
}

Expand All @@ -83,12 +83,12 @@ private CharSequence getRunningMessage() {
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ public SpringApplicationBuilder applicationStartup(ApplicationStartup applicatio
/**
* 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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ void startingFormat() throws UnknownHostException {
@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()
Expand Down

0 comments on commit f71e219

Please sign in to comment.