Skip to content

Commit

Permalink
[apache#3077] feat(client): Use ? rather than {0,1} in regex (apache#…
Browse files Browse the repository at this point in the history
…3147)

### What changes were proposed in this pull request?

Use ? rather than {0,1} in regex in GravitinoVersion.java

### Why are the changes needed?

Fix: apache#3077 

### Does this PR introduce _any_ user-facing change?

N/A

### How was this patch tested?

exist ut

Co-authored-by: yangliwei <[email protected]>
  • Loading branch information
2 people authored and diqiu50 committed Jun 13, 2024
1 parent b3e2784 commit ee14da1
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class GravitinoVersion extends VersionDTO implements Comparable {
@VisibleForTesting
/** @return parse the version number for a version string */
int[] getVersionNumber() {
Pattern pattern = Pattern.compile("(\\d+)\\.(\\d+)\\.(\\d+)(-\\w+){0,1}");
Pattern pattern = Pattern.compile("(\\d+)\\.(\\d+)\\.(\\d+)(-\\w+)?");
Matcher matcher = pattern.matcher(version());
if (matcher.matches()) {
int[] versionNumbers = new int[VERSION_PART_NUMBER];
Expand Down

0 comments on commit ee14da1

Please sign in to comment.