import static java.util.Objects.requireNonNull;
import com.google.common.base.VerifyException;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.VarHandle;
import org.eclipse.jdt.annotation.NonNull;
// Accessed via a VarHandle
@SuppressWarnings("unused")
// FIXME: consider using a primitive int-based cache (with 0 being uninit)
+ @SuppressFBWarnings(value = "UUF_UNUSED_FIELD", justification = "https://github.com/spotbugs/spotbugs/issues/2749")
private volatile Integer cachedHashcode;
protected CodecDataObject(final AbstractDataObjectCodecContext<T, ?> context, final DataContainerNode data) {
private @NonNull Object emptyObject(final @NonNull Class<? extends DataObject> bindingClass) {
final var childContext = context.getStreamChild(bindingClass);
- if (childContext instanceof NonPresenceContainerNodeCodecContext<?> nonPresence) {
- return nonPresence.emptyObject();
+ if (childContext instanceof StructuralContainerCodecContext<?> structural) {
+ return structural.emptyObject();
}
throw new VerifyException("Unexpected context " + childContext);
}
if (!(data instanceof MapEntryNode mapEntry)) {
throw new VerifyException("Unsupported value " + data);
}
- if (!(context instanceof KeyedListNodeCodecContext<?, ?> listContext)) {
+ if (!(context instanceof MapCodecContext<?, ?> listContext)) {
throw new VerifyException("Unexpected context " + context);
}