public static Version stringToVersion ( String str ) { if ( str == null || str . isEmpty ( ) || str . equals ( "0" ) ) { return Version . emptyVersion ; } if ( str . equals ( "1" ) || str . equals ( "1.0" ) || str . equals ( "1.0.0" ) ) return VERSION_1_0 ; return new Version ( str ) ; }
Convert a string into a Version reusing common Version objects if we can .