diff --git a/app/src/main/java/org/mian/gitnex/helpers/Version.java b/app/src/main/java/org/mian/gitnex/helpers/Version.java index 91ad2364..455e3c8b 100644 --- a/app/src/main/java/org/mian/gitnex/helpers/Version.java +++ b/app/src/main/java/org/mian/gitnex/helpers/Version.java @@ -22,9 +22,8 @@ public class Version { /** * regex used to identify the type of version **/ - final Pattern pattern_major_minor_patch_release = Pattern.compile("^[v,V]?(\\d+)\\.(\\d+)\\.(\\d+)"); - final Pattern pattern_dev_release = Pattern.compile("^[v,V]?(\\d).(\\d+).(\\d+)(\\D)(.+)"); - + final private Pattern pattern_major_minor_patch_release = Pattern.compile("^[v,V]?(\\d+)\\.(\\d+)\\.(\\d+)"); + final private Pattern pattern_dev_release = Pattern.compile("^[v,V]?(\\d).(\\d+).(\\d+)(\\D)(.+)"); /** * public static Version check(String min, String last, String value) { @@ -76,6 +75,7 @@ public class Version { public Version(String value) { raw = value; + this.init(); } @@ -83,6 +83,20 @@ public class Version { * HELPER **/ + /** + * init parse and store values for other functions of an Version instance + * it use the raw variable as base + * + * @return if parse was successfully + */ + private boolean init() { + + this.raw = raw; + // .... + return true; + + } + /** * @param min * @param last