NULL safe indexOf()
347410
public static int indexOf(List<?> data, Object entry) {
        return data == null ? -1 : data.indexOf(entry);
    }
65241
@SuppressWarnings("unchecked")
	private <T> T nullFor(DataType dataType)
	{
		switch(dataType)
		{
			case Long: return (T)Long.valueOf(-1);
			default: return null;
		}
	}
71763
@Override
    public Object getValue(@NonNull String key) {
        if (key == null) { throw new IllegalArgumentException("key cannot be null."); }

        final int index = indexForColumnName(key);
        return index >= 0 ? getValue(index) : null;
    }
220034
function indexOf(list, element, comparator) {
			for (var i=0,item; item=list[i]; i++) {
				if (equals(item, element, comparator)) {
					return i;
				}
			}
			return -1;
		}
1169529
private static int  js_indexOf(int methodId, String target, Object[] args) {
        String searchStr = ScriptRuntime.toString(args, 0);
        double position = ScriptRuntime.toInteger(args, 1);

        if (position > target.length() && methodId != Id_startsWith && methodId != Id_endsWith) {
            return -1;
        }

        if (position < 0) position = 0;
        else if (position > target.length()) position = target.length();
        else if (methodId == Id_endsWith && (position != position  || position > target.length())) position = target.length();

        if (Id_endsWith == methodId) {
            if (args.length == 0 || args.length == 1 || (args.length == 2 && args[1] == Undefined.instance)) position = target.length();
            return target.substring(0, (int)position).endsWith(searchStr) ? 0 : -1;
        }
        return methodId == Id_startsWith
                ? target.startsWith(searchStr, (int)position) ? 0 : -1
                : target.indexOf(searchStr, (int)position);
    }
293004
public int indexOf(Object obj) {
        if (obj instanceof JavascriptObject) {
            return checkInteger(invokeJavascript("indexOf", ((JavascriptObject) obj).getJSObject()), -1);
        }
        return checkInteger(invokeJavascript("indexOf", obj), -1);
    }
1360941
function indexOf(srcArr, predicate) {
      for (var i = 0; i < srcArr.length; i++) {
        if (isObj(predicate)) {
          if (keys(predicate).every(
            function (k) { return srcArr[i][k] === predicate[k]; })
          ) return i;
        } else if (isFun(predicate)) {
          if (predicate(srcArr[i])) return i;
        }
      }
      return srcArr.indexOf(predicate);
    }
380318
@Override
    public String getString(int index) {
        synchronized (lock) {
            final Object obj = getMValue(internalArray, index).asNative(internalArray);
            return obj instanceof String ? (String) obj : null;
        }
    }
1260164
function fillArrayWithNull( arr, toIndex ) {
   for( let i = arr.length; i < toIndex; ++i ) {
      arr[ i ] = null;
   }
}
720417
@SuppressWarnings("unchecked")
  public static Object getElement(Object iterable, int index) {
    if (iterable.getClass().isArray())
      return getElementFromArrary(iterable, index);
    if (iterable instanceof Collection)
      return getElementFromCollection((Collection<Object>) iterable, index);

    return null;
  }
751297
public static int indexOf(String[] arr, String value) {
	for (int i = 0; i < arr.length; i++) {
	    if (arr[i].equals(value)) return i;
	}
	return -1;
    }
710116
protected int indexOf(final Object o) {
        final int size = dataModel.getSize();
        for (int i = 0; i < size; i++) {
            if (comparator == null) {
                if (o.equals(dataModel.getElementAt(i))) {
                    return i;
                }
            } else if (comparator.compare(o, dataModel.getElementAt(i)) == 0) {
                return i;
            }
        }

        return -1;
    }
