Details
-
New Feature
-
Status: Closed
-
Major
-
Resolution: Abandoned
-
None
-
None
-
None
-
None
-
Patch
Description
Current DefaultVersionInfo always increment either annotationRevision if available or least version from digits. say if 1.2.3 would be incremented to 1.2.4 always.
I am currently implementing fix for http://jira.codehaus.org/browse/MVERSIONS-124 which requires NextVersion with version incremented at specified index.
Hence it would be good to include another method shown below that will increment annotationRevision if parameter index is -ve. Otherwise it would roll the digit at specified index and reset rest of the digits
/** * Increment version at specified index. While incrementing digits set * remaining segments to zero. * * @param index * If -ve increment annotationRevision else increment digits at * index and reset remaining to 0. * @return new instance of version info */ public VersionInfo getNextVersion(int index) { DefaultVersionInfo version = null; if (digits != null) { List digits = new ArrayList(this.digits); String annotationRevision = this.annotationRevision; if (index < 0) { if (StringUtils.isNumeric(annotationRevision)) { annotationRevision = incrementVersionString(annotationRevision); } } else if (index < digits.size()) { int next = index; digits.set(next, incrementVersionString((String) digits .get(next))); for (int i = next + 1; i < digits.size(); i++) { digits.set(i, "0"); } } version = new DefaultVersionInfo(digits, annotation, annotationRevision, buildSpecifier, annotationSeparator, annotationRevSeparator, buildSeparator); } return version; }
Request some one to validate this and schedule this for checkin if possible
Regards,
Prashant
Attachments
Attachments
Issue Links
- relates to
-
MRELEASE-550 Version incrementation in non interactive release (batch-mode / -B)
- Closed