initialValue is ignored if overwrite=TRUE
@hide draft / provisional / internal are hidden on Android
761369
private void fillBlock(int block, /*UChar32*/ int start, /*UChar32*/ int limit,
              int value, int initialValue, boolean overwrite) {
        int i;
        int pLimit = block+limit;
        if(overwrite) {
            for (i=block+start; i<pLimit; i++) {
                data[i] = value;
            }
        } else {
            for (i=block+start; i<pLimit; i++) {
                if(data[i]==initialValue) {
                    data[i]=value;
                }
            }
        }
    }
74201
public static void insertFromDevState(final DevState devStateValue,
	    final DeviceAttribute deviceAttributeWritten) throws DevFailed {

	final Integer integerValue = Integer.valueOf(devStateValue.value());
	switch (deviceAttributeWritten.getType()) {
	case TangoConst.Tango_DEV_SHORT:
	    deviceAttributeWritten.insert(integerValue.shortValue());
	    break;
	case TangoConst.Tango_DEV_USHORT:
	    deviceAttributeWritten.insert_us(integerValue.shortValue());
	    break;
	case TangoConst.Tango_DEV_CHAR:
	    Except.throw_exception("TANGO_WRONG_DATA_ERROR",
		    "input type Tango_DEV_CHAR not supported",
		    "AttributeHelper.insertFromDevState(DevState value,deviceAttributeWritten)");
	    break;
	case TangoConst.Tango_DEV_UCHAR:
	    deviceAttributeWritten.insert_uc(integerValue.shortValue());
	    break;
	case TangoConst.Tango_DEV_LONG:
	    deviceAttributeWritten.insert(integerValue.intValue());
	    break;
	case TangoConst.Tango_DEV_ULONG:
	    deviceAttributeWritten.insert_ul(integerValue.longValue());
	    break;
	case TangoConst.Tango_DEV_LONG64:
	    Except.throw_exception("TANGO_WRONG_DATA_ERROR",
		    "input type Tango_DEV_LONG64 not supported",
		    "AttributeHelper.insertFromDevState(DevState value,deviceAttributeWritten)");
	    break;
	case TangoConst.Tango_DEV_ULONG64:
	    deviceAttributeWritten.insert_u64(integerValue.longValue());
	    break;
	case TangoConst.Tango_DEV_INT:
	    deviceAttributeWritten.insert(integerValue.intValue());
	    break;
	case TangoConst.Tango_DEV_FLOAT:
	    deviceAttributeWritten.insert(integerValue.floatValue());
	    break;
	case TangoConst.Tango_DEV_DOUBLE:
	    deviceAttributeWritten.insert(integerValue.doubleValue());
	    break;
	case TangoConst.Tango_DEV_STRING:
	    deviceAttributeWritten.insert(integerValue.toString());
	    break;
	case TangoConst.Tango_DEV_BOOLEAN:
	    if (integerValue.doubleValue() == 1) {
		deviceAttributeWritten.insert(true);
	    } else {
		deviceAttributeWritten.insert(false);
	    }
	    break;
	case TangoConst.Tango_DEV_STATE:
	    deviceAttributeWritten.insert(devStateValue);
	    break;
	default:
	    Except.throw_exception("TANGO_WRONG_DATA_ERROR", "input type "
		    + deviceAttributeWritten.getType() + " not supported",
		    "AttributeHelper.insertFromDevState(DevState value,deviceAttributeWritten)");
	    break;
	}
    }
830842
private String getValue(FilterConfig filterConfig, String initParam, String variable) {
        final String value = filterConfig.getInitParameter(initParam);
        if (StringUtils.isNotBlank(value)) {
            return value;
        } else {
            return variable;
        }
    }
103349
void internalAddChange(String valuePath, String attributeName, int valueIndex, ChangeType changeType) {

        m_changeTimer = null;
        //TODO: keep the IDs, otherwise redo will not work
        CmsEntity currentData = m_entity.cloneEntity();
        if (!currentData.equals(m_current.getEntityData())) {
            m_undo.push(m_current);
            m_current = new Change(currentData, valuePath, attributeName, valueIndex, changeType);
            m_redo.clear();
            fireStateChange();
        }
    }
