Create a new {@link PendingIntent} clearing previously created {@link PendingIntent} that does not work properly due to application's re-installation.
Bugfix utility for this issue: https://code.google.com/p/android/issues/detail?id=61850
503209
public static PendingIntent getBroadcast(Context context, int requestCode, Intent intent, int flags) {
        PendingIntent.getBroadcast(context, requestCode, intent, flags).cancel();
        return PendingIntent.getBroadcast(context, requestCode, intent, flags);
    }
802334
public void add(T item) {
        CompletableFuture<Queue<T>> pending;
        Queue<T> result = null;
        synchronized (this.contents) {
            Exceptions.checkNotClosed(this.closed, this);
            this.contents.addLast(item);
            pending = this.pendingTake;
            this.pendingTake = null;
            if (pending != null) {
                result = fetch(this.contents.size());
            }
        }

        if (pending != null) {
            pending.complete(result);
        }
    }
691184
private OnCheckedChangeListener createCheckedChangeListener() {
        return new OnCheckedChangeListener() {

            @Override
            public void onCheckedChanged(final CompoundButton buttonView, final boolean isChecked) {
                if (getOnPreferenceChangeListener() == null || getOnPreferenceChangeListener()
                        .onPreferenceChange(SwitchPreference.this, isChecked)) {
                    setChecked(isChecked);
                } else {
                    setChecked(!isChecked);
                }
            }

        };
    }
574661
public Status initialize() {
        Date createdOn = getCreatedOn();
        // set the CreatedOn date if it's not already set
        if (createdOn == null) {
            createdOn = new Date();
            setCreatedOn(createdOn);
        }

        //@FIXME for now we activate on creation, unless date is supplied
        if (getActivationTime() == null) {
            setActivationTime(createdOn);
        }

        setStatus(Status.Created);

        return Status.Created;
    }
1290770
private StateUpdater createReset(StateUpdater check)
    {
        return (extrp, current) ->
        {
            collidable.setEnabled(false);
            return check;
        };
    }
649400
public void committed()
    {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        SibTr.entry(tc, "committed");

      try
      {
        _aiStream =
          new AIStream(
            streamId,
            itemStream,
            AnycastInputHandler.this,
            _msUpdateThread,
            latestTick,
            completedPrefixItem,
            false,
            _messageProcessor);
      }
      catch (Exception e)
      {
        // this cannot happen since new AIStream only throws if there is an existing stream
        FFDCFilter.processException(
          e,
          "com.ibm.ws.sib.processor.impl.AnycastInputHandler.CreatePersistentStream.committed",
          "1:4735:1.219.1.1",
          this);

        SibTr.exception(tc, e);
      }

      _persistentStreamState = itemStream;

      // 243428; now that we have a stream, make sure that the timers are started
      start();

      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        SibTr.exit(tc, "committed");
    }
1339009
protected void bureauInitialized (ClientObject client, String bureauId)
    {
        final Bureau bureau = _bureaus.get(bureauId);
        if (bureau == null) {
            log.warning("Initialization of non-existent bureau", "bureauId", bureauId);
            return;
        }

        bureau.clientObj = client;

        log.info("Bureau created, launching pending agents", "bureau", bureau);

        // find all pending agents
        Set<AgentObject> pending = Sets.newHashSet();

        for (Map.Entry<AgentObject, AgentState> entry :
            bureau.agentStates.entrySet()) {

            if (entry.getValue() == AgentState.PENDING) {
                pending.add(entry.getKey());
            }
        }

        // create them
        for (AgentObject agent : pending) {
            log.info("Creating agent", "agent", agent.which());
            BureauSender.createAgent(bureau.clientObj, agent.getOid());
            bureau.agentStates.put(agent, AgentState.STARTED);
        }

        bureau.summarize();
    }
1366813
public static void initialize()
    {
        if (AppConfigHandler.get().isQueryCacheDeactivated()) {
            QueryCache.NOOP = new NoOpQueryCache();
        } else {
            if (InfinispanCache.get().exists(QueryCache.INDEXCACHE)) {
                InfinispanCache.get().<String, QueryKey>getCache(QueryCache.INDEXCACHE).clear();
            } else {
                final Cache<String, QueryKey> cache = InfinispanCache.get().<String, QueryKey>getCache(
                                QueryCache.INDEXCACHE);
                cache.addListener(new CacheLogListener(QueryCache.LOG));
            }
            if (InfinispanCache.get().exists(QueryCache.SQLCACHE)) {
                InfinispanCache.get().<QueryKey, Object>getCache(QueryCache.SQLCACHE).clear();
            } else {
                final Cache<QueryKey, Object> cache = InfinispanCache.get().<QueryKey, Object>getCache(
                                QueryCache.SQLCACHE);
                cache.addListener(new CacheLogListener(QueryCache.LOG));
                cache.addListener(new SqlCacheListener());
            }
        }
    }
