public static Bundle getBundle ( BundleContext bc , String symbolicName , String version ) { for ( Bundle bundle : bc . getBundles ( ) ) { if ( bundle . getSymbolicName ( ) . equals ( symbolicName ) ) { if ( version == null || version . equals ( bundle . getVersion ( ) ) ) { return bundle ; } } } return null ; }
Returns the bundle with the given symbolic name and the given version or null if no such bundle exists