27745
@Override
	protected String initValuesImpl(final FieldCase ca) {
		if (ca == FieldCase.NULL || ca == FieldCase.BLANK) {
			return null;
		}
		return field.getString(control.getNext(ca));
	}
963270
public void reset(int initialValue) throws FetchException, PersistException {
        synchronized (mStoredSequence) {
            Transaction txn = mRepository.enterTopTransaction(null);
            txn.setForUpdate(true);
            try {
                boolean doUpdate = mStoredSequence.tryLoad();
                mStoredSequence.setInitialValue(initialValue);
                // Start as small as possible to allow signed long comparisons to work.
                mStoredSequence.setNextValue(Long.MIN_VALUE);
                if (doUpdate) {
                    mStoredSequence.update();
                } else {
                    mStoredSequence.insert();
                }
                txn.commit();
                mHasReservedValues = false;
            } finally {
                txn.exit();
            }
        }
    }
193665
@Override
    public int bulkInsert(Uri uri, ContentValues[] values) {
        int result = 0;

        if (!controller.hasPreinitialized()) {
            throw new IllegalStateException("Controller has not been initialized.");
        }

        int patternCode = controller.getUriMatcher().match(uri);
        MatcherPattern pattern = controller.findMatcherPattern(patternCode);
        if (pattern == null) {
            throw new IllegalArgumentException("unknown uri : " + uri.toString());
        }

        SQLiteDatabase db = this.getHelper().getWritableDatabase();

        db.beginTransaction();
        try {
            for (ContentValues value : values) {
                Parameter parameter = new Parameter(uri, value);

                Uri resultBulkInsert = this.onBulkInsert(this.getHelper(), db, pattern, parameter);
                if (resultBulkInsert != null) {
                    result++;
                    // this.getContext().getContentResolver().notifyChange(resultBulkInsert, null);
                }
            }
            db.setTransactionSuccessful();

            if (result >= 1) {
                this.onBulkInsertCompleted(result, uri);
            }
        } finally {
            db.endTransaction();
        }
        return result;
    }
329143
@Override
  Nullness visitArrayAccess(ArrayAccessNode node, SubNodeValues inputs, Updates updates) {
    setNonnullIfTrackable(updates, node.getArray());
    return hasPrimitiveType(node) ? NONNULL : defaultAssumption;
  }
356023
private boolean isInitialCall() {

        // return false in case the form was submitted already or the submit button was pressed or the index was changed
        return !(((getJsp().getRequest().getParameter(CmsDialog.PARAM_ACTION) != null)
            && (getJsp().getRequest().getParameter(CmsDialog.PARAM_ACTION).equals(
                CmsDialog.PARAM_ACTION_VALUE_FOR_CHANGED_INDEX)))
            || ((getJsp().getRequest().getParameter("indexName.0")) != null));
    }
593330
@Override
    public void markInitialState() {
        super.markInitialState();

        if (listeners != null) {
            listeners.markInitialState();
        }
        if (listenersByEventClass != null) {
            for (List<SystemEventListener> listener : listenersByEventClass.values()) {
                if (listener instanceof PartialStateHolder) {
                    ((PartialStateHolder) listener).markInitialState();
                }
            }
        }
        if (behaviors != null) {
            for (Entry<String, List<ClientBehavior>> entry : behaviors.entrySet()) {
                for (ClientBehavior behavior : entry.getValue()) {
                    if (behavior instanceof PartialStateHolder) {
                        ((PartialStateHolder) behavior).markInitialState();
                    }
                }
            }
        }
    }
