diff --git a/oak-store-spi/src/main/java/org/apache/jackrabbit/oak/plugins/memory/EmptyPropertyState.java b/oak-store-spi/src/main/java/org/apache/jackrabbit/oak/plugins/memory/EmptyPropertyState.java index fd1b98e..ed73268 100644 --- a/oak-store-spi/src/main/java/org/apache/jackrabbit/oak/plugins/memory/EmptyPropertyState.java +++ b/oak-store-spi/src/main/java/org/apache/jackrabbit/oak/plugins/memory/EmptyPropertyState.java @@ -26,6 +26,7 @@ import org.jetbrains.annotations.NotNull; import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkNotNull; +import static com.google.common.base.Preconditions.checkState; /** * Abstract base class for {@link PropertyState} implementations @@ -78,13 +79,13 @@ public abstract class EmptyPropertyState extends AbstractPropertyState { /** * @return An empty list if {@code type.isArray()} is {@code true}. - * @throws IllegalArgumentException {@code type.isArray()} is {@code false}. + * @throws IllegalStateException {@code type.isArray()} is {@code false}. */ @SuppressWarnings("unchecked") @NotNull @Override public T getValue(Type type) { - checkArgument(type.isArray(), "Type must be an array type"); + checkState(type.isArray(), "Type must be an array type"); return (T) Collections.emptyList(); } diff --git a/oak-store-spi/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiPropertyState.java b/oak-store-spi/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiPropertyState.java index 75e4047..6750442 100644 --- a/oak-store-spi/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiPropertyState.java +++ b/oak-store-spi/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiPropertyState.java @@ -19,6 +19,7 @@ package org.apache.jackrabbit.oak.plugins.memory; import static com.google.common.base.Preconditions.checkArgument; +import static com.google.common.base.Preconditions.checkState; import java.math.BigDecimal; import java.util.List; @@ -149,14 +150,15 @@ abstract class MultiPropertyState extends EmptyPropertyState { } /** + * @throws IllegalStateException if {@code type.isArray()} is {@code false}. * @throws IllegalArgumentException if {@code type} is not one of the - * values defined in {@link Type} or if {@code type.isArray()} is {@code false}. + * values defined in {@link Type} */ @SuppressWarnings("unchecked") @NotNull @Override public S getValue(Type type) { - checkArgument(type.isArray(), "Type must be an array type"); + checkState(type.isArray(), "Type must be an array type"); if (getType() == type) { return (S) values; }