in src/main/java/org/apache/sling/feature/maven/mojos/UpdateVersionsMojo.java [818:852]
private static int innerGetSegmentCount( final ArtifactVersion v ) {
// if the version does not match the maven rules, then we have only one segment
// i.e. the qualifier
if ( v.getBuildNumber() != 0 ) {
// the version was successfully parsed, and we have a build number
// have to have four segments
return 4;
}
if ( ( v.getMajorVersion() != 0 || v.getMinorVersion() != 0 || v.getIncrementalVersion() != 0 )
&& v.getQualifier() != null ) {
// the version was successfully parsed, and we have a qualifier
// have to have four segments
return 4;
}
final String version = v.toString();
if ( version.indexOf( '-' ) != -1 ) {
// the version has parts and was not parsed successfully
// have to have one segment
return version.equals( v.getQualifier() ) ? 1 : 4;
}
if ( version.indexOf( '.' ) != -1 ) {
// the version has parts and was not parsed successfully
// have to have one segment
return version.equals( v.getQualifier() ) ? 1 : 3;
}
if ( StringUtils.isEmpty( version ) ) {
return 3;
}
try {
Integer.parseInt( version );
return 3;
} catch ( final NumberFormatException e ) {
return 1;
}
}