825593
function (value, sendUpdatedEvt) {
		
			var i, length, choice, firstIndexAvailable, choiceFound = false;
		
			for (i = 0, length = this.choicesList.length; i < length ; i += 1) {
			
				if (this.choicesList[i].visible) {
				
					choice = this.choicesList[i];
				
					if (value === choice.value) {
					
						choice.node.selected = "selected";
						choiceFound = true;
						break; // choice node already found
					
					} else if (lang.isUndefined(firstIndexAvailable)) {
					
						firstIndexAvailable = i;
					}
				
				}
			
			}
			
			// select value from first choice available when
			// value not matching any visible choice
			//
			// if no choice available (-> firstIndexAvailable is undefined), skip value setting
			if (!choiceFound && !lang.isUndefined(firstIndexAvailable)) {
				
				choice = this.choicesList[firstIndexAvailable];
				choice.node.selected = "selected";
				value = choice.value;
				
			}
			
			// Call Field.setValue to set class and fire updated event
			inputEx.SelectField.superclass.setValue.call(this, value, sendUpdatedEvt);
		}
945380
private @Nullable CodeBlock initialValue(Field field) {
    if (field.isPacked() || field.isRepeated()) {
      return CodeBlock.of("$T.newMutableList()", Internal.class);
    } else if (field.type().isMap()) {
      return CodeBlock.of("$T.newMutableMap()", Internal.class);
    } else {
      return null;
    }
  }
913737
@Override
	public String initValues(final FieldCase ca) {
		boolean found = false;
		buffer.setLength(0);
		for (Constraint c : constraints) {
			String cV = c.initValues(ca);
			if (cV != null) {
				found = true;
				buffer.append(cV);
			}
		}
		if (found) {
			return buffer.toString();
		}
		return null;
	}
59197
@Override
  public String getValue() {
    String retVal = super.getValue();
    if (retVal == null && myHaveComponentParts) {

      if (determineLocalPrefix(myBaseUrl) != null && myResourceType == null && myUnqualifiedVersionId == null) {
        return myBaseUrl + myUnqualifiedId;
      }

      StringBuilder b = new StringBuilder();
      if (isNotBlank(myBaseUrl)) {
        b.append(myBaseUrl);
        if (myBaseUrl.charAt(myBaseUrl.length() - 1) != '/') {
          b.append('/');
        }
      }

      if (isNotBlank(myResourceType)) {
        b.append(myResourceType);
      }

      if (b.length() > 0 && isNotBlank(myUnqualifiedId)) {
        b.append('/');
      }

      if (isNotBlank(myUnqualifiedId)) {
        b.append(myUnqualifiedId);
      } else if (isNotBlank(myUnqualifiedVersionId)) {
        b.append('/');
      }

      if (isNotBlank(myUnqualifiedVersionId)) {
        b.append('/');
        b.append("_history");
        b.append('/');
        b.append(myUnqualifiedVersionId);
      }
      retVal = b.toString();
      super.setValue(retVal);
    }
    return retVal;
  }
383597
protected void valueChanged()
	{
		String newValue = fViewer.getDocument().get();
		if (!newValue.equals(fOldValue))
		{
			fOldValue = newValue;

		}
		refreshValidState();
	}
211186
@Deprecated
    @Override
    protected int writeValueAndType(boolean hasValue, int value, int node) {
        if(!hasValue) {
            return write(node);
        }
        int length;
        if(value<0 || value>CharsTrie.kMaxTwoUnitNodeValue) {
            intUnits[0]=(char)(CharsTrie.kThreeUnitNodeValueLead);
            intUnits[1]=(char)(value>>16);
            intUnits[2]=(char)value;
            length=3;
        } else if(value<=CharsTrie.kMaxOneUnitNodeValue) {
            intUnits[0]=(char)((value+1)<<6);
            length=1;
        } else {
            intUnits[0]=(char)(CharsTrie.kMinTwoUnitNodeValueLead+((value>>10)&0x7fc0));
            intUnits[1]=(char)value;
            length=2;
        }
        intUnits[0]|=(char)node;
        return write(intUnits, length);
    }
391041
@Override
    public boolean propagateValue(String destPath, String valueString, boolean tryToCreate, boolean allowOverwrite) {
        boolean ret = false;

        // wenn dieses de gemeint ist
        if (destPath.equals(getPath())) {
            if (this.value != null) { // es gibt schon einen Wert
                if (!allowOverwrite) { // überschreiben ist nicht erlaubt
                    throw new OverwriteException(getPath(), value.toString(), valueString);
                }
            }

            setValue(valueString);
            ret = true;
        }

        return ret;
    }