Buggy code:
public abstract class BaseActivator implements BundleActivator { private static final Set < WeavingData > NON_WOVEN_BUNDLE = Collections . emptySet ( ) ; public static BaseActivator activator ; private BundleContext bundleContext ; private BaseActivator . LogServiceTracker logServiceTracker ; private List < LogService > logServices = new CopyOnWriteArrayList < LogService > ( ) ; private BundleTracker consumerBundleTracker ; private BundleTracker providerBundleTracker ; private final ConcurrentMap < Bundle , Set < WeavingData > > bundleWeavingData = new ConcurrentHashMap < Bundle , Set < WeavingData > > ( ) ; private final ConcurrentMap < String , SortedMap < Long , Bundle > > registeredProviders = new ConcurrentHashMap < String , SortedMap < Long , Bundle > > ( ) ; private final ConcurrentMap < Bundle , Map < ConsumerRestriction , List < BundleDescriptor > > > consumerRestrictions = new ConcurrentHashMap < Bundle , Map < ConsumerRestriction , List < BundleDescriptor > > > ( ) ; public synchronized void start ( BundleContext context , final String consumerHeaderName ) throws Exception { bundleContext = context ; logServiceTracker = new BaseActivator . LogServiceTracker ( context ) ; logServiceTracker . open ( ) ; providerBundleTracker = new BundleTracker ( context , Bundle . ACTIVE , new ProviderBundleTrackerCustomizer ( this , context . getBundle ( ) ) ) ; providerBundleTracker . open ( ) ; <START_BUG> consumerBundleTracker = new BundleTracker ( context , Bundle . INSTALLED , new ConsumerBundleTrackerCustomizer ( this , consumerHeaderName ) ) ; <END_BUG> consumerBundleTracker . open ( ) ; for ( Bundle bundle : context . getBundles ( ) ) { addConsumerWeavingData ( bundle , consumerHeaderName ) ; } BaseActivator . activator = this ; } public void addConsumerWeavingData ( Bundle bundle , String consumerHeaderName ) { } public void removeWeavingData ( Bundle bundle ) { } @ Override public synchronized void stop ( BundleContext context ) throws Exception { } public void log ( int level , String message ) { } public void log ( int level , String message , Throwable th ) { } public Set < WeavingData > getWeavingData ( Bundle b ) { } public void registerProviderBundle ( String registrationClassName , Bundle bundle ) { } public Collection < Bundle > findProviderBundles ( String name ) { } public void registerConsumerBundle ( Bundle consumerBundle , Set < ConsumerRestriction > restrictions , List < BundleDescriptor > allowedBundles ) { } public Collection < Bundle > findConsumerRestrictions ( Bundle consumer , String className , String methodName , Map < Pair < Integer , String > , String > args ) { } private Collection < Bundle > getBundles ( List < BundleDescriptor > descriptors ) { } private class LogServiceTracker extends ServiceTracker { public LogServiceTracker ( BundleContext context ) { } public Object addingService ( ServiceReference reference ) { } @ Override public void removedService ( ServiceReference reference , Object service ) { } } }

Fix:
consumerBundleTracker = new BundleTracker ( context , ( ( ( ( Bundle . INSTALLED ) | ( Bundle . RESOLVED ) ) | ( Bundle . STARTING ) ) | ( Bundle . ACTIVE ) ) , new ConsumerBundleTrackerCustomizer ( this , consumerHeaderName ) ) ;