File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
codegen/src/main/java/software/amazon/awssdk/codegen/utils Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 2222@ SdkInternalApi
2323public class VersionUtils {
2424
25- private VersionUtils () {
25+ private static final Pattern VERSION_PATTERN = Pattern . compile ( "( \\ d+) \\ .( \\ d+) \\ .( \\ d+)(.*)" );
2626
27+ private VersionUtils () {
2728 }
2829
2930 /**
30- * Converts a full version string to a major.minor.x format.
31+ * Converts a full version string to a major.minor.x format.
3132 *
3233 * @param version The full version string to convert (e.g., "2.32.1")
3334 * @return The version string in major.minor.x format (e.g., "2.32.x"),
3435 * or the original string if it doesn't match the expected version pattern
3536 */
3637 public static String convertToMajorMinorX (String version ) {
37- Pattern pattern = Pattern .compile ("(\\ d+)\\ .(\\ d+)\\ .(\\ d+)(.*)" );
38- Matcher matcher = pattern .matcher (version );
38+ Matcher matcher = VERSION_PATTERN .matcher (version );
3939
4040 if (matcher .matches ()) {
4141 String major = matcher .group (1 );
@@ -47,4 +47,5 @@ public static String convertToMajorMinorX(String version) {
4747
4848 return version ;
4949 }
50+
5051}
You can’t perform that action at this time.
0 commit comments