Reset the original read preference after changing with setReadPreferenceToPrimary
340988
protected function resetOriginalReadPreference(){

        /** @var ReadPreference $dbReadPref */
        $dbReadPref = $this->db->__debugInfo()['readPreference'];
        if($this->originalDbReadPreference !== $dbReadPref->getMode())
        {
            $pref = (isset($this->originalDbReadPreference)
                ? $this->originalDbReadPreference
                : $this->readPreference
            );
            $dbTagsets = $dbReadPref->getTagsets();

            $this->db = $this->db->withOptions(array(
                'readPreference' => new ReadPreference($pref, $dbTagsets)
            ));
        }

        // Reset collection object
        /** @var ReadPreference $collReadPref */
        $collReadPref = $this->getCollection()->__debugInfo()['readPreference'];
        if($this->originalCollectionReadPreference !== $collReadPref->getMode()){
            $pref = (isset($this->originalCollectionReadPreference)
                ? $this->originalCollectionReadPreference
                : $this->readPreference
            );
            $collTagsets = $collReadPref->getTagsets();
            $this->collection = $this->collection->withOptions(array(
                'readPreference' => new ReadPreference($pref, $collTagsets)
            ));
        }
    }
442829
function editReadme( readme ) {
		var rprev = new RegExp( Release.prevVersion, "g" );
		return readme.replace( rprev, Release.newVersion );
	}
262219
public function setReadPreference(?string $readPreference, array $tags) : void
    {
        $this->readPreference     = $readPreference;
        $this->readPreferenceTags = $tags;
    }
600892
public function setReadPreference($readPreference, array $tags = null)
    {
        if (isset($tags)) {
            return $this->riakCollection->setReadPreference($readPreference, $tags);
        }

        return $this->riakCollection->setReadPreference($readPreference);
    }
778389
private void initializePreferenceScreenElevation(final SharedPreferences sharedPreferences) {
        String key = getString(R.string.preference_screen_elevation_preference_key);
        String defaultValue =
                getString(R.string.preference_screen_elevation_preference_default_value);
        int elevation = Integer.valueOf(sharedPreferences.getString(key, defaultValue));
        setCardViewElevation(elevation);
    }
138086
private void obtainRestoreDefaultsButtonText() {
        CharSequence text;

        try {
            text = ThemeUtil.getText(getActivity(), R.attr.restoreDefaultsButtonText);
        } catch (NotFoundException e) {
            text = getText(R.string.restore_defaults_button_text);
        }

        setRestoreDefaultsButtonText(text);
    }
1374865
protected void setReadOnly()
   {
      // try to stop merger in safe way
      if (merger != null)
      {
         merger.dispose();
         merger = null;
      }

      if (flushTask != null)
      {
         flushTask.cancel();
      }
      FLUSH_TIMER.purge();
      this.redoLog = null;
   }
349877
private void adaptWizardButtonVisibilities() {
        if (buttonBar != null && backButton != null && nextButton != null && finishButton != null &&
                navigationFragment != null) {
            int selectedNavigationPreferenceIndex =
                    navigationFragment.getSelectedNavigationPreferenceIndex();

            if (selectedNavigationPreferenceIndex != -1 && isButtonBarShown()) {
                int navigationPreferenceCount = navigationFragment.getNavigationPreferenceCount();
                backButton.setVisibility(
                        (selectedNavigationPreferenceIndex != 0) ? View.VISIBLE : View.GONE);
                nextButton.setVisibility(
                        (selectedNavigationPreferenceIndex != navigationPreferenceCount - 1) ?
                                View.VISIBLE : View.GONE);
                finishButton.setVisibility(
                        (selectedNavigationPreferenceIndex == navigationPreferenceCount - 1) ?
                                View.VISIBLE : View.GONE);
            } else if (isButtonBarShown()) {
                backButton.setVisibility(View.GONE);
                nextButton.setVisibility(View.GONE);
                finishButton.setVisibility(View.VISIBLE);
            }
        }
    }
