Skip to content

Commit ca4c162

Browse files
committed
Use ofVersion for CURRENT Spring Boot version
Replace the previous runtime string-based lookup of Spring Boot version with a type-based Version creation: add static import of ofVersion and change CURRENT to ofVersion(org.springframework.boot.SpringBootVersion.class). This simplifies version resolution and avoids calling SpringBootVersion.getVersion() directly.
1 parent 3665d16 commit ca4c162

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

microsphere-spring-boot-core/src/main/java/io/microsphere/spring/boot/SpringBootVersion.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import static io.microsphere.constants.SymbolConstants.DOT_CHAR;
2626
import static io.microsphere.constants.SymbolConstants.UNDER_SCORE_CHAR;
2727
import static io.microsphere.util.Version.of;
28+
import static io.microsphere.util.Version.ofVersion;
2829

2930
/**
3031
* The enumeration for the released Spring Boot versions since 3.0
@@ -221,11 +222,10 @@ public enum SpringBootVersion {
221222
SPRING_BOOT_4_0_3,
222223

223224
SPRING_BOOT_4_0_4,
224-
225-
SPRING_BOOT_4_0_5,
226225

227-
CURRENT(of(org.springframework.boot.SpringBootVersion.getVersion()));
226+
SPRING_BOOT_4_0_5,
228227

228+
CURRENT(ofVersion(org.springframework.boot.SpringBootVersion.class));
229229

230230
private final Version version;
231231

0 commit comments

Comments
 (0)