diff --git a/api/src/main/java/org/apache/iceberg/types/Types.java b/api/src/main/java/org/apache/iceberg/types/Types.java index 88d1244fe6..82c1ce7e95 100644 --- a/api/src/main/java/org/apache/iceberg/types/Types.java +++ b/api/src/main/java/org/apache/iceberg/types/Types.java @@ -20,7 +20,6 @@ package org.apache.iceberg.types; import java.io.Serializable; -import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Locale; @@ -457,7 +456,7 @@ private static void validateDefaultValue(Object defaultValue, Type type) { } switch (type.typeId()) { case STRUCT: - Preconditions.checkArgument(Map.class.isInstance(defaultValue), + Preconditions.checkArgument(defaultValue instanceof Map, "defaultValue should be a Map from fields names to values, for StructType"); Map defaultStruct = (Map) defaultValue; if (defaultStruct.isEmpty()) { @@ -470,17 +469,17 @@ private static void validateDefaultValue(Object defaultValue, Type type) { break; case LIST: - Preconditions.checkArgument(defaultValue instanceof ArrayList, - "defaultValue should be an ArrayList of Objects, for ListType"); - List defaultArrayList = (ArrayList) defaultValue; - if (defaultArrayList.size() == 0) { + Preconditions.checkArgument(defaultValue instanceof List, + "defaultValue should be an List of Objects, for ListType"); + List defaultList = (List) defaultValue; + if (defaultList.size() == 0) { return; } - defaultArrayList.forEach(dv -> NestedField.validateDefaultValue(dv, type.asListType().elementField.type)); + defaultList.forEach(dv -> NestedField.validateDefaultValue(dv, type.asListType().elementField.type)); break; case MAP: - Preconditions.checkArgument(Map.class.isInstance(defaultValue), + Preconditions.checkArgument(defaultValue instanceof Map, "defaultValue should be an instance of Map for MapType"); Map defaultMap = (Map) defaultValue; if (defaultMap.isEmpty()) { @@ -494,7 +493,7 @@ private static void validateDefaultValue(Object defaultValue, Type type) { case FIXED: case BINARY: - Preconditions.checkArgument(byte[].class.isInstance(defaultValue), + Preconditions.checkArgument(defaultValue instanceof byte[], "defaultValue should be an instance of byte[] for TypeId.%s, but defaultValue.class = %s", type.typeId().name(), defaultValue.getClass().getCanonicalName()); break; diff --git a/build.gradle b/build.gradle index 372b4da9cd..0d34ecedc6 100644 --- a/build.gradle +++ b/build.gradle @@ -23,7 +23,6 @@ buildscript { repositories { jcenter() gradlePluginPortal() - maven { url "http://palantir.bintray.com/releases" } maven { url "https://plugins.gradle.org/m2/" } } dependencies { @@ -64,7 +63,6 @@ allprojects { group = "org.apache.iceberg" version = getProjectVersion() repositories { - maven { url "http://palantir.bintray.com/releases" } mavenCentral() mavenLocal() }