23091
@Override
    public void setReadStateToDone() {
        synchronized (this) {
            currentState = currentState & READ_DONE_CLEAR_OUT;
            if (closeWaiting) {
                this.notify();
            }
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "setReadStateToDone");
            }
        }
    }
1351727
public void reset(long ref, float[] pos) {
        m_path.clear();
        m_path.add(ref);
        vCopy(m_pos, pos);
        vCopy(m_target, pos);
    }
298127
private void changeCurrToReference() {
		Se2_F64 keyToCurr = currToKey.invert(null);

		List<PointTrack> all = tracker.getAllTracks(null);

		for (PointTrack t : all) {
			VoTrack p = t.getCookie();

			if (p.onPlane) {
				SePointOps_F64.transform(keyToCurr, p.ground, p.ground);
			} else {
				GeometryMath_F64.rotate(keyToCurr.c, keyToCurr.s, p.ground, p.ground);
			}
		}

		concatMotion();
	}
927277
@Override
	public void setReadPosition(long pointer) {
		final int bufferNum = (int) (pointer >>> this.segmentSizeBits);
		final int offset = (int) (pointer & segmentSizeMask);

		this.currentBufferNum = bufferNum;

		seekInput(this.partitionBuffers[bufferNum], offset,
				bufferNum < partitionBuffers.length - 1 ? segmentSize : finalBufferLimit);
	}
206476
public function setReadPreference($readPreference, array $tags = null)
    {
        if ($tags !== null) {
            $this->riakCursor->setReadPreference($readPreference, $tags);
        } else {
            $this->riakCursor->setReadPreference($readPreference);
        }

        $this->readPreference = $readPreference;
        $this->readPreferenceTags = $tags;

        return $this;
    }
733206
public void addViewerPreference(PdfName key, PdfObject value) {
    	useVp = true;
    	this.viewerPreferences.addViewerPreference(key, value);
    }
1331748
public function setReadPreference($readPreference, array $tags = null)
    {
        $this->cursor->setReadPreference($readPreference, $tags);
        $this->unitOfWorkHints[Query::HINT_READ_PREFERENCE] = $readPreference;
        $this->unitOfWorkHints[Query::HINT_READ_PREFERENCE_TAGS] = $tags;
        return $this;
    }
1369970
public void clearPref() {
        try {
            ((ClcJavaPreferenceStorage) modules.getPreferences()).getPref().clear();
        } catch (BackingStoreException e) {
            logger.error("Cannot clear preferences", e);
        }
    }
311718
int readReferenceOrNull (Input input, Class type, boolean mayBeNull) {
		if (type.isPrimitive()) type = getWrapperClass(type);
		boolean referencesSupported = referenceResolver.useReferences(type);
		int id;
		if (mayBeNull) {
			id = input.readVarInt(true);
			if (id == NULL) {
				if (TRACE || (DEBUG && depth == 1)) log("Read", null, input.position());
				readObject = null;
				return REF;
			}
			if (!referencesSupported) {
				readReferenceIds.add(NO_REF);
				return readReferenceIds.size;
			}
		} else {
			if (!referencesSupported) {
				readReferenceIds.add(NO_REF);
				return readReferenceIds.size;
			}
			id = input.readVarInt(true);
		}
		if (id == NOT_NULL) {
			if (TRACE) trace("kryo", "Read: <not null>" + pos(input.position()));
			// First time object has been encountered.
			id = referenceResolver.nextReadId(type);
			if (TRACE) trace("kryo", "Read initial reference " + id + ": " + className(type) + pos(input.position()));
			readReferenceIds.add(id);
			return readReferenceIds.size;
		}
		// The id is an object reference.
		id -= 2; // - 2 because 0 and 1 are used for NULL and NOT_NULL.
		readObject = referenceResolver.getReadObject(type, id);
		if (DEBUG) debug("kryo", "Read reference " + id + ": " + string(readObject) + pos(input.position()));
		return REF;
	}