1118947
@Override
    public T create(final CreationalContext<T> creationalContext) {
        if (proxyInstantiator == null) {
            // initializeAfterBeanDiscovery wasn't yet invoked
            // this can happen if you attempt to create bean prior to fully booting container
            throw BeanLogger.LOG.initABDnotInvoked(annotatedType);
        }
        return proxyInstantiator.newInstance(creationalContext, beanManager);
    }
1175140
@Override
    public final InternalQueryCache createNew(String cacheId) {
        try {
            QueryCacheConfig queryCacheConfig = initQueryCacheConfig(request, cacheId);
            if (queryCacheConfig == null) {
                // no matching configuration was found, `null` will
                // be returned to user from IMap#getQueryCache call.
                return NULL_QUERY_CACHE;
            }
            queryCache = createUnderlyingQueryCache(queryCacheConfig, request, cacheId);

            AccumulatorInfo info = toAccumulatorInfo(queryCacheConfig, mapName, cacheId, predicate);
            addInfoToSubscriberContext(info);

            info.setPublishable(true);

            String publisherListenerId = queryCache.getPublisherListenerId();
            if (publisherListenerId == null) {
                createSubscriberAccumulator(info);
            }
            createPublisherAccumulator(info);

            queryCache.setPublisherListenerId(this.publisherListenerId);

        } catch (Throwable throwable) {
            removeQueryCacheConfig(mapName, request.getCacheName());
            throw rethrow(throwable);
        }

        return queryCache;
    }
1275315
private void initializePendingIntent(Context context) {

        // toggle playback
        Intent togglePlaybackIntent = new Intent(context, PlaybackService.class);
        togglePlaybackIntent.setAction(PlaybackService.ACTION_TOGGLE_PLAYBACK);
        mTogglePlaybackPendingIntent = PendingIntent.getService(context, REQUEST_CODE_PLAYBACK,
                togglePlaybackIntent, PendingIntent.FLAG_UPDATE_CURRENT);

        // next track
        Intent nextPrendingIntent = new Intent(context, PlaybackService.class);
        nextPrendingIntent.setAction(PlaybackService.ACTION_NEXT_TRACK);
        mNextPendingIntent = PendingIntent.getService(context, REQUEST_CODE_NEXT,
                nextPrendingIntent, PendingIntent.FLAG_UPDATE_CURRENT);

        // previous track
        Intent previousPendingIntent = new Intent(context, PlaybackService.class);
        previousPendingIntent.setAction(PlaybackService.ACTION_PREVIOUS_TRACK);
        mPreviousPendingIntent = PendingIntent.getService(context, REQUEST_CODE_PREVIOUS,
                previousPendingIntent, PendingIntent.FLAG_UPDATE_CURRENT);

        // clear notification
        Intent clearPendingIntent = new Intent(context, PlaybackService.class);
        clearPendingIntent.setAction(PlaybackService.ACTION_CLEAR_NOTIFICATION);
        mClearPendingIntent = PendingIntent.getService(context, REQUEST_CODE_CLEAR,
                clearPendingIntent, PendingIntent.FLAG_UPDATE_CURRENT);
    }
1066671
public Note instantiateForInsert() {
		Note entity = new Note();
		entity.setIsDeleted(Boolean.FALSE);
		return entity;
	}
451524
@Override
	public synchronized void addNotification(IntegerID consumerId, AbstractMessage prefetchedMessage)
    {
		NotificationPacket notifPacket = new NotificationPacket();
    	notifPacket.setSessionId(sessionId);
        notifPacket.setConsumerId(consumerId);
        notifPacket.setMessage(prefetchedMessage);
        
        notificationBuffer.add(notifPacket);
    }
1367496
public PendingIntent getDeleteIntent(NotificationEntry entry) {
        Intent intent = new Intent(ACTION_CANCEL);
        intent.putExtra(KEY_ENTRY_ID, entry.ID);
        return PendingIntent.getBroadcast(mContext, genIdForPendingIntent(), intent, 0);
    }
172784
public final UploadNotificationConfig setClickIntentForAllStatuses(PendingIntent clickIntent) {
        progress.clickIntent = clickIntent;
        completed.clickIntent = clickIntent;
        error.clickIntent = clickIntent;
        cancelled.clickIntent = clickIntent;
        return this;
    }
123267
public void init(Application app, Activity initActivity) {
        HMSAgentLog.d("init");

        if (application != null) {
            application.unregisterActivityLifecycleCallbacks(this);
        }

        application = app;
        setCurActivity(initActivity);
        app.registerActivityLifecycleCallbacks(this);
    }
347849
private void initialize() {
        selectedIndices = null;
        setNegativeButtonText(android.R.string.cancel);
        setPositiveButtonText(android.R.string.ok);
    }