private static String getExistingMatchingIfixID ( BundleFile bundleFile , Set < String > existingIDs , Map < String , BundleFile > bundleFiles ) { String existingIfixKey = null ; // Iterate over the known ids. for ( String existingID : existingIDs ) { // If we have a corresponding BundleFile for the existing ID, we need to check it matches the currently processed file. if ( bundleFiles . containsKey ( existingID ) ) { BundleFile existingBundleFile = bundleFiles . get ( existingID ) ; // If our symbolic name match the supplied BundleFile then move on to the version checking. if ( bundleFile . getSymbolicName ( ) . equals ( existingBundleFile . getSymbolicName ( ) ) ) { //Get the versions of both the checking bundle and the existing bundle. Check that the version, excluding the qualifier match // and if they do, we have a match. Version existingBundleVersion = new Version ( existingBundleFile . getVersion ( ) ) ; Version bundleVersion = new Version ( bundleFile . getVersion ( ) ) ; if ( bundleVersion . getMajor ( ) == existingBundleVersion . getMajor ( ) && bundleVersion . getMinor ( ) == existingBundleVersion . getMinor ( ) && bundleVersion . getMicro ( ) == existingBundleVersion . getMicro ( ) ) existingIfixKey = existingID ; } } } return existingIfixKey ; }
This method takes a ifix ID finds any existing IFix IDs that refer to the same base bundle . Because the ifix jars will have different qualifiers we need to be able to work out which ids are related .