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 22
22
@ SdkInternalApi
23
23
public class VersionUtils {
24
24
25
- private VersionUtils () {
25
+ private static final Pattern VERSION_PATTERN = Pattern . compile ( "( \\ d+) \\ .( \\ d+) \\ .( \\ d+)(.*)" );
26
26
27
+ private VersionUtils () {
27
28
}
28
29
29
30
/**
30
- * Converts a full version string to a major.minor.x format.
31
+ * Converts a full version string to a major.minor.x format.
31
32
*
32
33
* @param version The full version string to convert (e.g., "2.32.1")
33
34
* @return The version string in major.minor.x format (e.g., "2.32.x"),
34
35
* or the original string if it doesn't match the expected version pattern
35
36
*/
36
37
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 );
39
39
40
40
if (matcher .matches ()) {
41
41
String major = matcher .group (1 );
@@ -47,4 +47,5 @@ public static String convertToMajorMinorX(String version) {
47
47
48
48
return version ;
49
49
}
50
+
50
51
}
You can’t perform that action at this time.
0 commit comments