Refines the accessed array to non-null after a successful array access.

<p>Note: If the array access occurs when the node is an l-value, the analysis won't call this
method. Instead, it will call {@link #visitAssignment}.
329143
@Override
  Nullness visitArrayAccess(ArrayAccessNode node, SubNodeValues inputs, Updates updates) {
    setNonnullIfTrackable(updates, node.getArray());
    return hasPrimitiveType(node) ? NONNULL : defaultAssumption;
  }
548942
public static Object removeReference(List l, Object o) {
    Iterator iter = l.iterator();
    while (iter.hasNext()) {
      Object no = iter.next();
      if (no == o) {
        iter.remove();
        return o;
      }
    }
    return null;
  }
660389
public Tree clear() {
		if (value != null) {
			if (isMap()) {

				((Map<?, ?>) value).clear();

			} else if (value instanceof Collection) {

				((Collection<?>) value).clear();

			} else if (isArray()) {

				setObjectInternal(new LinkedList<Object>());

			} else {

				setObjectInternal(null);

			}
		}
		return this;
	}
750490
@Override
    public void setArray(INDArray arr) {
        if (this.arr.get() == null)
            this.arr.set(arr);
    }
514336
@Override
    public void visitParameter(String name, int access) {
        if (parameters == null) {
            parameters = new ArrayList<ParameterNode>(5);
        }
        parameters.add(new ParameterNode(name, access));
    }
1362977
private void move1() {
        if (node == null)
            return;

        if (position >= reference.size()) {
            node = null;
            return;
        }

        node = node.links[reference.codeAt(position++)];
    }
559504
public void clear() {
        int n = mSize;
        Object[] values = mValues;

        for (int i = 0; i < n; i++) {
            values[i] = null;
        }

        mSize = 0;
        mGarbage = false;
    }
1156952
@SuppressWarnings("static-method")
	public Boolean findBooleanValue(JvmAnnotationReference reference) {
		assert reference != null;
		for (final JvmAnnotationValue value : reference.getValues()) {
			if (value instanceof JvmBooleanAnnotationValue) {
				for (final Boolean intValue : ((JvmBooleanAnnotationValue) value).getValues()) {
					if (intValue != null) {
						return intValue;
					}
				}
			}
		}
		return null;
	}
550905
public T get() {
        T object;

        while (true) {
            // 1. get the next free object
            int p = m_put.get();
            int g = m_get.get();
            if (g >= p) {
                // get index hits the put index, implying empty pool
                if (p >= LIMIT) {
                    // put pointer wrapped around. rewind both indexes.
                    m_get.set(0);
                    m_put.set(0);
                }
                return null;
            }

            // 2. conquer this cell by incrementing the get index
            if (!m_get.compareAndSet(g, g + 1)) {
                // some other thread got here first. try again.
                continue;
            }

            // 3. retrieve the object at the get index
            int index = g % m_arraySize;
            AtomicReference<T> reference = m_array[index];
            object = reference.get();
            if (object == null) {
                // getting here is rare. it happens when:
                // 1. put() is called on an empty pool (p==g)
                // 2. put() increments the put pointer (p==g+1)
                // 3. get() is called and finds g < p
                // 4. get() takes the object at g (which is null)
                // 5. put() puts the object at g
                continue;
            }

            // 4. change the reference to null so no other get() takes the
            // same element, and no other put() replaces it with another.
            if (reference.compareAndSet(object, null)) {
                return object;
            }

            // getting here is rare. the object that was supposedly conquered
            // locally was either replaced by a different object or replaced
            // with null, in the same cell.
        }
    }
134928
protected boolean updateAssignment(DBIDIter iditer, List<? extends ModifiableDBIDs> clusters, WritableIntegerDataStore assignment, int newA) {
    final int oldA = assignment.intValue(iditer);
    if(oldA == newA) {
      return false;
    }
    clusters.get(newA).add(iditer);
    assignment.putInt(iditer, newA);
    if(oldA >= 0) {
      clusters.get(oldA).remove(iditer);
    }
    return true;
  }
227137
public final void expurgeQueuedReferences() {
		Reference<? extends V> reference;
		while ((reference = this.queue.poll()) != null) {
			if (reference instanceof ReferencableValue<?, ?>) {
				this.map.remove(((ReferencableValue<?, ?>) reference).getKey());
			}
			reference.clear();
		}
	}
1345895
public boolean nextIsNull(long currentRow) throws IOException {
    if (present != null) {
      seekToPresentRow(currentRow);
      valuePresent = present.next() == 1;
      if (valuePresent) {
        // Adjust numNonNulls so we know how many non-null values we'll need to skip if skip is
        // called
        numNonNulls++;
      } else {
        if (currentRow == previousRow + 1) {
          // if currentRow = previousRow + 1, and the value is null this is equivalent to going to the
          // next row.  if there's a series of nulls this prevents us from calling skipRows when
          // the next non-null value is fetched
          previousRow++;
        }
      }
    }

    return !valuePresent;
  }
922662
@Override
    public void visit(NodeVisitor v) {
        if (v.visit(this) && value != null) {
            value.visit(v);
        }
    }
907857
private NullSafeAccumulator visitNullSafeNode(ExprNode node) {
    switch (node.getKind()) {
      case FIELD_ACCESS_NODE:
        {
          FieldAccessNode fieldAccess = (FieldAccessNode) node;
          NullSafeAccumulator base = visitNullSafeNode(fieldAccess.getBaseExprChild());
          FieldAccess access =
              genCodeForFieldAccess(
                  fieldAccess.getBaseExprChild().getType(),
                  fieldAccess,
                  fieldAccess.getFieldName());
          return base.dotAccess(access, fieldAccess.isNullSafe());
        }

      case ITEM_ACCESS_NODE:
        {
          ItemAccessNode itemAccess = (ItemAccessNode) node;
          NullSafeAccumulator base = visitNullSafeNode(itemAccess.getBaseExprChild());
          ExprNode keyNode = itemAccess.getKeyExprChild();
          SoyType baseType = itemAccess.getBaseExprChild().getType();
          return SoyTypes.isKindOrUnionOfKind(SoyTypes.removeNull(baseType), Kind.MAP)
              ? base.mapGetAccess(genMapKeyCode(keyNode), itemAccess.isNullSafe()) // soy.Map
              : base.bracketAccess(
                  // The key type may not match JsCompiler's type system (passing number as enum, or
                  // nullable proto field).  I could instead cast this to the map's key type.
                  visit(keyNode).castAs("?"), itemAccess.isNullSafe()); // vanilla bracket access
        }

      default:
        return new NullSafeAccumulator(visit(node));
    }
  }
786316
private void visit(final ObjectGraphNode currentNode) {
		Object currentValue = currentNode.getValue();

		if (currentValue == null
				|| (currentValue instanceof java.lang.ref.SoftReference)
				|| currentNode.isPrimitive() || currentNode.isSimpleType()) {
			return;
		}

		if (isObjectVisited(currentNode)) {
			ObjectGraphNode ref = visitedNodes.get(currentValue);
			currentNode.setRefNode(ref);
			return;
		}

		markObjectVisited(currentNode);

		if (currentValue instanceof List) {
			// ArrayList's elementData is marked transient, and others may be as well, so we have to do this ourselves.
			visitList(currentNode);
		} else if (currentValue instanceof Map) {
			// HashMap's table is marked transient, and others may be as well, so we have to do this ourselves.
			visitMap(currentNode);
		} else if (currentValue instanceof ComponentModel) {
			// Special case for ComponentModel, so we can figure out if any fields are overridden
			visitComponentModel(currentNode);
		} else if (currentValue instanceof Field) {
			visitComplexType(currentNode);
			summariseNode(currentNode);
		} else if (currentValue.getClass().isArray()) {
			visitArray(currentNode);
		} else {
			visitComplexType(currentNode);
		}
	}
401953
@Override
  protected Expression visitNullCoalescingOpNode(NullCoalescingOpNode node) {
    List<Expression> operands = visitChildren(node);
    Expression consequent = operands.get(0);
    Expression alternate = operands.get(1);
    // if the consequent isn't trivial we should store the intermediate result in a new temporary
    if (!consequent.isCheap()) {
      consequent = codeGenerator.declarationBuilder().setRhs(consequent).build().ref();
    }
    return Expression.ifExpression(consequent.doubleNotEquals(Expression.LITERAL_NULL), consequent)
        .setElse(alternate)
        .build(codeGenerator);
  }
405913
private Node inlineReturnValue(Reference ref, Node fnNode) {
    Node callNode = ref.callNode;
    Node block = fnNode.getLastChild();
    Node callParentNode = callNode.getParent();

    // NOTE: As the normalize pass guarantees globals aren't being
    // shadowed and an expression can't introduce new names, there is
    // no need to check for conflicts.

    // Create an argName -> expression map, checking for side effects.
    Map<String, Node> argMap =
        FunctionArgumentInjector.getFunctionCallParameterMap(
            fnNode, callNode, this.safeNameIdSupplier);

    Node newExpression;
    if (!block.hasChildren()) {
      Node srcLocation = block;
      newExpression = NodeUtil.newUndefinedNode(srcLocation);
    } else {
      Node returnNode = block.getFirstChild();
      checkArgument(returnNode.isReturn(), returnNode);

      // Clone the return node first.
      Node safeReturnNode = returnNode.cloneTree();
      Node inlineResult = FunctionArgumentInjector.inject(
          null, safeReturnNode, null, argMap);
      checkArgument(safeReturnNode == inlineResult);
      newExpression = safeReturnNode.removeFirstChild();
      NodeUtil.markNewScopesChanged(newExpression, compiler);
    }

    // If the call site had a cast ensure it's persisted to the new expression that replaces it.
    JSType typeBeforeCast = callNode.getJSTypeBeforeCast();
    if (typeBeforeCast != null) {
      newExpression.setJSTypeBeforeCast(typeBeforeCast);
      newExpression.setJSType(callNode.getJSType());
    }
    callParentNode.replaceChild(callNode, newExpression);
    NodeUtil.markFunctionsDeleted(callNode, compiler);
    return newExpression;
  }