376441
@SuppressWarnings({"unchecked", "SuspiciousSystemArraycopy"})
    private static void setIndexedValue(Object obj, Property property, int index, Object value, ObjectWrapper options) {
        if (property == null) {
            throw new IllegalArgumentException("Cannot set a new indexed value to a 'null' property.");
        }

        Object propertyValue = property.get(obj);

        if (propertyValue == null) {
            if (options.isAutoInstancing) {
                Class<?> propertyType = property.getType();

                if (propertyType.isAssignableFrom(List.class)) {
                    propertyValue = new ArrayList();
                    property.set(obj, propertyValue);
                } else if (propertyType.isArray()) {
                    propertyValue = Array.newInstance(property.getActualType(), index + 1);
                    property.set(obj, propertyValue);
                } else {
                    throw new IllegalArgumentException("The indexed " + property + " in object "
                                                               + obj.getClass().getSimpleName() + " has value 'null'. Only List and array types can be " +
                                                               "auto instantiated, but " + propertyType.getSimpleName() + " found.");
                }
            } else {
                throw new NullPointerException("Invalid 'null' value found for the indexed '" + property + "' in "
                                                       + obj.getClass().getName() + " object.");
            }
        }

        if (propertyValue instanceof List) {
            List list = (List) propertyValue;
            int size = list.size();

            if (index >= size && options.isAutoGrowing) {
                for (int i = size; i < index; i++) {
                    try {
                        list.add(null);
                    } catch (NullPointerException ex) {
                        throw new NullPointerException("The indexed " + property + " has size lower than the requested '"
                                                               + index + "' index. An attempt to autogrowing it, filling with 'null' values, was made, " +
                                                               " but the List implementation seems to do not accept 'null' values. " + ex.getMessage());
                    }
                }

                list.add(index, value);
            } else {
                try {
                    list.set(index, value);
                } catch (IndexOutOfBoundsException e) {
                    throw new IndexOutOfBoundsException("Cannot set a new value to the indexed list " + property + " in "
                                                                + obj.getClass().getSimpleName() + " as the requested '" + index + "' index is unbound.");
                }
            }
        } else if (propertyValue.getClass().isArray()) {
            int length = Array.getLength(propertyValue);

            if (index >= length && options.isAutoGrowing) {
                Object biggerArray = Array.newInstance(property.getActualType(), index + 1);
                System.arraycopy(propertyValue, 0, biggerArray, 0, length);
                property.set(obj, biggerArray);
                propertyValue = biggerArray;
            }

            try {
                Array.set(propertyValue, index, value);
            } catch (ArrayIndexOutOfBoundsException e) {
                throw new IndexOutOfBoundsException("Cannot set a new value to the indexed array " + property
                                                            + " in " + obj.getClass().getSimpleName() + " as the requested '" + index + "' index is unbound.");
            }
        } else {
            throw new IllegalArgumentException("Cannot set a new value to a not indexed " + property + ". Only List and array " +
                                                       "types are supported, but " + propertyValue.getClass().getName() + " found.");
        }
    }
1157685
function indexOf(list, item) {
  if (NATIVE_ARRAY_INDEXOF) {
    return NATIVE_ARRAY_INDEXOF.call(list, item);
  }

  for (var i = 0; i < list.length; i++) {
    if (list[i] === item) {
      return i;
    }
  }

  return -1;
}
478397
public int indexOf( T obj ) {
		for (int i = 0; i < size; i++) {
			if( data[i].equals(obj) ) {
				return i;
			}
		}
		return -1;
	}
1143974
private static int getIndexOfPair(String value, Map<Integer, String> row_data) {
        for(Integer i : row_data.keySet()) {
            if(row_data.get(i).equals(value)) {
                return i.intValue();
            }
        } 
        return -1;
    }
1127759
function(rowIndex) {
        if (typeof rowIndex !== 'undefined') {
            if ($.isArray(rowIndex)) {
                var result = [],
                    self = this;
                $.each(rowIndex, function(index, value) {
                    var item = self.options.data[value - 1];
                    if (item) {
                        result.push(item);
                    }
                });
                return result.length !== 0 ? result : null;
            } else {
                return this.options.data[rowIndex - 1] || null;
            }
        } else {
            return this.options.data;
        }
    }