Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public void run(String... args) throws Exception {
.stream()
.map(CONVERTER::convert)
.filter(Objects::nonNull)
.filter(s -> s.getSpringBootVersion().matches("3\\.[4-9]\\.\\d+")) // Only consider 3.4.x versions or above
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix a bug when handle version like 3.5.12

.filter(s -> isVersionSupported(s.getSpringBootVersion()))
.peek(s -> s.setSpringCloudVersion(findCompatibleSpringCloudVersion(s.getSpringBootVersion())))
.peek(s -> s.setSupportStatus(findSupportStatus(s.getSpringBootVersion())))
.peek(s -> activeSpringBootVersions.add(s.getSpringBootVersion()))
Expand Down Expand Up @@ -149,4 +149,15 @@ String findCompatibleSpringCloudVersion(String springBootVersion) {
.stream().findFirst().orElse(NONE_SUPPORTED_VERSION);
}

/**
* Checks if the given Spring Boot version is supported (3.5.0 or above).
* @param springBootVersion the Spring Boot version string to check
* @return true if the version is 3.5.0 or above, false otherwise
*/
boolean isVersionSupported(String springBootVersion) {
Version version = Version.parse(springBootVersion);
Version minVersion = Version.parse("3.5.0");
Copy link

Copilot AI Dec 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The minimum version "3.5.0" is parsed on every call to isVersionSupported(). Consider extracting this as a constant field (e.g., private static final Version MIN_SUPPORTED_VERSION = Version.parse("3.5.0");) to avoid redundant parsing when this method is called multiple times in stream operations.

Copilot uses AI. Check for mistakes.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot open a new pull request to apply changes based on this feedback

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolve this conversation because:

  1. It will not cause any big problem, so ignore this problem.
  2. The Copilot can't create another PR. See this comment: Fix TokenCredential bean name resolution in Spring Cloud Stream Binder and EventHubs Messaging azure-sdk-for-java#47444 (comment)
    image

return version.compareTo(minVersion) >= 0;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,20 @@ void testMaintainVersions() {
Assertions.assertTrue(lists.contains(data2));
Assertions.assertFalse(lists.contains(data3));
}

@Test
void testIsVersionSupported() {
// Test versions that should be supported (3.5.0 or above)
Assertions.assertTrue(runner.isVersionSupported("3.5.0"));
Assertions.assertTrue(runner.isVersionSupported("3.5.1"));
Assertions.assertTrue(runner.isVersionSupported("3.5.12"));
Assertions.assertTrue(runner.isVersionSupported("3.6.0"));
Assertions.assertTrue(runner.isVersionSupported("4.0.0"));

// Test versions that should not be supported (below 3.5.0)
Assertions.assertFalse(runner.isVersionSupported("3.4.9"));
Assertions.assertFalse(runner.isVersionSupported("3.4.0"));
Assertions.assertFalse(runner.isVersionSupported("3.3.13"));
Assertions.assertFalse(runner.isVersionSupported("2.7.18"));
}
}