All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.google.common.truth.extensions.proto.AutoValue_DiffResult_RepeatedField Maven / Gradle / Ivy

The newest version!
package com.google.common.truth.extensions.proto;

import com.google.common.collect.ImmutableList;
import com.google.errorprone.annotations.concurrent.LazyInit;
import com.google.protobuf.Descriptors;
import java.lang.Iterable;
import java.lang.Object;
import java.lang.Override;
import java.lang.SuppressWarnings;

final class AutoValue_DiffResult_RepeatedField extends $AutoValue_DiffResult_RepeatedField {
  @LazyInit
  @SuppressWarnings("Immutable")
  private transient volatile Iterable childEntities;

  AutoValue_DiffResult_RepeatedField(Descriptors.FieldDescriptor fieldDescriptor,
      ImmutableList actual, ImmutableList expected,
      ImmutableList pairResults) {
    super(fieldDescriptor, actual, expected, pairResults);
  }

  @Override
  Iterable childEntities() {
    if (childEntities == null) {
      synchronized (this) {
        if (childEntities == null) {
          childEntities = super.childEntities();
          if (childEntities == null) {
            throw new NullPointerException("childEntities() cannot return null");
          }
        }
      }
    }
    return childEntities;
  }
}