@@ -933,27 +933,25 @@ Java::
933933[source,java,indent=0,subs="verbatim,quotes"]
934934----
935935 // create a startup step and start recording
936- StartupStep scanPackages = getApplicationStartup().start("spring.context.base-packages.scan");
937- // add tagging information to the current step
938- scanPackages.tag("packages", () -> Arrays.toString(basePackages));
939- // perform the actual phase we're instrumenting
940- this.scanner.scan(basePackages);
941- // end the current step
942- scanPackages.end();
936+ try (StartupStep scanPackages = getApplicationStartup().start("spring.context.base-packages.scan")) {
937+ // add tagging information to the current step
938+ scanPackages.tag("packages", () -> Arrays.toString(basePackages));
939+ // perform the actual phase we're instrumenting
940+ this.scanner.scan(basePackages);
941+ }
943942----
944943
945944Kotlin::
946945+
947946[source,kotlin,indent=0,subs="verbatim,quotes"]
948947----
949948 // create a startup step and start recording
950- val scanPackages = getApplicationStartup().start("spring.context.base-packages.scan")
951- // add tagging information to the current step
952- scanPackages.tag("packages", () -> Arrays.toString(basePackages))
953- // perform the actual phase we're instrumenting
954- this.scanner.scan(basePackages)
955- // end the current step
956- scanPackages.end()
949+ try (val scanPackages = getApplicationStartup().start("spring.context.base-packages.scan")) {
950+ // add tagging information to the current step
951+ scanPackages.tag("packages", () -> Arrays.toString(basePackages));
952+ // perform the actual phase we're instrumenting
953+ this.scanner.scan(basePackages);
954+ }
957955----
958956======
959957
0 commit comments