You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iceberg.apache.org by bl...@apache.org on 2019/04/03 16:12:32 UTC
[incubator-iceberg] branch master updated: Applies the Baseline
plugin for iceberg-api only. (#143)
This is an automated email from the ASF dual-hosted git repository.
blue pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-iceberg.git
The following commit(s) were added to refs/heads/master by this push:
new 439a20d Applies the Baseline plugin for iceberg-api only. (#143)
439a20d is described below
commit 439a20d077f1746564f2e203e5904cd314ea8550
Author: mccheah <mc...@palantir.com>
AuthorDate: Wed Apr 3 09:12:28 2019 -0700
Applies the Baseline plugin for iceberg-api only. (#143)
---
.baseline/checkstyle/.checkstyle.xml.swp | Bin 0 -> 45056 bytes
.baseline/checkstyle/checkstyle-suppressions.xml | 29 ++
.baseline/checkstyle/checkstyle.xml | 444 +++++++++++++++++++
.baseline/copyright/001_apache-2.0.txt | 11 +
.baseline/eclipse/dynamic/dotfile.checkstyle | 23 +
.baseline/eclipse/org.eclipse.jdt.core.prefs | 313 ++++++++++++++
.../dotfile.settings/org.eclipse.jdt.ui.prefs | 66 +++
.baseline/idea/intellij-java-palantir-style.xml | 471 +++++++++++++++++++++
.../main/java/org/apache/iceberg/FileFormat.java | 4 +-
api/src/main/java/org/apache/iceberg/Files.java | 12 +-
.../java/org/apache/iceberg/PartitionField.java | 6 +-
.../java/org/apache/iceberg/PartitionSpec.java | 17 +-
.../main/java/org/apache/iceberg/RewriteFiles.java | 16 +-
.../main/java/org/apache/iceberg/TableScan.java | 14 +-
.../main/java/org/apache/iceberg/UpdateSchema.java | 14 +-
.../iceberg/exceptions/RuntimeIOException.java | 8 +-
.../apache/iceberg/expressions/BoundReference.java | 6 +-
.../org/apache/iceberg/expressions/Expression.java | 2 +
.../iceberg/expressions/ExpressionVisitors.java | 3 +
.../org/apache/iceberg/expressions/Literals.java | 4 +-
.../apache/iceberg/expressions/NamedReference.java | 2 +-
.../apache/iceberg/expressions/Projections.java | 18 +-
.../iceberg/expressions/ResidualEvaluator.java | 4 +-
.../iceberg/expressions/SerializationProxies.java | 12 +-
.../java/org/apache/iceberg/io/CloseableGroup.java | 6 +-
.../java/org/apache/iceberg/transforms/Bucket.java | 77 ++--
.../java/org/apache/iceberg/transforms/Dates.java | 8 +-
.../org/apache/iceberg/transforms/Identity.java | 4 +-
.../apache/iceberg/transforms/ProjectionUtil.java | 3 +
.../org/apache/iceberg/transforms/Timestamps.java | 8 +-
.../apache/iceberg/transforms/TransformUtil.java | 7 +-
.../org/apache/iceberg/transforms/Transforms.java | 12 +-
.../org/apache/iceberg/transforms/Truncate.java | 60 +--
.../apache/iceberg/types/CheckCompatibility.java | 4 +-
.../java/org/apache/iceberg/types/Comparators.java | 5 +-
.../java/org/apache/iceberg/types/Conversions.java | 15 +-
.../java/org/apache/iceberg/types/IndexById.java | 9 +-
.../java/org/apache/iceberg/types/IndexByName.java | 4 +-
.../org/apache/iceberg/types/PruneColumns.java | 2 +-
.../java/org/apache/iceberg/types/ReassignIds.java | 8 +-
.../java/org/apache/iceberg/types/TypeUtil.java | 35 +-
.../main/java/org/apache/iceberg/types/Types.java | 23 +-
.../test/java/org/apache/iceberg/TestHelpers.java | 5 +-
.../org/apache/iceberg/events/TestListeners.java | 9 +-
.../apache/iceberg/expressions/TestEvaluatior.java | 9 +-
.../expressions/TestExpressionSerialization.java | 21 +-
.../expressions/TestMiscLiteralConversions.java | 18 +-
.../iceberg/expressions/TestPredicateBinding.java | 2 +-
.../apache/iceberg/transforms/TestBucketing.java | 18 +-
.../apache/iceberg/transforms/TestIdentity.java | 12 +-
.../apache/iceberg/transforms/TestProjection.java | 17 +-
.../iceberg/types/TestReadabilityChecks.java | 65 ++-
build.gradle | 23 +-
.../java/org/apache/iceberg/avro/TypeToSchema.java | 2 +-
gradle/wrapper/gradle-wrapper.properties | 2 +-
55 files changed, 1698 insertions(+), 294 deletions(-)
diff --git a/.baseline/checkstyle/.checkstyle.xml.swp b/.baseline/checkstyle/.checkstyle.xml.swp
new file mode 100644
index 0000000..dac6cf2
Binary files /dev/null and b/.baseline/checkstyle/.checkstyle.xml.swp differ
diff --git a/.baseline/checkstyle/checkstyle-suppressions.xml b/.baseline/checkstyle/checkstyle-suppressions.xml
new file mode 100644
index 0000000..c0f855b
--- /dev/null
+++ b/.baseline/checkstyle/checkstyle-suppressions.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0"?>
+<!DOCTYPE suppressions PUBLIC
+ "-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN"
+ "https://checkstyle.org/dtds/suppressions_1_2.dtd">
+
+<!-- IMPORTANT ECLIPSE NOTE: If you change this file, you must restart Eclipse
+ for your changes to take effect in its Checkstyle integration. -->
+<suppressions>
+ <!-- Suppress test classes -->
+ <suppress files="[/\\]src[/\\].*[Tt]est[/\\](java|groovy)[/\\]" checks="Javadoc*" />
+ <suppress files="[/\\]src[/\\].*[Tt]est[/\\](java|groovy)[/\\]" checks="VariableDeclarationUsageDistance" />
+ <suppress files="[/\\]src[/\\].*[Tt]est[/\\](java|groovy)[/\\]" checks="VisibilityModifier" />
+ <suppress files="[/\\]src[/\\].*[Tt]est[/\\](java|groovy)[/\\]" checks="AvoidStaticImport" />
+ <suppress files="[/\\]src[/\\].*[Tt]est[/\\](java|groovy)[/\\]" id="BanSystemOut" />
+ <suppress files="[/\\]src[/\\].*[Tt]est[/\\](java|groovy)[/\\]" id="BanSystemErr" />
+
+ <!-- Suppress test resources -->
+ <suppress files="[/\\]src[/\\]test[/\\]resources.*" checks="." />
+
+ <!-- JavadocStyle enforces existence of package-info.java package-level Javadoc; we consider this a bug. -->
+ <suppress files="package-info.java" checks="JavadocStyle" />
+
+ <!-- non-code classes -->
+ <suppress files="\.(bdr|eot|gif|gzip|jar|json|otf|png|svg|ttf|woff|zip)$" checks="FileTabCharacter" />
+ <suppress files="\.(bdr|eot|gif|gzip|jar|json|otf|png|svg|ttf|woff|zip)$" checks="NewlineAtEndOfFile" />
+
+ <!-- Generated code should not be subjected to checkstyle. -->
+ <suppress files="[/\\].*[/\\]generated.*[/\\]" checks="." />
+</suppressions>
diff --git a/.baseline/checkstyle/checkstyle.xml b/.baseline/checkstyle/checkstyle.xml
new file mode 100644
index 0000000..02afe92
--- /dev/null
+++ b/.baseline/checkstyle/checkstyle.xml
@@ -0,0 +1,444 @@
+<?xml version="1.0"?>
+<!DOCTYPE module PUBLIC
+ "-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
+ "https://checkstyle.org/dtds/configuration_1_3.dtd">
+
+<module name="Checker">
+ <property name="charset" value="UTF-8"/>
+ <property name="severity" value="error"/>
+
+ <module name="FileTabCharacter"/> <!-- Java Style Guide: Whitespace characters -->
+ <module name="NewlineAtEndOfFile"> <!-- Java Style Guide: Line ending: LF -->
+ <property name="lineSeparator" value="lf"/>
+ </module>
+ <module name="RegexpHeader">
+ <property name="header" value="^/\*$\n^ \* Licensed to the Apache Software Foundation \(ASF\) under one$"/>
+ <property name="fileExtensions" value=".java,.ts"/>
+ </module>
+ <module name="RegexpMultiline"> <!-- Development Practices: Writing good unit tests -->
+ <property name="fileExtensions" value="java"/>
+ <property name="format" value="@VisibleForTesting\s+(protected|public)"/>
+ <property name="message" value="@VisibleForTesting members should be package-private."/>
+ </module>
+ <module name="RegexpSingleline"> <!-- No reference needed as this is evident. -->
+ <property name="format" value="<<<<<<<"/>
+ <property name="message" value="Found (<<<<<<<), so it looks like you had a merge conflict that compiles. Please fix it."/>
+ </module>
+ <module name="RegexpSingleline"> <!-- No reference needed as this is evident. -->
+ <property name="format" value=">>>>>>>"/>
+ <property name="message" value="Found (>>>>>>>), so it looks like you had a merge conflict that compiles. Please fix it."/>
+ </module>
+ <module name="RegexpSingleline">
+ <property name="format" value="\s+$"/>
+ <property name="message" value="Whitespace at end-of-line"/>
+ </module>
+ <module name="RegexpMultiline"> <!-- Java Style Guide: Vertical Whitespace -->
+ <property name="fileExtensions" value="java"/>
+ <property name="format" value="^\n\n$"/>
+ <property name="message" value="Two consecutive blank lines are not permitted."/>
+ </module>
+ <module name="SuppressionFilter"> <!-- baseline-gradle: README.md -->
+ <property name="file" value="${config_loc}/checkstyle-suppressions.xml"/>
+ </module>
+ <module name="SuppressionFilter"> <!-- baseline-gradle: README.md -->
+ <!-- custom-suppressions.xml allows users to specify suppresions that will not be overriden by baselineUpdateConfig -->
+ <property name="file" value="${config_loc}/custom-suppressions.xml"/>
+ <property name="optional" value="true"/>
+ </module>
+ <module name="SuppressWarningsFilter"/> <!-- baseline-gradle: README.md -->
+ <module name="TreeWalker">
+ <module name="SuppressionCommentFilter"/> <!-- baseline-gradle: README.md -->
+ <module name="SuppressionCommentFilter">
+ <property name="offCommentFormat" value="CHECKSTYLE.OFF\: ([\w\|]+)"/>
+ <property name="onCommentFormat" value="CHECKSTYLE.ON\: ([\w\|]+)"/>
+ <property name="checkFormat" value="$1"/>
+ </module>
+ <module name="AbbreviationAsWordInName"> <!-- Java Style Guide: Camel case : defined -->
+ <property name="ignoreFinal" value="false"/>
+ <property name="allowedAbbreviationLength" value="1"/>
+ <property name="allowedAbbreviations" value="ID,UUID,UTC,IO"/>
+ </module>
+ <module name="AnnotationLocation"> <!-- Java Style Guide: Annotations -->
+ <property name="tokens" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF"/>
+ </module>
+ <module name="AnnotationLocation"> <!-- Java Style Guide: Annotations -->
+ <property name="tokens" value="VARIABLE_DEF"/>
+ <property name="allowSamelineMultipleAnnotations" value="true"/>
+ </module>
+ <module name="AnnotationUseStyle"/> <!-- Java Style Guide: Annotations -->
+ <module name="ArrayTypeStyle"/> <!-- Java Style Guide: No C-style array declarations -->
+ <module name="AvoidEscapedUnicodeCharacters"> <!-- Java Style Guide: Non-ASCII characters -->
+ <property name="allowEscapesForControlCharacters" value="true"/>
+ <property name="allowByTailComment" value="true"/>
+ <property name="allowNonPrintableEscapes" value="true"/>
+ </module>
+ <module name="AvoidNestedBlocks"> <!-- Java Coding Guidelines: Avoid nested blocks -->
+ <property name="allowInSwitchCase" value="true"/>
+ </module>
+ <module name="AvoidStarImport"/> <!-- Java Style Guide: No wildcard imports -->
+ <module name="AvoidStaticImport"> <!-- Java Style Guide: No static imports -->
+ <property name="excludes" value="
+ java.util.Collections.*,
+ java.util.stream.Collectors.*,
+ com.palantir.logsafe.Preconditions.*,
+ com.google.common.base.Preconditions.*,
+ org.apache.commons.lang3.Validate.*,
+ org.apache.iceberg.expressions.Expressions.*,
+ org.apache.iceberg.expressions.Expression.Operation.*,
+ org.apache.parquet.schema.OriginalType.*,
+ org.apache.parquet.schema.PrimitiveType.PrimitiveTypeName.*,
+ org.apache.iceberg.types.Types.NestedField.*,
+ org.apache.iceberg.TableProperties.*,
+ org.apache.iceberg.types.Type.*,
+ org.junit.Assert.*"/>
+ </module>
+ <module name="ClassTypeParameterName"> <!-- Java Style Guide: Type variable names -->
+ <property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
+ <message key="name.invalidPattern" value="Class type name ''{0}'' must match pattern ''{1}''."/>
+ </module>
+ <module name="CovariantEquals"/> <!-- Java Coding Guidelines: Override ``Object#equals`` consistently -->
+ <module name="DefaultComesLast"/> <!-- Java Style Guide: The default case is present -->
+ <module name="EmptyBlock"> <!-- Java Style Guide: Empty blocks: documented -->
+ <property name="option" value="TEXT"/>
+ </module>
+ <module name="EmptyCatchBlock"> <!-- Java Style Guide: Empty blocks: documented -->
+ <property name="exceptionVariableName" value="expected"/>
+ </module>
+ <module name="EmptyForInitializerPad"/> <!-- Java Style Guide: Horizontal whitespace -->
+ <module name="EmptyLineSeparator"> <!-- Java Style Guide: Source file structure -->
+ <property name="tokens" value="IMPORT, CLASS_DEF, ENUM_DEF, INTERFACE_DEF, CTOR_DEF, STATIC_INIT, INSTANCE_INIT, VARIABLE_DEF"/>
+ <property name="allowNoEmptyLineBetweenFields" value="true"/>
+ </module>
+ <module name="EmptyStatement"/> <!-- Java Style Guide: One statement per line -->
+ <module name="EqualsHashCode"/>
+ <module name="FallThrough"/> <!-- Java Style Guide: Fall-through: commented -->
+ <module name="GenericWhitespace"> <!-- Java Style Guide: Horizontal whitespace -->
+ <message key="ws.followed" value="GenericWhitespace ''{0}'' is followed by whitespace."/>
+ <message key="ws.preceded" value="GenericWhitespace ''{0}'' is preceded with whitespace."/>
+ <message key="ws.illegalFollow" value="GenericWhitespace ''{0}'' should followed by whitespace."/>
+ <message key="ws.notPreceded" value="GenericWhitespace ''{0}'' is not preceded with whitespace."/>
+ </module>
+ <module name="HiddenField"> <!-- Java Coding Guide: Avoid shadowing -->
+ <property name="ignoreConstructorParameter" value="true"/>
+ <property name="ignoreSetter" value="true"/>
+ <property name="setterCanReturnItsClass" value="true"/>
+ </module>
+ <module name="HideUtilityClassConstructor"/> <!-- Java Coding Guidelines: Private constructors -->
+ <module name="IllegalImport"> <!-- Java Coding Guidelines: Use JUnit 4-style test classes and assertions -->
+ <property name="illegalPkgs" value="junit.framework"/>
+ <message key="import.illegal" value="Use JUnit 4-style (org.junit.*) test classes and assertions instead of JUnit 3 (junit.framework.*)."/>
+ </module>
+ <module name="IllegalImport"> <!-- Only relevant for pre-Java 11 because javafx is gone completely in Java 11 -->
+ <property name="id" value="BanJavafx"/>
+ <property name="illegalPkgs" value="javafx"/>
+ <message key="import.illegal" value="Must not import javafx classes because some OpenJDK builds do not include javafx."/>
+ </module>
+ <module name="IllegalImport"> <!-- Java Coding Guidelines: Import the canonical package -->
+ <property name="illegalPkgs" value="org.elasticsearch.common.base, com.clearspring.analytics.util, org.spark_project.guava"/>
+ <message key="import.illegal" value="Must not import repackaged classes."/>
+ </module>
+ <module name="IllegalImport"> <!-- Java Coding Guidelines: Import the canonical package -->
+ <property name="id" value="BanShadedClasses"/>
+ <property name="illegalPkgs" value=".*\.(repackaged|shaded|thirdparty)"/>
+ <property name="regexp" value="true" />
+ <message key="import.illegal" value="Must not import repackaged classes."/>
+ </module>
+ <module name="IllegalImport">
+ <property name="illegalPkgs" value="^org\.gradle\.(internal|.*\.internal)"/>
+ <property name="regexp" value="true" />
+ <message key="import.illegal" value="Do not rely on gradle internal classes as these may change in minor releases - use org.gradle.api versions instead."/>
+ </module>
+ <module name="IllegalImport">
+ <property name="illegalPkgs" value="sun"/>
+ <message key="import.illegal" value="Must not use Oracle's Java implementation details. See http://www.oracle.com/technetwork/java/faq-sun-packages-142232.html ."/>
+ </module>
+ <module name="IllegalImport">
+ <property name="illegalPkgs" value="org.apache.commons.lang"/>
+ <message key="import.illegal" value="lang is deprecated, use lang3 instead."/>
+ </module>
+ <module name="IllegalImport">
+ <property name="illegalPkgs" value="org.apache.commons.math"/>
+ <message key="import.illegal" value="math is deprecated, use math3 instead."/>
+ </module>
+ <module name="IllegalImport">
+ <property name="id" value="BanLoggingImplementations"/>
+ <property name="illegalPkgs" value="org.apache.log4j, org.apache.logging.log4j, java.util.logging, ch.qos.logback"/>
+ <message key="import.illegal" value="Use SLF4J instead of a logging framework directly."/>
+ </module>
+ <module name="IllegalImport">
+ <property name="illegalClasses" value="com.google.common.base.Optional, com.google.common.base.Supplier"/>
+ <message key="import.illegal" value="Use the Java8 version of Guava objects."/>
+ </module>
+ <module name="IllegalInstantiation"> <!-- Java Coding Guidelines: Never instantiate primitive types -->
+ <property name="classes" value="java.lang.Boolean"/>
+ <property name="classes" value="java.lang.Byte"/>
+ <property name="classes" value="java.lang.Character"/>
+ <property name="classes" value="java.lang.Double"/>
+ <property name="classes" value="java.lang.Float"/>
+ <property name="classes" value="java.lang.Integer"/>
+ <property name="classes" value="java.lang.Long"/>
+ </module>
+ <module name="IllegalThrows"/> <!-- Java Coding Guidelines: Throwable, Error, RuntimeException: Not declared -->
+ <module name="IllegalTokenText"> <!-- Java Style Guide: Special escape sequences -->
+ <property name="tokens" value="STRING_LITERAL, CHAR_LITERAL"/>
+ <property name="format" value="\\u00(08|09|0(a|A)|0(c|C)|0(d|D)|22|27|5(C|c))|\\(0(10|11|12|14|15|42|47)|134)"/>
+ <property name="message" value="Avoid using corresponding octal or Unicode escape."/>
+ </module>
+ <module name="IllegalType"> <!-- Java Coding Guide: Limit coupling on concrete classes -->
+ <property name="illegalClassNames" value="java.util.ArrayList, java.util.HashSet, java.util.HashMap, java.util.LinkedList, java.util.LinkedHashMap, java.util.LinkedHashSet, java.util.TreeSet, java.util.TreeMap, com.google.common.collect.ArrayListMultimap, com.google.common.collect.ForwardingListMultimap, com.google.common.collect.ForwardingMultimap, com.google.common.collect.ForwardingSetMultimap, com.google.common.collect.ForwardingSortedSetMultimap, com.google.common.collec [...]
+ </module>
+ <module name="IllegalType">
+ <property name="id" value="BanGuavaCaches"/>
+ <property name="illegalClassNames" value="com.google.common.cache.CacheBuilder, com.google.common.cache.Cache, com.google.common.cache.LoadingCache"/>
+ <message key="illegal.type" value="Do not use Guava caches, they are outperformed by and harder to use than Caffeine caches"/>
+ </module>
+ <module name="ImportOrder"> <!-- Java Style Guide: Ordering and spacing -->
+ <property name="groups" value="/.*/"/>
+ <property name="option" value="bottom"/>
+ <property name="separated" value="true"/>
+ <property name="sortStaticImportsAlphabetically" value="true"/>
+ </module>
+ <module name="Indentation"> <!-- Java Style Guide: Block indentation: +4 spaces -->
+ <property name="basicOffset" value="2"/>
+ <property name="arrayInitIndent" value="4"/>
+ <property name="lineWrappingIndentation" value="4"/>
+ <property name="caseIndent" value="2"/>
+ </module>
+ <module name="InnerAssignment"/> <!-- Java Coding Guidelines: Inner assignments: Not used -->
+ <module name="LeftCurly"/> <!-- Java Style Guide: Nonempty blocks: K & R style -->
+ <module name="LineLength"> <!-- Java Style Guide: No line-wrapping -->
+ <property name="max" value="120"/>
+ <property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
+ </module>
+ <module name="MemberName"> <!-- Java Style Guide: Non-constant field names -->
+ <property name="format" value="^[a-z][a-zA-Z0-9]+$"/>
+ <message key="name.invalidPattern" value="Member name ''{0}'' must match pattern ''{1}''."/>
+ </module>
+ <module name="MethodName"> <!-- Java Style Guide: Method names -->
+ <property name="format" value="^[a-z][a-zA-Z0-9_]+$"/>
+ <message key="name.invalidPattern" value="Method name ''{0}'' must match pattern ''{1}''."/>
+ </module>
+ <module name="MethodParamPad"/> <!-- Java Style Guide: Horizontal whitespace -->
+ <module name="MissingDeprecated"/> <!-- Java Coding Guide: Deprecate per annotation and Javadoc -->
+ <module name="ModifiedControlVariable"/> <!-- Java Coding Guide: For-loop control variables: never modified -->
+ <module name="ModifierOrder"/> <!-- Java Style Guide: Modifiers -->
+ <module name="MultipleVariableDeclarations"/> <!-- Java Style Guide: One variable per declaration -->
+ <module name="MutableException"/> <!-- Java Coding Guidelines: Exceptions: Always immutable -->
+ <module name="NeedBraces"/> <!-- Java Style Guide: Braces are used where optional -->
+ <module name="NoClone"/> <!-- Java Coding Guidelines: Never override Object#finalize or Object#clone -->
+ <module name="NoFinalizer"/> <!-- Java Coding Guidelines: Never override Object#finalize -->
+ <module name="NoLineWrap"/> <!-- Java Style Guide: No line-wrapping -->
+ <module name="NoWhitespaceAfter"> <!-- Java Style Guide: Horizontal whitespace -->
+ <property name="allowLineBreaks" value="false"/>
+ <property name="tokens" value="BNOT,DEC,DOT,INC,LNOT,UNARY_MINUS,UNARY_PLUS"/>
+ </module>
+ <module name="NoWhitespaceBefore"> <!-- Java Style Guide: Horizontal whitespace -->
+ <property name="allowLineBreaks" value="true"/>
+ </module>
+ <module name="OneStatementPerLine"/> <!-- Java Style Guide: One statement per line -->
+ <module name="OneTopLevelClass"/> <!-- Java Style Guide: Exactly one top-level class declaration -->
+ <module name="OperatorWrap"> <!-- Java Style Guide: Where to break -->
+ <property name="option" value="EOL"/>
+ <property name="tokens" value="BAND, BOR, BSR, BXOR, DIV, EQUAL, GE, GT, LAND, LE, LITERAL_INSTANCEOF, LOR, LT, MINUS, MOD, NOT_EQUAL, PLUS, QUESTION, SL, SR, STAR "/>
+ </module>
+ <module name="OuterTypeFilename"/> <!-- Java Style Guide: File name -->
+ <module name="OverloadMethodsDeclarationOrder"/> <!-- Java Style Guide: Overloads: never split -->
+ <module name="PackageAnnotation"/> <!-- Java Style Guide: Package statement -->
+ <module name="PackageDeclaration"/> <!-- Java Style Guide: Package statement -->
+ <module name="PackageName"> <!-- Java Style Guide: Package names -->
+ <property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/>
+ <message key="name.invalidPattern" value="Package name ''{0}'' must match pattern ''{1}''."/>
+ </module>
+ <module name="ParameterAssignment"/> <!-- Java Coding Guidelines: Final variables and parameters -->
+ <module name="ParenPad"/> <!-- Java Style Guide: Horizontal whitespace -->
+ <module name="RedundantImport"/> <!-- Java Style Guide: No unused imports -->
+ <module name="RedundantModifier"/> <!-- Java Coding Guidelines: Avoid redundant modifiers -->
+ <module name="RegexpSinglelineJava"> <!-- Java Coding Guidelines: Avoid Generics clutter where possible -->
+ <property name="format" value="Collections\.EMPTY_LIST"/>
+ <property name="message" value="Use Collections.emptyList() or, better, ImmutableList.of()."/>
+ </module>
+ <module name="RegexpSinglelineJava"> <!-- Java Coding Guidelines: Avoid Generics clutter where possible -->
+ <property name="format" value="Collections\.EMPTY_MAP"/>
+ <property name="message" value="Use Collections.emptyMap() or, better, ImmutableMap.of()."/>
+ </module>
+ <module name="RegexpSinglelineJava"> <!-- Java Coding Guidelines: Avoid Generics clutter where possible -->
+ <property name="format" value="Collections\.EMPTY_SET"/>
+ <property name="message" value="Use Collections.emptySet() or, better, ImmutableSet.of()."/>
+ </module>
+ <module name="RegexpSinglelineJava">
+ <property name="id" value="BanJacksonFindAndRegisterModulesMethod"/>
+ <property name="format" value="findAndRegisterModules"/>
+ <property name="message" value="Use ObjectMapper#registerModule(<yourModule>) explicitly. ObjectMapper#findAndRegisterModules() is dangerous because it will change behaviour depending on which modules are on your classpath (including transitive dependencies)."/>
+ </module>
+ <module name="RegexpSinglelineJava"> <!-- Java Coding Guidelines: Avoid Generics clutter where possible -->
+ <property name="format" value="ImmutableList\.Builder.*new ImmutableList\.Builder"/>
+ <property name="message" value="Use ImmutableList.builder() for variable assignment."/>
+ </module>
+ <module name="RegexpSinglelineJava"> <!-- Java Coding Guidelines: Avoid Generics clutter where possible -->
+ <property name="format" value="ImmutableMap\.Builder.*new ImmutableMap\.Builder"/>
+ <property name="message" value="Use ImmutableMap.builder() for variable assignment."/>
+ </module>
+ <module name="RegexpSinglelineJava"> <!-- Java Coding Guidelines: Avoid Generics clutter where possible -->
+ <property name="format" value="ImmutableSet\.Builder.*new ImmutableSet\.Builder"/>
+ <property name="message" value="Use ImmutableSet.builder() for variable assignment."/>
+ </module>
+ <module name="RegexpSinglelineJava"> <!-- Java Coding Guidelines: Check parameters for validity -->
+ <property name="format" value="Preconditions\.checkNotNull\((?!.*,)([^()]*(\(([^()]*|\(([^()]*|\([^()]*\))*\))*\)[^()]*)*)\)"/>
+ <property name="message" value="Use Preconditions.checkNotNull(Object, String)."/>
+ </module>
+ <module name="RegexpSinglelineJava"> <!-- Java Coding Guidelines: Check parameters for validity -->
+ <property name="format" value="Validate\.notNull\((?!.*,)([^()]*(\(([^()]*|\(([^()]*|\([^()]*\))*\))*\)[^()]*)*)\)"/>
+ <property name="message" value="Use Validate.notNull(Object, String)."/>
+ </module>
+ <module name="RegexpSinglelineJava">
+ <property name="format" value="^\s*super\(\);"/>
+ <property name="message" value="This is unnecessary; please delete."/>
+ </module>
+ <module name="RegexpSinglelineJava"> <!-- Java Style Guide: Horizontal whitespace -->
+ <property name="format" value="\s+$"/>
+ <property name="message" value="Trailing whitespace is not allowed."/>
+ </module>
+ <module name="RegexpSinglelineJava">
+ <property name="format" value="\? extends Object\W"/>
+ <property name="message" value="Use ? rather than ? extends Object."/>
+ </module>
+ <module name="RegexpSinglelineJava">
+ <property name="format" value="(?i)log(ger)?\.(debug|info|warn|error)\(.*%[sd]"/>
+ <property name="message" value="SLF4J loggers support '{}' style formatting."/>
+ <property name="ignoreComments" value="true"/>
+ </module>
+ <module name="RegexpSinglelineJava">
+ <property name="format" value="\.printStackTrace\(\)"/>
+ <property name="message" value="printStackTrace is not generally allowed."/>
+ <property name="ignoreComments" value="true"/>
+ </module>
+ <module name="RegexpSinglelineJava">
+ <property name="id" value="BanSystemOut"/>
+ <property name="format" value="System\.out\."/>
+ <property name="message" value="Logging with System.out is not allowed because it has no metadata and can't be configured at runtime. Please use an SLF4J logger instead, e.g. log.info("Message")."/>
+ <property name="ignoreComments" value="true"/>
+ </module>
+ <module name="RegexpSinglelineJava">
+ <property name="id" value="BanSystemErr"/>
+ <property name="format" value="System\.err\."/>
+ <property name="message" value="Logging with System.err is not allowed because it has no metadata and can't be configured at runtime. Please use an SLF4J logger instead, e.g. log.info("Message")."/>
+ <property name="ignoreComments" value="true"/>
+ </module>
+ <module name="RegexpSinglelineJava">
+ <property name="format" value="\bCharsets\."/>
+ <property name="message" value="Use JDK StandardCharsets instead of alternatives."/>
+ </module>
+ <module name="RegexpSinglelineJava">
+ <property name="format" value="\bCharset.defaultCharset\("/>
+ <property name="message" value="Use explicit charset (e.g. StandardCharsets.UTF-8) instead of default."/>
+ </module>
+ <module name="RegexpSinglelineJava">
+ <property name="format" value="\bIOUtils\.toString\("/>
+ <property name="message" value="Prefer Guava''s [CharStreams,Files,Resources].toString to avoid charset/stream closing issues."/>
+ </module>
+ <module name="RegexpSinglelineJava">
+ <property name="format" value="static enum"/>
+ <property name="message" value="Redundant ''static'' modifier."/>
+ </module>
+ <module name="RegexpSinglelineJava">
+ <property name="format" value="(void setUp\(\))|(void setup\(\))|(void setupStatic\(\))|(void setUpStatic\(\))|(void beforeTest\(\))|(void teardown\(\))|(void tearDown\(\))|(void beforeStatic\(\))|(void afterStatic\(\))"/>
+ <property name="message" value="Test setup/teardown methods are called before(), beforeClass(), after(), afterClass(), but not setUp, teardown, etc."/>
+ </module>
+ <module name="RightCurly"> <!-- Java Style Guide: Nonempty blocks: K & R style -->
+ <property name="option" value="same"/>
+ <property name="tokens" value="LITERAL_TRY, LITERAL_CATCH, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_DO"/>
+ </module>
+ <module name="RightCurly"> <!-- Java Style Guide: Nonempty blocks: K & R style -->
+ <property name="option" value="alone"/>
+ <property name="tokens" value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, STATIC_INIT, INSTANCE_INIT"/>
+ </module>
+ <module name="SeparatorWrap"> <!-- Java Style Guide: Where to break -->
+ <property name="tokens" value="DOT"/>
+ <property name="option" value="nl"/>
+ </module>
+ <module name="SeparatorWrap"> <!-- Java Style Guide: Where to break -->
+ <property name="tokens" value="COMMA"/>
+ <property name="option" value="EOL"/>
+ </module>
+ <module name="SimplifyBooleanExpression"/> <!-- Java Coding Guidelines: Keep Boolean expressions simple -->
+ <module name="SimplifyBooleanReturn"/> <!-- Java Coding Guidelines: Keep Boolean expressions simple -->
+ <module name="StaticVariableName"/> <!-- Java Style Guide: Naming -->
+ <module name="StringLiteralEquality"/> <!-- Java Coding Guidelines: String equality: use String#equals -->
+ <module name="SuperClone"/>
+ <module name="SuppressWarnings">
+ <property name="format" value="serial"/>
+ </module>
+ <module name="SuppressWarningsHolder" /> <!-- Required for SuppressWarningsFilter -->
+ <module name="TypeName"> <!-- Java Style Guide: Class names -->
+ <message key="name.invalidPattern" value="Type name ''{0}'' must match pattern ''{1}''."/>
+ </module>
+ <module name="TypecastParenPad"/> <!-- Java Style Guide: Horizontal whitespace -->
+ <module name="UnnecessaryParentheses"/>
+ <module name="UnusedImports"> <!-- Java Style Guide: No unused imports -->
+ <property name="processJavadoc" value="true"/>
+ </module>
+ <module name="UpperEll"/> <!-- Java Style Guide: Numeric Literals -->
+ <module name="VisibilityModifier"/> <!-- Java Coding Guidelines: Minimize mutability -->
+ <module name="WhitespaceAfter"/> <!-- Java Style Guide: Horizontal whitespace -->
+ <module name="WhitespaceAround"> <!-- Java Style Guide: Horizontal whitespace -->
+ <property name="allowEmptyConstructors" value="true"/>
+ <property name="allowEmptyMethods" value="true"/>
+ <property name="allowEmptyTypes" value="true"/>
+ <property name="allowEmptyLoops" value="true"/>
+ <property name="ignoreEnhancedForColon" value="false"/>
+ <message key="ws.notFollowed" value="WhitespaceAround: ''{0}'' is not followed by whitespace. Empty blocks may only be represented as '{}' when not part of a multi-block statement (4.1.3)"/>
+ <message key="ws.notPreceded" value="WhitespaceAround: ''{0}'' is not preceded with whitespace."/>
+ </module>
+
+ <!-- Stricter checks begin: delete some or all of the following for faster prototyping, but please restore before pushing to production. -->
+
+ <module name="AtclauseOrder"> <!-- Java Style Guide: At-clauses -->
+ <property name="tagOrder" value="@param, @return, @throws, @deprecated"/>
+ <property name="target" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
+ </module>
+ <module name="CyclomaticComplexity"> <!-- Java Coding Guidelines: Reduce Cyclomatic Complexity -->
+ <property name="switchBlockAsSingleDecisionPoint" value="true"/>
+ <property name="max" value="12"/>
+ </module>
+ <module name="JavadocMethod"> <!-- Java Style Guide: Where Javadoc is used -->
+ <property name="scope" value="public"/>
+ <property name="allowMissingParamTags" value="true"/>
+ <property name="allowMissingThrowsTags" value="true"/>
+ <property name="allowMissingReturnTag" value="true"/>
+ <property name="minLineCount" value="99999999"/>
+ <property name="allowedAnnotations" value="Override, Test"/>
+ <property name="allowThrowsTagsForSubclasses" value="true"/>
+ </module>
+ <module name="JavadocStyle"> <!-- Java Style Guide: Javadoc -->
+ <property name="checkFirstSentence" value="false"/>
+ </module>
+ <module name="JavadocTagContinuationIndentation"> <!-- Java Style Guide: At-clauses -->
+ <property name="offset" value="0"/>
+ </module>
+ <module name="LocalFinalVariableName"/> <!-- Java Style Guide: Local variable names -->
+ <module name="LocalVariableName"> <!-- Java Style Guide: Local variable names -->
+ <property name="tokens" value="VARIABLE_DEF"/>
+ <property name="format" value="^[a-z][a-zA-Z0-9]+$"/>
+ <property name="allowOneCharVarInForLoop" value="true"/>
+ <message key="name.invalidPattern" value="Local variable name ''{0}'' must match pattern ''{1}''."/>
+ </module>
+ <module name="MethodLength"/> <!-- Java Coding Guide: Methods and functions: focused, crisp, concise -->
+ <module name="MethodTypeParameterName"> <!-- Java Style Guide: Type variable names -->
+ <property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
+ <message key="name.invalidPattern" value="Method type name ''{0}'' must match pattern ''{1}''."/>
+ </module>
+ <module name="NestedForDepth">
+ <property name="max" value="2"/>
+ </module>
+ <module name="NestedTryDepth"/> <!-- Java Coding Guide: Try/catch blocks: never nested -->
+ <module name="NonEmptyAtclauseDescription"/> <!-- Java Style Guide: At-clauses -->
+ <module name="ParameterName"> <!-- Java Style Guide: Parameter names -->
+ <property name="format" value="^[a-z][a-zA-Z0-9]+$"/>
+ <message key="name.invalidPattern" value="Parameter name ''{0}'' must match pattern ''{1}''."/>
+ <property name="ignoreOverridden" value="true"/>
+ </module>
+ <module name="SingleLineJavadoc"/> <!-- Java Style Guide: General form -->
+
+ <!-- Stricter checks end -->
+ </module>
+</module>
diff --git a/.baseline/copyright/001_apache-2.0.txt b/.baseline/copyright/001_apache-2.0.txt
new file mode 100644
index 0000000..51fca54
--- /dev/null
+++ b/.baseline/copyright/001_apache-2.0.txt
@@ -0,0 +1,11 @@
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
diff --git a/.baseline/eclipse/dynamic/dotfile.checkstyle b/.baseline/eclipse/dynamic/dotfile.checkstyle
new file mode 100644
index 0000000..c176af2
--- /dev/null
+++ b/.baseline/eclipse/dynamic/dotfile.checkstyle
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<fileset-config file-format-version="1.2.0" simple-config="false" sync-formatter="false">
+ <local-check-config name="Baseline" location="${configDir}/checkstyle/checkstyle.xml" type="external" description="">
+ <additional-data name="protect-config-file" value="false"/>
+ </local-check-config>
+ <fileset name="all" enabled="true" check-config-name="Baseline" local="true">
+ <file-match-pattern match-pattern="." include-pattern="false"/>
+ <file-match-pattern match-pattern=".*\\.java" include-pattern="true"/>
+ <file-match-pattern match-pattern=".*\\.cfg" include-pattern="true"/>
+ <file-match-pattern match-pattern=".*\\.coffee" include-pattern="true"/>
+ <file-match-pattern match-pattern=".*\\.erb" include-pattern="true"/>
+ <file-match-pattern match-pattern=".*\\.groovy" include-pattern="true"/>
+ <file-match-pattern match-pattern=".*\\.handlebars" include-pattern="true"/>
+ <file-match-pattern match-pattern=".*\\.json" include-pattern="true"/>
+ <file-match-pattern match-pattern=".*\\.less" include-pattern="true"/>
+ <file-match-pattern match-pattern=".*\\.pl" include-pattern="true"/>
+ <file-match-pattern match-pattern=".*\\.pp" include-pattern="true"/>
+ <file-match-pattern match-pattern=".*\\.sh" include-pattern="true"/>
+ <file-match-pattern match-pattern=".*\\.xml" include-pattern="true"/>
+ <file-match-pattern match-pattern="src/test/resources/.*" include-pattern="false"/>
+ </fileset>
+</fileset-config>
diff --git a/.baseline/eclipse/org.eclipse.jdt.core.prefs b/.baseline/eclipse/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..fc7a7dd
--- /dev/null
+++ b/.baseline/eclipse/org.eclipse.jdt.core.prefs
@@ -0,0 +1,313 @@
+org.eclipse.jdt.core.codeComplete.argumentPrefixes=
+org.eclipse.jdt.core.codeComplete.argumentSuffixes=
+org.eclipse.jdt.core.codeComplete.fieldPrefixes=
+org.eclipse.jdt.core.codeComplete.fieldSuffixes=
+org.eclipse.jdt.core.codeComplete.localPrefixes=
+org.eclipse.jdt.core.codeComplete.localSuffixes=
+org.eclipse.jdt.core.codeComplete.staticFieldPrefixes=
+org.eclipse.jdt.core.codeComplete.staticFieldSuffixes=
+org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes=
+org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes=
+org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=enabled
+org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
+org.eclipse.jdt.core.compiler.annotation.nonnull=javax.annotation.Nonnull
+org.eclipse.jdt.core.compiler.annotation.nullable=javax.annotation.CheckForNull
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.methodParameters=generate
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=${javaTargetVersion}
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=${javaTargetVersion}
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.doc.comment.support=enabled
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=ignore
+org.eclipse.jdt.core.compiler.processAnnotations=enabled
+org.eclipse.jdt.core.compiler.source=${javaSourceVersion}
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_assignment=32
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=0
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
+org.eclipse.jdt.core.formatter.comment.format_block_comments=true
+org.eclipse.jdt.core.formatter.comment.format_header=false
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
+org.eclipse.jdt.core.formatter.comment.format_line_comments=true
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
+org.eclipse.jdt.core.formatter.comment.line_length=120
+org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
+org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
+org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=2
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.disabling_tag=@formatter\\:off
+org.eclipse.jdt.core.formatter.enabling_tag=@formatter\\:on
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true
+org.eclipse.jdt.core.formatter.indentation.size=4
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.join_lines_in_comments=true
+org.eclipse.jdt.core.formatter.join_wrapped_lines=false
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.lineSplit=120
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.tabulation.char=space
+org.eclipse.jdt.core.formatter.tabulation.size=4
+org.eclipse.jdt.core.formatter.use_on_off_tags=false
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
+org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
diff --git a/.baseline/eclipse/static/dotfile.settings/org.eclipse.jdt.ui.prefs b/.baseline/eclipse/static/dotfile.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 0000000..f2990d9
--- /dev/null
+++ b/.baseline/eclipse/static/dotfile.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,66 @@
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+formatter_profile=_Baseline Profile
+formatter_settings_version=12
+org.eclipse.jdt.ui.exception.name=e
+org.eclipse.jdt.ui.gettersetter.use.is=false
+org.eclipse.jdt.ui.ignorelowercasenames=true
+org.eclipse.jdt.ui.importorder=;
+org.eclipse.jdt.ui.javadoc=false
+org.eclipse.jdt.ui.keywordthis=false
+org.eclipse.jdt.ui.ondemandthreshold=99
+org.eclipse.jdt.ui.overrideannotation=true
+org.eclipse.jdt.ui.staticondemandthreshold=99
+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return the ${bare_field_name}\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for set [...]
+sp_cleanup.add_default_serial_version_id=true
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.add_missing_annotations=true
+sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_missing_methods=false
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_missing_override_annotations_interface_methods=true
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=true
+sp_cleanup.always_use_parentheses_in_expressions=false
+sp_cleanup.always_use_this_for_non_static_field_access=false
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_to_enhanced_for_loop=false
+sp_cleanup.correct_indentation=false
+sp_cleanup.format_source_code=false
+sp_cleanup.format_source_code_changes_only=false
+sp_cleanup.make_local_variable_final=false
+sp_cleanup.make_parameters_final=false
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_type_abstract_if_missing_method=false
+sp_cleanup.make_variable_declarations_final=false
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.on_save_use_additional_actions=true
+sp_cleanup.organize_imports=true
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_trailing_whitespaces=true
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_casts=true
+sp_cleanup.remove_unnecessary_nls_tags=false
+sp_cleanup.remove_unused_imports=true
+sp_cleanup.remove_unused_local_variables=false
+sp_cleanup.remove_unused_private_fields=true
+sp_cleanup.remove_unused_private_members=false
+sp_cleanup.remove_unused_private_methods=true
+sp_cleanup.remove_unused_private_types=true
+sp_cleanup.sort_members=false
+sp_cleanup.sort_members_all=false
+sp_cleanup.use_blocks=false
+sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_parentheses_in_expressions=false
+sp_cleanup.use_this_for_non_static_field_access=false
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_method_access=false
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
diff --git a/.baseline/idea/intellij-java-palantir-style.xml b/.baseline/idea/intellij-java-palantir-style.xml
new file mode 100644
index 0000000..81d8550
--- /dev/null
+++ b/.baseline/idea/intellij-java-palantir-style.xml
@@ -0,0 +1,471 @@
+<project version="4">
+ <component name="ProjectCodeStyleSettingsManager">
+ <option name="PER_PROJECT_SETTINGS">
+ <value>
+ <option name="ALIGN_MULTILINE_ARRAY_INITIALIZER_EXPRESSION" value="true" />
+ <option name="ALIGN_MULTILINE_ASSIGNMENT" value="true" />
+ <option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
+ <option name="ALIGN_MULTILINE_EXTENDS_LIST" value="true" />
+ <option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
+ <option name="ALIGN_MULTILINE_PARENTHESIZED_EXPRESSION" value="true" />
+ <option name="ALIGN_MULTILINE_TERNARY_OPERATION" value="true" />
+ <option name="ALIGN_MULTILINE_THROWS_LIST" value="true" />
+ <option name="ARRAY_INITIALIZER_WRAP" value="1" />
+ <option name="ASSIGNMENT_WRAP" value="5" />
+ <option name="BINARY_OPERATION_SIGN_ON_NEXT_LINE" value="false" />
+ <option name="BINARY_OPERATION_WRAP" value="1" />
+ <option name="BLANK_LINES_AFTER_CLASS_HEADER" value="1" />
+ <option name="CALL_PARAMETERS_WRAP" value="1" />
+ <option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="99" />
+ <option name="DOWHILE_BRACE_FORCE" value="3" />
+ <option name="EXTENDS_KEYWORD_WRAP" value="1" />
+ <option name="EXTENDS_LIST_WRAP" value="1" />
+ <option name="FOR_BRACE_FORCE" value="3" />
+ <option name="FOR_STATEMENT_WRAP" value="1" />
+ <option name="IF_BRACE_FORCE" value="3" />
+ <option name="IMPORT_LAYOUT_TABLE">
+ <value>
+ <package name="" static="false" withSubpackages="true" />
+ <emptyLine />
+ <package name="" static="true" withSubpackages="true" />
+ </value>
+ </option>
+ <GroovyCodeStyleSettings>
+ <option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="99" />
+ <option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="99" />
+ <option name="PACKAGES_TO_USE_IMPORT_ON_DEMAND">
+ <value />
+ </option>
+ <option name="IMPORT_LAYOUT_TABLE">
+ <value>
+ <package name="" withSubpackages="true" static="true" />
+ <emptyLine />
+ <package name="" withSubpackages="true" static="false" />
+ </value>
+ </option>
+ </GroovyCodeStyleSettings>
+ <option name="JD_ALIGN_EXCEPTION_COMMENTS" value="false" />
+ <option name="JD_ALIGN_PARAM_COMMENTS" value="false" />
+ <option name="JD_DO_NOT_WRAP_ONE_LINE_COMMENTS" value="true" />
+ <option name="JD_KEEP_EMPTY_EXCEPTION" value="false" />
+ <option name="JD_KEEP_EMPTY_PARAMETER" value="false" />
+ <option name="JD_KEEP_EMPTY_RETURN" value="false" />
+ <option name="JD_PRESERVE_LINE_FEEDS" value="true" />
+ <option name="KEEP_BLANK_LINES_IN_CODE" value="1" />
+ <option name="KEEP_CONTROL_STATEMENT_IN_ONE_LINE" value="false" />
+ <option name="METHOD_CALL_CHAIN_WRAP" value="1" />
+ <option name="METHOD_PARAMETERS_WRAP" value="1" />
+ <option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="99" />
+ <option name="OPTIMIZE_IMPORTS_ON_THE_FLY" value="true" />
+ <option name="OTHER_INDENT_OPTIONS">
+ <value>
+ <option name="INDENT_SIZE" value="2" />
+ <option name="CONTINUATION_INDENT_SIZE" value="4" />
+ <option name="TAB_SIZE" value="2" />
+ <option name="USE_TAB_CHARACTER" value="false" />
+ <option name="SMART_TABS" value="false" />
+ <option name="LABEL_INDENT_SIZE" value="0" />
+ <option name="LABEL_INDENT_ABSOLUTE" value="false" />
+ <option name="USE_RELATIVE_INDENTS" value="false" />
+ </value>
+ </option>
+ <option name="PACKAGES_TO_USE_IMPORT_ON_DEMAND">
+ <value />
+ </option>
+ <option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="false" />
+ <option name="TERNARY_OPERATION_WRAP" value="1" />
+ <option name="THROWS_KEYWORD_WRAP" value="1" />
+ <option name="THROWS_LIST_WRAP" value="1" />
+ <option name="WHILE_BRACE_FORCE" value="3" />
+ <option name="WRAP_COMMENTS" value="true" />
+ <codeStyleSettings language="JAVA">
+ <indentOptions>
+ <option name="INDENT_SIZE" value="2" />
+ <option name="CONTINUATION_INDENT_SIZE" value="4" />
+ <option name="TAB_SIZE" value="2" />
+ <option name="USE_TAB_CHARACTER" value="false" />
+ <option name="SMART_TABS" value="false" />
+ <option name="LABEL_INDENT_SIZE" value="0" />
+ <option name="LABEL_INDENT_ABSOLUTE" value="false" />
+ <option name="USE_RELATIVE_INDENTS" value="false" />
+ <option name="CONTINUATION_INDENT_SIZE" value="4" />
+ </indentOptions>
+ <option name="ALIGN_MULTILINE_ARRAY_INITIALIZER_EXPRESSION" value="true" />
+ <option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
+ <option name="ALIGN_MULTILINE_RESOURCES" value="false" />
+ <option name="ARRAY_INITIALIZER_WRAP" value="1" />
+ <option name="ASSIGNMENT_WRAP" value="1" />
+ <option name="BINARY_OPERATION_SIGN_ON_NEXT_LINE" value="false" />
+ <option name="BINARY_OPERATION_WRAP" value="1" />
+ <option name="BLANK_LINES_AROUND_METHOD_IN_INTERFACE" value="0" />
+ <option name="CALL_PARAMETERS_LPAREN_ON_NEXT_LINE" value="true" />
+ <option name="CALL_PARAMETERS_WRAP" value="5" />
+ <option name="DOWHILE_BRACE_FORCE" value="3" />
+ <option name="ENUM_CONSTANTS_WRAP" value="2" />
+ <option name="EXTENDS_KEYWORD_WRAP" value="1" />
+ <option name="EXTENDS_LIST_WRAP" value="1" />
+ <option name="FIELD_ANNOTATION_WRAP" value="1" />
+ <option name="FOR_BRACE_FORCE" value="3" />
+ <option name="FOR_STATEMENT_WRAP" value="1" />
+ <option name="IF_BRACE_FORCE" value="3" />
+ <option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="0" />
+ <option name="KEEP_BLANK_LINES_IN_CODE" value="1" />
+ <option name="KEEP_BLANK_LINES_IN_DECLARATIONS" value="1" />
+ <option name="KEEP_CONTROL_STATEMENT_IN_ONE_LINE" value="false" />
+ <option name="KEEP_FIRST_COLUMN_COMMENT" value="false" />
+ <option name="KEEP_SIMPLE_CLASSES_IN_ONE_LINE" value="true" />
+ <option name="KEEP_SIMPLE_LAMBDAS_IN_ONE_LINE" value="true" />
+ <option name="KEEP_SIMPLE_METHODS_IN_ONE_LINE" value="true" />
+ <option name="LINE_COMMENT_AT_FIRST_COLUMN" value="false" />
+ <option name="LINE_COMMENT_ADD_SPACE" value="true" />
+ <option name="METHOD_CALL_CHAIN_WRAP" value="5" />
+ <option name="METHOD_PARAMETERS_LPAREN_ON_NEXT_LINE" value="true" />
+ <option name="METHOD_PARAMETERS_WRAP" value="5" />
+ <option name="OPTIMIZE_IMPORTS_ON_THE_FLY" value="true" />
+ <option name="PARENT_SETTINGS_INSTALLED" value="true" />
+ <option name="RESOURCE_LIST_WRAP" value="5" />
+ <option name="RIGHT_MARGIN" value="120" />
+ <option name="SPACE_BEFORE_ARRAY_INITIALIZER_LBRACE" value="true" />
+ <option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="false" />
+ <option name="TERNARY_OPERATION_WRAP" value="5" />
+ <option name="THROWS_KEYWORD_WRAP" value="1" />
+ <option name="THROWS_LIST_WRAP" value="1" />
+ <option name="WHILE_BRACE_FORCE" value="3" />
+ <option name="WRAP_ON_TYPING" value="1" />
+ <arrangement>
+ <rules>
+ <section>
+ <rule>
+ <match>
+ <AND>
+ <FIELD>true</FIELD>
+ <FINAL>true</FINAL>
+ <PUBLIC>true</PUBLIC>
+ <STATIC>true</STATIC>
+ </AND>
+ </match>
+ </rule>
+ </section>
+ <section>
+ <rule>
+ <match>
+ <AND>
+ <FIELD>true</FIELD>
+ <FINAL>true</FINAL>
+ <PROTECTED>true</PROTECTED>
+ <STATIC>true</STATIC>
+ </AND>
+ </match>
+ </rule>
+ </section>
+ <section>
+ <rule>
+ <match>
+ <AND>
+ <FIELD>true</FIELD>
+ <FINAL>true</FINAL>
+ <PACKAGE_PRIVATE>true</PACKAGE_PRIVATE>
+ <STATIC>true</STATIC>
+ </AND>
+ </match>
+ </rule>
+ </section>
+ <section>
+ <rule>
+ <match>
+ <AND>
+ <FIELD>true</FIELD>
+ <FINAL>true</FINAL>
+ <PRIVATE>true</PRIVATE>
+ <STATIC>true</STATIC>
+ </AND>
+ </match>
+ </rule>
+ </section>
+ <section>
+ <rule>
+ <match>
+ <AND>
+ <FIELD>true</FIELD>
+ <PUBLIC>true</PUBLIC>
+ <STATIC>true</STATIC>
+ </AND>
+ </match>
+ </rule>
+ </section>
+ <section>
+ <rule>
+ <match>
+ <AND>
+ <FIELD>true</FIELD>
+ <PROTECTED>true</PROTECTED>
+ <STATIC>true</STATIC>
+ </AND>
+ </match>
+ </rule>
+ </section>
+ <section>
+ <rule>
+ <match>
+ <AND>
+ <FIELD>true</FIELD>
+ <PACKAGE_PRIVATE>true</PACKAGE_PRIVATE>
+ <STATIC>true</STATIC>
+ </AND>
+ </match>
+ </rule>
+ </section>
+ <section>
+ <rule>
+ <match>
+ <AND>
+ <FIELD>true</FIELD>
+ <PRIVATE>true</PRIVATE>
+ <STATIC>true</STATIC>
+ </AND>
+ </match>
+ </rule>
+ </section>
+ <section>
+ <rule>
+ <match>
+ <AND>
+ <INITIALIZER_BLOCK>true</INITIALIZER_BLOCK>
+ <STATIC>true</STATIC>
+ </AND>
+ </match>
+ </rule>
+ </section>
+ <section>
+ <rule>
+ <match>
+ <AND>
+ <FIELD>true</FIELD>
+ <FINAL>true</FINAL>
+ <PUBLIC>true</PUBLIC>
+ </AND>
+ </match>
+ </rule>
+ </section>
+ <section>
+ <rule>
+ <match>
+ <AND>
+ <FIELD>true</FIELD>
+ <FINAL>true</FINAL>
+ <PROTECTED>true</PROTECTED>
+ </AND>
+ </match>
+ </rule>
+ </section>
+ <section>
+ <rule>
+ <match>
+ <AND>
+ <FIELD>true</FIELD>
+ <FINAL>true</FINAL>
+ <PACKAGE_PRIVATE>true</PACKAGE_PRIVATE>
+ </AND>
+ </match>
+ </rule>
+ </section>
+ <section>
+ <rule>
+ <match>
+ <AND>
+ <FIELD>true</FIELD>
+ <FINAL>true</FINAL>
+ <PRIVATE>true</PRIVATE>
+ </AND>
+ </match>
+ </rule>
+ </section>
+ <section>
+ <rule>
+ <match>
+ <AND>
+ <FIELD>true</FIELD>
+ <PUBLIC>true</PUBLIC>
+ </AND>
+ </match>
+ </rule>
+ </section>
+ <section>
+ <rule>
+ <match>
+ <AND>
+ <FIELD>true</FIELD>
+ <PROTECTED>true</PROTECTED>
+ </AND>
+ </match>
+ </rule>
+ </section>
+ <section>
+ <rule>
+ <match>
+ <AND>
+ <FIELD>true</FIELD>
+ <PACKAGE_PRIVATE>true</PACKAGE_PRIVATE>
+ </AND>
+ </match>
+ </rule>
+ </section>
+ <section>
+ <rule>
+ <match>
+ <AND>
+ <FIELD>true</FIELD>
+ <PRIVATE>true</PRIVATE>
+ </AND>
+ </match>
+ </rule>
+ </section>
+ <section>
+ <rule>
+ <match>
+ <FIELD>true</FIELD>
+ </match>
+ </rule>
+ </section>
+ <section>
+ <rule>
+ <match>
+ <INITIALIZER_BLOCK>true</INITIALIZER_BLOCK>
+ </match>
+ </rule>
+ </section>
+ <section>
+ <rule>
+ <match>
+ <CONSTRUCTOR>true</CONSTRUCTOR>
+ </match>
+ </rule>
+ </section>
+ <section>
+ <rule>
+ <match>
+ <AND>
+ <METHOD>true</METHOD>
+ <STATIC>true</STATIC>
+ </AND>
+ </match>
+ </rule>
+ </section>
+ <section>
+ <rule>
+ <match>
+ <METHOD>true</METHOD>
+ </match>
+ </rule>
+ </section>
+ <section>
+ <rule>
+ <match>
+ <ENUM>true</ENUM>
+ </match>
+ </rule>
+ </section>
+ <section>
+ <rule>
+ <match>
+ <INTERFACE>true</INTERFACE>
+ </match>
+ </rule>
+ </section>
+ <section>
+ <rule>
+ <match>
+ <AND>
+ <CLASS>true</CLASS>
+ <STATIC>true</STATIC>
+ </AND>
+ </match>
+ </rule>
+ </section>
+ <section>
+ <rule>
+ <match>
+ <CLASS>true</CLASS>
+ </match>
+ </rule>
+ </section>
+ <section>
+ <rule>
+ <match>
+ <AND>
+ <ABSTRACT>true</ABSTRACT>
+ <METHOD>true</METHOD>
+ <PUBLIC>true</PUBLIC>
+ </AND>
+ </match>
+ </rule>
+ </section>
+ <section>
+ <rule>
+ <match>
+ <AND>
+ <ABSTRACT>true</ABSTRACT>
+ <METHOD>true</METHOD>
+ <PROTECTED>true</PROTECTED>
+ </AND>
+ </match>
+ </rule>
+ </section>
+ <section>
+ <rule>
+ <match>
+ <AND>
+ <METHOD>true</METHOD>
+ <PUBLIC>true</PUBLIC>
+ <SYNCHRONIZED>true</SYNCHRONIZED>
+ </AND>
+ </match>
+ </rule>
+ </section>
+ <section>
+ <rule>
+ <match>
+ <AND>
+ <METHOD>true</METHOD>
+ <PROTECTED>true</PROTECTED>
+ <SYNCHRONIZED>true</SYNCHRONIZED>
+ </AND>
+ </match>
+ </rule>
+ </section>
+ <section>
+ <rule>
+ <match>
+ <AND>
+ <METHOD>true</METHOD>
+ <PRIVATE>true</PRIVATE>
+ <SYNCHRONIZED>true</SYNCHRONIZED>
+ </AND>
+ </match>
+ </rule>
+ </section>
+ </rules>
+ </arrangement>
+ </codeStyleSettings>
+ <codeStyleSettings language="Groovy">
+ <option name="KEEP_FIRST_COLUMN_COMMENT" value="false" />
+ <option name="KEEP_CONTROL_STATEMENT_IN_ONE_LINE" value="false" />
+ <option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="1" />
+ <option name="BLANK_LINES_AROUND_METHOD_IN_INTERFACE" value="0" />
+ <option name="SPACE_WITHIN_BRACES" value="false" />
+ <option name="CALL_PARAMETERS_WRAP" value="1" />
+ <option name="METHOD_PARAMETERS_WRAP" value="1" />
+ <option name="EXTENDS_LIST_WRAP" value="1" />
+ <option name="THROWS_LIST_WRAP" value="1" />
+ <option name="EXTENDS_KEYWORD_WRAP" value="1" />
+ <option name="THROWS_KEYWORD_WRAP" value="1" />
+ <option name="BINARY_OPERATION_WRAP" value="1" />
+ <option name="TERNARY_OPERATION_WRAP" value="1" />
+ <option name="ASSIGNMENT_WRAP" value="1" />
+ <option name="FOR_BRACE_FORCE" value="3" />
+ </codeStyleSettings>
+ </value>
+ </option>
+ <option name="USE_PER_PROJECT_SETTINGS" value="true" />
+ </component>
+</project>
diff --git a/api/src/main/java/org/apache/iceberg/FileFormat.java b/api/src/main/java/org/apache/iceberg/FileFormat.java
index 2f17abc..27729af 100644
--- a/api/src/main/java/org/apache/iceberg/FileFormat.java
+++ b/api/src/main/java/org/apache/iceberg/FileFormat.java
@@ -71,9 +71,9 @@ public enum FileFormat {
return null;
}
- private static int lastIndexOf(char c, CharSequence seq) {
+ private static int lastIndexOf(char ch, CharSequence seq) {
for (int i = seq.length() - 1; i >= 0; i -= 1) {
- if (seq.charAt(i) == c) {
+ if (seq.charAt(i) == ch) {
return i;
}
}
diff --git a/api/src/main/java/org/apache/iceberg/Files.java b/api/src/main/java/org/apache/iceberg/Files.java
index 0d9aeb1..becf1e3 100644
--- a/api/src/main/java/org/apache/iceberg/Files.java
+++ b/api/src/main/java/org/apache/iceberg/Files.java
@@ -33,6 +33,8 @@ import org.apache.iceberg.io.SeekableInputStream;
public class Files {
+ private Files() {}
+
public static OutputFile localOutput(File file) {
return new LocalOutputFile(file);
}
@@ -213,14 +215,14 @@ public class Files {
}
@Override
- public void close() throws IOException {
- stream.close();
- this.isClosed = true;
+ public void write(int b) throws IOException {
+ stream.write(b);
}
@Override
- public void write(int b) throws IOException {
- stream.write(b);
+ public void close() throws IOException {
+ stream.close();
+ this.isClosed = true;
}
}
}
diff --git a/api/src/main/java/org/apache/iceberg/PartitionField.java b/api/src/main/java/org/apache/iceberg/PartitionField.java
index 4f60dcc..4332181 100644
--- a/api/src/main/java/org/apache/iceberg/PartitionField.java
+++ b/api/src/main/java/org/apache/iceberg/PartitionField.java
@@ -68,11 +68,9 @@ public class PartitionField implements Serializable {
}
PartitionField that = (PartitionField) other;
- return (
- sourceId == that.sourceId &&
+ return sourceId == that.sourceId &&
name.equals(that.name) &&
- transform.equals(that.transform)
- );
+ transform.equals(that.transform);
}
@Override
diff --git a/api/src/main/java/org/apache/iceberg/PartitionSpec.java b/api/src/main/java/org/apache/iceberg/PartitionSpec.java
index 63f7a87..4d757dd 100644
--- a/api/src/main/java/org/apache/iceberg/PartitionSpec.java
+++ b/api/src/main/java/org/apache/iceberg/PartitionSpec.java
@@ -54,7 +54,7 @@ public class PartitionSpec implements Serializable {
private final PartitionField[] fields;
private transient Map<Integer, PartitionField> fieldsBySourceId = null;
private transient Map<String, PartitionField> fieldsByName = null;
- private transient Class<?>[] javaClasses = null;
+ private transient Class<?>[] lazyJavaClasses = null;
private transient List<PartitionField> fieldList = null;
private PartitionSpec(Schema schema, int specId, List<PartitionField> fields) {
@@ -114,17 +114,17 @@ public class PartitionSpec implements Serializable {
}
public Class<?>[] javaClasses() {
- if (javaClasses == null) {
- this.javaClasses = new Class<?>[fields.length];
+ if (lazyJavaClasses == null) {
+ this.lazyJavaClasses = new Class<?>[fields.length];
for (int i = 0; i < fields.length; i += 1) {
PartitionField field = fields[i];
Type sourceType = schema.findType(field.sourceId());
Type result = field.transform().getResultType(sourceType);
- javaClasses[i] = result.typeId().javaClass();
+ lazyJavaClasses[i] = result.typeId().javaClass();
}
}
- return javaClasses;
+ return lazyJavaClasses;
}
@SuppressWarnings("unchecked")
@@ -242,8 +242,7 @@ public class PartitionSpec implements Serializable {
*/
public Set<Integer> identitySourceIds() {
Set<Integer> sourceIds = Sets.newHashSet();
- List<PartitionField> fields = this.fields();
- for (PartitionField field : fields) {
+ for (PartitionField field : fields()) {
if ("identity".equals(field.transform().toString())) {
sourceIds.add(field.sourceId());
}
@@ -313,8 +312,8 @@ public class PartitionSpec implements Serializable {
partitionNames.add(name);
}
- public Builder withSpecId(int specId) {
- this.specId = specId;
+ public Builder withSpecId(int newSpecId) {
+ this.specId = newSpecId;
return this;
}
diff --git a/api/src/main/java/org/apache/iceberg/RewriteFiles.java b/api/src/main/java/org/apache/iceberg/RewriteFiles.java
index 51057bf..3ee1374 100644
--- a/api/src/main/java/org/apache/iceberg/RewriteFiles.java
+++ b/api/src/main/java/org/apache/iceberg/RewriteFiles.java
@@ -34,12 +34,12 @@ import org.apache.iceberg.exceptions.ValidationException;
* will throw a {@link ValidationException}.
*/
public interface RewriteFiles extends PendingUpdate<Snapshot> {
- /**
- * Add a rewrite that replaces one set of files with another set that contains the same data.
- *
- * @param filesToDelete files that will be replaced (deleted), cannot be null or empty.
- * @param filesToAdd files that will be added, cannot be null or empty.
- * @return this for method chaining
- */
- RewriteFiles rewriteFiles(Set<DataFile> filesToDelete, Set<DataFile> filesToAdd);
+ /**
+ * Add a rewrite that replaces one set of files with another set that contains the same data.
+ *
+ * @param filesToDelete files that will be replaced (deleted), cannot be null or empty.
+ * @param filesToAdd files that will be added, cannot be null or empty.
+ * @return this for method chaining
+ */
+ RewriteFiles rewriteFiles(Set<DataFile> filesToDelete, Set<DataFile> filesToAdd);
}
diff --git a/api/src/main/java/org/apache/iceberg/TableScan.java b/api/src/main/java/org/apache/iceberg/TableScan.java
index 4f189aa..3a9c60f 100644
--- a/api/src/main/java/org/apache/iceberg/TableScan.java
+++ b/api/src/main/java/org/apache/iceberg/TableScan.java
@@ -106,6 +106,13 @@ public interface TableScan {
TableScan filter(Expression expr);
/**
+ * Returns this scan's filter {@link Expression}.
+ *
+ * @return this scan's filter expression
+ */
+ Expression filter();
+
+ /**
* Plan the {@link FileScanTask files} that will be read by this scan.
* <p>
* Each file has a residual expression that should be applied to filter the file's rows.
@@ -140,13 +147,6 @@ public interface TableScan {
Schema schema();
/**
- * Returns this scan's filter {@link Expression}.
- *
- * @return this scan's filter expression
- */
- Expression filter();
-
- /**
* Returns whether this scan should apply column name case sensitiveness as per {@link #caseSensitive(boolean)}.
* @return true if case sensitive, false otherwise.
*/
diff --git a/api/src/main/java/org/apache/iceberg/UpdateSchema.java b/api/src/main/java/org/apache/iceberg/UpdateSchema.java
index 8d9b179..7fe6bec 100644
--- a/api/src/main/java/org/apache/iceberg/UpdateSchema.java
+++ b/api/src/main/java/org/apache/iceberg/UpdateSchema.java
@@ -152,37 +152,37 @@ public interface UpdateSchema extends PendingUpdate<Schema> {
* <p>
* The name is used to find the column to update using {@link Schema#findField(String)}.
* <p>
+ * Only updates that widen types are allowed.
+ * <p>
* Columns may be updated and renamed in the same schema update.
*
* @param name name of the column to rename
+ * @param newType replacement type for the column
* @param newDoc replacement documentation string for the column
* @return this for method chaining
* @throws IllegalArgumentException If name doesn't identify a column in the schema or if this
* change introduces a type incompatibility or if it conflicts
* with other additions, renames, or updates.
*/
- UpdateSchema updateColumnDoc(String name, String newDoc);
+ default UpdateSchema updateColumn(String name, Type.PrimitiveType newType, String newDoc) {
+ return updateColumn(name, newType).updateColumnDoc(name, newDoc);
+ }
/**
* Update a column in the schema to a new primitive type.
* <p>
* The name is used to find the column to update using {@link Schema#findField(String)}.
* <p>
- * Only updates that widen types are allowed.
- * <p>
* Columns may be updated and renamed in the same schema update.
*
* @param name name of the column to rename
- * @param newType replacement type for the column
* @param newDoc replacement documentation string for the column
* @return this for method chaining
* @throws IllegalArgumentException If name doesn't identify a column in the schema or if this
* change introduces a type incompatibility or if it conflicts
* with other additions, renames, or updates.
*/
- default UpdateSchema updateColumn(String name, Type.PrimitiveType newType, String newDoc) {
- return updateColumn(name, newType).updateColumnDoc(name, newDoc);
- }
+ UpdateSchema updateColumnDoc(String name, String newDoc);
/**
* Delete a column in the schema.
diff --git a/api/src/main/java/org/apache/iceberg/exceptions/RuntimeIOException.java b/api/src/main/java/org/apache/iceberg/exceptions/RuntimeIOException.java
index 62fc8f1..daa42d4 100644
--- a/api/src/main/java/org/apache/iceberg/exceptions/RuntimeIOException.java
+++ b/api/src/main/java/org/apache/iceberg/exceptions/RuntimeIOException.java
@@ -25,12 +25,12 @@ import java.io.IOException;
* Exception used to wrap {@link IOException} as a {@link RuntimeException} and add context.
*/
public class RuntimeIOException extends RuntimeException {
- public RuntimeIOException(IOException e) {
- super(e);
+ public RuntimeIOException(IOException cause) {
+ super(cause);
}
- public RuntimeIOException(IOException e, String message, Object... args) {
- super(String.format(message, args), e);
+ public RuntimeIOException(IOException cause, String message, Object... args) {
+ super(String.format(message, args), cause);
}
public RuntimeIOException(String message, Object...args) {
diff --git a/api/src/main/java/org/apache/iceberg/expressions/BoundReference.java b/api/src/main/java/org/apache/iceberg/expressions/BoundReference.java
index 1e076d4..192d365 100644
--- a/api/src/main/java/org/apache/iceberg/expressions/BoundReference.java
+++ b/api/src/main/java/org/apache/iceberg/expressions/BoundReference.java
@@ -36,15 +36,15 @@ public class BoundReference<T> implements Reference {
this.type = struct.fields().get(pos).type();
}
- private int find(int fieldId, Types.StructType struct) {
+ private int find(int id, Types.StructType struct) {
List<Types.NestedField> fields = struct.fields();
for (int i = 0; i < fields.size(); i += 1) {
- if (fields.get(i).fieldId() == fieldId) {
+ if (fields.get(i).fieldId() == id) {
return i;
}
}
throw new ValidationException(
- "Cannot find top-level field id %d in struct: %s", fieldId, struct);
+ "Cannot find top-level field id %d in struct: %s", id, struct);
}
public Type type() {
diff --git a/api/src/main/java/org/apache/iceberg/expressions/Expression.java b/api/src/main/java/org/apache/iceberg/expressions/Expression.java
index 2c7534b..124e612 100644
--- a/api/src/main/java/org/apache/iceberg/expressions/Expression.java
+++ b/api/src/main/java/org/apache/iceberg/expressions/Expression.java
@@ -75,6 +75,8 @@ public interface Expression extends Serializable {
/**
* @return the equivalent operation when the left and right operands are exchanged
*/
+ // Allow flipLR as a name because it's a public API
+ @SuppressWarnings("checkstyle:AbbreviationAsWordInName")
public Operation flipLR() {
switch (this) {
case LT:
diff --git a/api/src/main/java/org/apache/iceberg/expressions/ExpressionVisitors.java b/api/src/main/java/org/apache/iceberg/expressions/ExpressionVisitors.java
index 9df28f3..3e6b791 100644
--- a/api/src/main/java/org/apache/iceberg/expressions/ExpressionVisitors.java
+++ b/api/src/main/java/org/apache/iceberg/expressions/ExpressionVisitors.java
@@ -23,6 +23,9 @@ package org.apache.iceberg.expressions;
* Utils for traversing {@link Expression expressions}.
*/
public class ExpressionVisitors {
+
+ private ExpressionVisitors() {}
+
public abstract static class ExpressionVisitor<R> {
public R alwaysTrue() {
return null;
diff --git a/api/src/main/java/org/apache/iceberg/expressions/Literals.java b/api/src/main/java/org/apache/iceberg/expressions/Literals.java
index 4e2d4a4..3216e0e 100644
--- a/api/src/main/java/org/apache/iceberg/expressions/Literals.java
+++ b/api/src/main/java/org/apache/iceberg/expressions/Literals.java
@@ -116,7 +116,7 @@ class Literals {
private static final Comparator<? extends Comparable> CMP =
Comparators.<Comparable>nullsFirst().thenComparing(Comparator.naturalOrder());
- public ComparableLiteral(C value) {
+ ComparableLiteral(C value) {
super(value);
}
@@ -340,7 +340,7 @@ class Literals {
@SuppressWarnings("unchecked")
public <T> Literal<T> to(Type type) {
if (type.typeId() == Type.TypeID.TIME) {
- return (Literal<T>) this ;
+ return (Literal<T>) this;
}
return null;
}
diff --git a/api/src/main/java/org/apache/iceberg/expressions/NamedReference.java b/api/src/main/java/org/apache/iceberg/expressions/NamedReference.java
index f5fcc8e..8a88ce3 100644
--- a/api/src/main/java/org/apache/iceberg/expressions/NamedReference.java
+++ b/api/src/main/java/org/apache/iceberg/expressions/NamedReference.java
@@ -22,7 +22,7 @@ package org.apache.iceberg.expressions;
import com.google.common.base.Preconditions;
public class NamedReference implements Reference {
- public final String name;
+ private final String name;
NamedReference(String name) {
Preconditions.checkNotNull(name, "Name cannot be null");
diff --git a/api/src/main/java/org/apache/iceberg/expressions/Projections.java b/api/src/main/java/org/apache/iceberg/expressions/Projections.java
index 9ebfae9..d27f75c 100644
--- a/api/src/main/java/org/apache/iceberg/expressions/Projections.java
+++ b/api/src/main/java/org/apache/iceberg/expressions/Projections.java
@@ -43,7 +43,7 @@ public class Projections {
* A strict projection guarantees that if a partition matches a projected expression, then all
* rows in that partition will match the original expression.
*/
- public static abstract class ProjectionEvaluator extends ExpressionVisitor<Expression> {
+ public abstract static class ProjectionEvaluator extends ExpressionVisitor<Expression> {
/**
* Project the given row expression to a partition expression.
*
@@ -134,8 +134,8 @@ public class Projections {
}
private static class BaseProjectionEvaluator extends ProjectionEvaluator {
- final PartitionSpec spec;
- final boolean caseSensitive;
+ private final PartitionSpec spec;
+ private final boolean caseSensitive;
private BaseProjectionEvaluator(PartitionSpec spec, boolean caseSensitive) {
this.spec = spec;
@@ -187,6 +187,14 @@ public class Projections {
return bound;
}
+
+ PartitionSpec spec() {
+ return spec;
+ }
+
+ boolean isCaseSensitive() {
+ return caseSensitive;
+ }
}
private static class InclusiveProjection extends BaseProjectionEvaluator {
@@ -197,7 +205,7 @@ public class Projections {
@Override
@SuppressWarnings("unchecked")
public <T> Expression predicate(BoundPredicate<T> pred) {
- PartitionField part = spec.getFieldBySourceId(pred.ref().fieldId());
+ PartitionField part = spec().getFieldBySourceId(pred.ref().fieldId());
if (part == null) {
// the predicate has no partition column
return alwaysTrue();
@@ -222,7 +230,7 @@ public class Projections {
@Override
@SuppressWarnings("unchecked")
public <T> Expression predicate(BoundPredicate<T> pred) {
- PartitionField part = spec.getFieldBySourceId(pred.ref().fieldId());
+ PartitionField part = spec().getFieldBySourceId(pred.ref().fieldId());
if (part == null) {
// the predicate has no partition column
return alwaysFalse();
diff --git a/api/src/main/java/org/apache/iceberg/expressions/ResidualEvaluator.java b/api/src/main/java/org/apache/iceberg/expressions/ResidualEvaluator.java
index 459d207..867c7a8 100644
--- a/api/src/main/java/org/apache/iceberg/expressions/ResidualEvaluator.java
+++ b/api/src/main/java/org/apache/iceberg/expressions/ResidualEvaluator.java
@@ -78,8 +78,8 @@ public class ResidualEvaluator implements Serializable {
private class ResidualVisitor extends ExpressionVisitors.BoundExpressionVisitor<Expression> {
private StructLike struct;
- private Expression eval(StructLike struct) {
- this.struct = struct;
+ private Expression eval(StructLike structLike) {
+ this.struct = structLike;
return ExpressionVisitors.visit(expr, this);
}
diff --git a/api/src/main/java/org/apache/iceberg/expressions/SerializationProxies.java b/api/src/main/java/org/apache/iceberg/expressions/SerializationProxies.java
index 78da881..6fd7416 100644
--- a/api/src/main/java/org/apache/iceberg/expressions/SerializationProxies.java
+++ b/api/src/main/java/org/apache/iceberg/expressions/SerializationProxies.java
@@ -35,10 +35,10 @@ class SerializationProxies {
/**
* Constructor for Java serialization.
*/
- public ConstantExpressionProxy() {
+ ConstantExpressionProxy() {
}
- public ConstantExpressionProxy(boolean trueOrFalse) {
+ ConstantExpressionProxy(boolean trueOrFalse) {
this.trueOrFalse = trueOrFalse;
}
@@ -63,7 +63,7 @@ class SerializationProxies {
}
Object readResolve() throws ObjectStreamException {
- return new Literals.BinaryLiteral(ByteBuffer.wrap(bytes));
+ return new Literals.BinaryLiteral(ByteBuffer.wrap(bytes()));
}
}
@@ -71,7 +71,7 @@ class SerializationProxies {
* Replacement for FixedLiteral in Java Serialization.
*/
static class FixedLiteralProxy implements Serializable {
- protected byte[] bytes;
+ private byte[] bytes;
/**
* Constructor for Java serialization.
@@ -87,5 +87,9 @@ class SerializationProxies {
Object readResolve() throws ObjectStreamException {
return new Literals.FixedLiteral(ByteBuffer.wrap(bytes));
}
+
+ protected byte[] bytes() {
+ return bytes;
+ }
}
}
diff --git a/api/src/main/java/org/apache/iceberg/io/CloseableGroup.java b/api/src/main/java/org/apache/iceberg/io/CloseableGroup.java
index 8b5a977..4eeab7b 100644
--- a/api/src/main/java/org/apache/iceberg/io/CloseableGroup.java
+++ b/api/src/main/java/org/apache/iceberg/io/CloseableGroup.java
@@ -22,11 +22,11 @@ package org.apache.iceberg.io;
import com.google.common.collect.Lists;
import java.io.Closeable;
import java.io.IOException;
+import java.util.Deque;
import java.util.Iterator;
-import java.util.LinkedList;
public abstract class CloseableGroup implements Closeable {
- private final LinkedList<Closeable> closeables = Lists.newLinkedList();
+ private final Deque<Closeable> closeables = Lists.newLinkedList();
protected void addCloseable(Closeable closeable) {
closeables.add(closeable);
@@ -45,7 +45,7 @@ public abstract class CloseableGroup implements Closeable {
static class ClosingIterable<T> extends CloseableGroup implements CloseableIterable<T> {
private final Iterable<T> iterable;
- public ClosingIterable(Iterable<T> iterable, Iterable<Closeable> closeables) {
+ ClosingIterable(Iterable<T> iterable, Iterable<Closeable> closeables) {
this.iterable = iterable;
if (iterable instanceof Closeable) {
addCloseable((Closeable) iterable);
diff --git a/api/src/main/java/org/apache/iceberg/transforms/Bucket.java b/api/src/main/java/org/apache/iceberg/transforms/Bucket.java
index b3dc422..af62a98 100644
--- a/api/src/main/java/org/apache/iceberg/transforms/Bucket.java
+++ b/api/src/main/java/org/apache/iceberg/transforms/Bucket.java
@@ -20,7 +20,6 @@
package org.apache.iceberg.transforms;
import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Charsets;
import com.google.common.base.Objects;
import com.google.common.collect.Sets;
import com.google.common.hash.HashFunction;
@@ -28,6 +27,7 @@ import com.google.common.hash.Hashing;
import java.math.BigDecimal;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
+import java.nio.charset.StandardCharsets;
import java.util.Set;
import java.util.UUID;
import org.apache.iceberg.expressions.BoundPredicate;
@@ -42,37 +42,37 @@ abstract class Bucket<T> implements Transform<T, Integer> {
private static final HashFunction MURMUR3 = Hashing.murmur3_32();
@SuppressWarnings("unchecked")
- static <T> Bucket<T> get(Type type, int N) {
+ static <T> Bucket<T> get(Type type, int numBuckets) {
switch (type.typeId()) {
case DATE:
case INTEGER:
- return (Bucket<T>) new BucketInteger(N);
+ return (Bucket<T>) new BucketInteger(numBuckets);
case TIME:
case TIMESTAMP:
case LONG:
- return (Bucket<T>) new BucketLong(N);
+ return (Bucket<T>) new BucketLong(numBuckets);
case DECIMAL:
- return (Bucket<T>) new BucketDecimal(N);
+ return (Bucket<T>) new BucketDecimal(numBuckets);
case STRING:
- return (Bucket<T>) new BucketString(N);
+ return (Bucket<T>) new BucketString(numBuckets);
case FIXED:
case BINARY:
- return (Bucket<T>) new BucketByteBuffer(N);
+ return (Bucket<T>) new BucketByteBuffer(numBuckets);
case UUID:
- return (Bucket<T>) new BucketUUID(N);
+ return (Bucket<T>) new BucketUUID(numBuckets);
default:
throw new IllegalArgumentException("Cannot bucket by type: " + type);
}
}
- private final int N;
+ private final int numBuckets;
- private Bucket(int N) {
- this.N = N;
+ private Bucket(int numBuckets) {
+ this.numBuckets = numBuckets;
}
public Integer numBuckets() {
- return N;
+ return numBuckets;
}
@VisibleForTesting
@@ -80,7 +80,7 @@ abstract class Bucket<T> implements Transform<T, Integer> {
@Override
public Integer apply(T value) {
- return (hash(value) & Integer.MAX_VALUE) % N;
+ return (hash(value) & Integer.MAX_VALUE) % numBuckets;
}
@Override
@@ -93,17 +93,17 @@ abstract class Bucket<T> implements Transform<T, Integer> {
}
Bucket<?> bucket = (Bucket<?>) o;
- return N == bucket.N;
+ return numBuckets == bucket.numBuckets;
}
@Override
public int hashCode() {
- return Objects.hashCode(N);
+ return Objects.hashCode(numBuckets);
}
@Override
public String toString() {
- return "bucket[" + N + "]";
+ return "bucket[" + numBuckets + "]";
}
@Override
@@ -141,8 +141,8 @@ abstract class Bucket<T> implements Transform<T, Integer> {
}
private static class BucketInteger extends Bucket<Integer> {
- private BucketInteger(int N) {
- super(N);
+ private BucketInteger(int numBuckets) {
+ super(numBuckets);
}
public int hash(Integer value) {
@@ -156,8 +156,8 @@ abstract class Bucket<T> implements Transform<T, Integer> {
}
private static class BucketLong extends Bucket<Long> {
- private BucketLong(int N) {
- super(N);
+ private BucketLong(int numBuckets) {
+ super(numBuckets);
}
public int hash(Long value) {
@@ -166,19 +166,18 @@ abstract class Bucket<T> implements Transform<T, Integer> {
@Override
public boolean canTransform(Type type) {
- return (
- type.typeId() == TypeID.LONG ||
+ return type.typeId() == TypeID.LONG ||
type.typeId() == TypeID.TIME ||
- type.typeId() == TypeID.TIMESTAMP
- );
+ type.typeId() == TypeID.TIMESTAMP;
+
}
}
// bucketing by Double is not allowed by the spec, but this has the float hash implementation
static class BucketFloat extends Bucket<Float> {
// used by tests because the factory method will not instantiate a bucket function for floats
- BucketFloat(int N) {
- super(N);
+ BucketFloat(int numBuckets) {
+ super(numBuckets);
}
public int hash(Float value) {
@@ -194,8 +193,8 @@ abstract class Bucket<T> implements Transform<T, Integer> {
// bucketing by Double is not allowed by the spec, but this has the double hash implementation
static class BucketDouble extends Bucket<Double> {
// used by tests because the factory method will not instantiate a bucket function for doubles
- BucketDouble(int N) {
- super(N);
+ BucketDouble(int numBuckets) {
+ super(numBuckets);
}
public int hash(Double value) {
@@ -209,12 +208,12 @@ abstract class Bucket<T> implements Transform<T, Integer> {
}
private static class BucketString extends Bucket<CharSequence> {
- private BucketString(int N) {
- super(N);
+ private BucketString(int numBuckets) {
+ super(numBuckets);
}
public int hash(CharSequence value) {
- return MURMUR3.hashString(value, Charsets.UTF_8).asInt();
+ return MURMUR3.hashString(value, StandardCharsets.UTF_8).asInt();
}
@Override
@@ -227,8 +226,8 @@ abstract class Bucket<T> implements Transform<T, Integer> {
private static final Set<TypeID> SUPPORTED_TYPES = Sets.newHashSet(
TypeID.BINARY, TypeID.FIXED);
- private BucketBytes(int N) {
- super(N);
+ private BucketBytes(int numBuckets) {
+ super(numBuckets);
}
public int hash(byte[] value) {
@@ -245,8 +244,8 @@ abstract class Bucket<T> implements Transform<T, Integer> {
private static final Set<TypeID> SUPPORTED_TYPES = Sets.newHashSet(
TypeID.BINARY, TypeID.FIXED);
- private BucketByteBuffer(int N) {
- super(N);
+ private BucketByteBuffer(int numBuckets) {
+ super(numBuckets);
}
public int hash(ByteBuffer value) {
@@ -280,8 +279,8 @@ abstract class Bucket<T> implements Transform<T, Integer> {
return buffer;
});
- private BucketUUID(int N) {
- super(N);
+ private BucketUUID(int numBuckets) {
+ super(numBuckets);
}
public int hash(UUID value) {
@@ -299,8 +298,8 @@ abstract class Bucket<T> implements Transform<T, Integer> {
}
private static class BucketDecimal extends Bucket<BigDecimal> {
- private BucketDecimal(int N) {
- super(N);
+ private BucketDecimal(int numBuckets) {
+ super(numBuckets);
}
public int hash(BigDecimal value) {
diff --git a/api/src/main/java/org/apache/iceberg/transforms/Dates.java b/api/src/main/java/org/apache/iceberg/transforms/Dates.java
index f829637..a57d6d9 100644
--- a/api/src/main/java/org/apache/iceberg/transforms/Dates.java
+++ b/api/src/main/java/org/apache/iceberg/transforms/Dates.java
@@ -65,15 +65,15 @@ enum Dates implements Transform<Integer, Integer> {
}
@Override
- public UnboundPredicate<Integer> project(String name, BoundPredicate<Integer> pred) {
+ public UnboundPredicate<Integer> project(String fieldName, BoundPredicate<Integer> pred) {
if (pred.op() == NOT_NULL || pred.op() == IS_NULL) {
- return Expressions.predicate(pred.op(), name);
+ return Expressions.predicate(pred.op(), fieldName);
}
- return ProjectionUtil.truncateInteger(name, pred, this);
+ return ProjectionUtil.truncateInteger(fieldName, pred, this);
}
@Override
- public UnboundPredicate<Integer> projectStrict(String name, BoundPredicate<Integer> predicate) {
+ public UnboundPredicate<Integer> projectStrict(String fieldName, BoundPredicate<Integer> predicate) {
return null;
}
diff --git a/api/src/main/java/org/apache/iceberg/transforms/Identity.java b/api/src/main/java/org/apache/iceberg/transforms/Identity.java
index 2f1ffa8..ef1037b 100644
--- a/api/src/main/java/org/apache/iceberg/transforms/Identity.java
+++ b/api/src/main/java/org/apache/iceberg/transforms/Identity.java
@@ -45,8 +45,8 @@ class Identity<T> implements Transform<T, T> {
}
@Override
- public boolean canTransform(Type type) {
- return type.isPrimitiveType();
+ public boolean canTransform(Type maybePrimitive) {
+ return maybePrimitive.isPrimitiveType();
}
@Override
diff --git a/api/src/main/java/org/apache/iceberg/transforms/ProjectionUtil.java b/api/src/main/java/org/apache/iceberg/transforms/ProjectionUtil.java
index c5fd461..04da036 100644
--- a/api/src/main/java/org/apache/iceberg/transforms/ProjectionUtil.java
+++ b/api/src/main/java/org/apache/iceberg/transforms/ProjectionUtil.java
@@ -28,6 +28,9 @@ import org.apache.iceberg.expressions.UnboundPredicate;
import static org.apache.iceberg.expressions.Expressions.predicate;
class ProjectionUtil {
+
+ private ProjectionUtil() {}
+
static <T> UnboundPredicate<T> truncateInteger(
String name, BoundPredicate<Integer> pred, Transform<Integer, T> transform) {
int boundary = pred.literal().value();
diff --git a/api/src/main/java/org/apache/iceberg/transforms/Timestamps.java b/api/src/main/java/org/apache/iceberg/transforms/Timestamps.java
index b50b313..1b5fc1d 100644
--- a/api/src/main/java/org/apache/iceberg/transforms/Timestamps.java
+++ b/api/src/main/java/org/apache/iceberg/transforms/Timestamps.java
@@ -67,15 +67,15 @@ enum Timestamps implements Transform<Long, Integer> {
}
@Override
- public UnboundPredicate<Integer> project(String name, BoundPredicate<Long> pred) {
+ public UnboundPredicate<Integer> project(String fieldName, BoundPredicate<Long> pred) {
if (pred.op() == NOT_NULL || pred.op() == IS_NULL) {
- return Expressions.predicate(pred.op(), name);
+ return Expressions.predicate(pred.op(), fieldName);
}
- return ProjectionUtil.truncateLong(name, pred, this);
+ return ProjectionUtil.truncateLong(fieldName, pred, this);
}
@Override
- public UnboundPredicate<Integer> projectStrict(String name, BoundPredicate<Long> predicate) {
+ public UnboundPredicate<Integer> projectStrict(String fieldName, BoundPredicate<Long> predicate) {
return null;
}
diff --git a/api/src/main/java/org/apache/iceberg/transforms/TransformUtil.java b/api/src/main/java/org/apache/iceberg/transforms/TransformUtil.java
index cd6f21c..e3ac439 100644
--- a/api/src/main/java/org/apache/iceberg/transforms/TransformUtil.java
+++ b/api/src/main/java/org/apache/iceberg/transforms/TransformUtil.java
@@ -19,8 +19,8 @@
package org.apache.iceberg.transforms;
-import com.google.common.base.Charsets;
import java.nio.ByteBuffer;
+import java.nio.charset.StandardCharsets;
import java.time.Instant;
import java.time.LocalTime;
import java.time.OffsetDateTime;
@@ -29,6 +29,9 @@ import java.time.temporal.ChronoUnit;
import java.util.Base64;
class TransformUtil {
+
+ private TransformUtil() {}
+
private static final OffsetDateTime EPOCH = Instant.ofEpochSecond(0).atOffset(ZoneOffset.UTC);
private static final int EPOCH_YEAR = EPOCH.getYear();
@@ -66,6 +69,6 @@ class TransformUtil {
static String base64encode(ByteBuffer buffer) {
// use direct encoding because all of the encoded bytes are in ASCII
- return Charsets.ISO_8859_1.decode(Base64.getEncoder().encode(buffer)).toString();
+ return StandardCharsets.ISO_8859_1.decode(Base64.getEncoder().encode(buffer)).toString();
}
}
diff --git a/api/src/main/java/org/apache/iceberg/transforms/Transforms.java b/api/src/main/java/org/apache/iceberg/transforms/Transforms.java
index 1881d25..d94b410 100644
--- a/api/src/main/java/org/apache/iceberg/transforms/Transforms.java
+++ b/api/src/main/java/org/apache/iceberg/transforms/Transforms.java
@@ -42,14 +42,14 @@ public class Transforms {
private static final Pattern HAS_WIDTH = Pattern.compile("(\\w+)\\[(\\d+)\\]");
public static Transform<?, ?> fromString(Type type, String transform) {
- Matcher width = HAS_WIDTH.matcher(transform);
- if (width.matches()) {
- String name = width.group(1);
- int w = Integer.parseInt(width.group(2));
+ Matcher widthMatcher = HAS_WIDTH.matcher(transform);
+ if (widthMatcher.matches()) {
+ String name = widthMatcher.group(1);
+ int parsedWidth = Integer.parseInt(widthMatcher.group(2));
if (name.equalsIgnoreCase("truncate")) {
- return Truncate.get(type, w);
+ return Truncate.get(type, parsedWidth);
} else if (name.equals("bucket")) {
- return Bucket.get(type, w);
+ return Bucket.get(type, parsedWidth);
}
}
diff --git a/api/src/main/java/org/apache/iceberg/transforms/Truncate.java b/api/src/main/java/org/apache/iceberg/transforms/Truncate.java
index acf0df0..d65d646 100644
--- a/api/src/main/java/org/apache/iceberg/transforms/Truncate.java
+++ b/api/src/main/java/org/apache/iceberg/transforms/Truncate.java
@@ -53,10 +53,10 @@ abstract class Truncate<T> implements Transform<T, T> {
}
}
- abstract public Integer width();
+ public abstract Integer width();
@Override
- abstract public T apply(T value);
+ public abstract T apply(T value);
@Override
public Type getResultType(Type sourceType) {
@@ -64,20 +64,20 @@ abstract class Truncate<T> implements Transform<T, T> {
}
private static class TruncateInteger extends Truncate<Integer> {
- private final int W;
+ private final int width;
private TruncateInteger(int width) {
- this.W = width;
+ this.width = width;
}
@Override
public Integer width() {
- return W;
+ return width;
}
@Override
public Integer apply(Integer value) {
- return value - (((value % W) + W) % W);
+ return value - (((value % width) + width) % width);
}
@Override
@@ -146,35 +146,35 @@ abstract class Truncate<T> implements Transform<T, T> {
}
TruncateInteger that = (TruncateInteger) o;
- return W == that.W;
+ return width == that.width;
}
@Override
public int hashCode() {
- return Objects.hashCode(W);
+ return Objects.hashCode(width);
}
@Override
public String toString() {
- return "truncate[" + W + "]";
+ return "truncate[" + width + "]";
}
}
private static class TruncateLong extends Truncate<Long> {
- private final int W;
+ private final int width;
private TruncateLong(int width) {
- this.W = width;
+ this.width = width;
}
@Override
public Integer width() {
- return W;
+ return width;
}
@Override
public Long apply(Long value) {
- return value - (((value % W) + W) % W);
+ return value - (((value % width) + width) % width);
}
@Override
@@ -205,35 +205,35 @@ abstract class Truncate<T> implements Transform<T, T> {
}
TruncateLong that = (TruncateLong) o;
- return W == that.W;
+ return width == that.width;
}
@Override
public int hashCode() {
- return Objects.hashCode(W);
+ return Objects.hashCode(width);
}
@Override
public String toString() {
- return "truncate[" + W + "]";
+ return "truncate[" + width + "]";
}
}
private static class TruncateString extends Truncate<CharSequence> {
- private final int L;
+ private final int length;
private TruncateString(int length) {
- this.L = length;
+ this.length = length;
}
@Override
public Integer width() {
- return L;
+ return length;
}
@Override
public CharSequence apply(CharSequence value) {
- return value.subSequence(0, Math.min(value.length(), L));
+ return value.subSequence(0, Math.min(value.length(), length));
}
@Override
@@ -266,36 +266,36 @@ abstract class Truncate<T> implements Transform<T, T> {
}
TruncateString that = (TruncateString) o;
- return L == that.L;
+ return length == that.length;
}
@Override
public int hashCode() {
- return Objects.hashCode(L);
+ return Objects.hashCode(length);
}
@Override
public String toString() {
- return "truncate[" + L + "]";
+ return "truncate[" + length + "]";
}
}
private static class TruncateByteBuffer extends Truncate<ByteBuffer> {
- private final int L;
+ private final int length;
private TruncateByteBuffer(int length) {
- this.L = length;
+ this.length = length;
}
@Override
public Integer width() {
- return L;
+ return length;
}
@Override
public ByteBuffer apply(ByteBuffer value) {
ByteBuffer ret = value.duplicate();
- ret.limit(Math.min(value.limit(), value.position() + L));
+ ret.limit(Math.min(value.limit(), value.position() + length));
return ret;
}
@@ -329,12 +329,12 @@ abstract class Truncate<T> implements Transform<T, T> {
}
TruncateByteBuffer that = (TruncateByteBuffer) o;
- return L == that.L;
+ return length == that.length;
}
@Override
public int hashCode() {
- return Objects.hashCode(L);
+ return Objects.hashCode(length);
}
@Override
@@ -344,7 +344,7 @@ abstract class Truncate<T> implements Transform<T, T> {
@Override
public String toString() {
- return "truncate[" + L + "]";
+ return "truncate[" + length + "]";
}
}
diff --git a/api/src/main/java/org/apache/iceberg/types/CheckCompatibility.java b/api/src/main/java/org/apache/iceberg/types/CheckCompatibility.java
index 9c65850..3888d39 100644
--- a/api/src/main/java/org/apache/iceberg/types/CheckCompatibility.java
+++ b/api/src/main/java/org/apache/iceberg/types/CheckCompatibility.java
@@ -29,8 +29,6 @@ import java.util.Map;
import java.util.function.Supplier;
import org.apache.iceberg.Schema;
-import static org.apache.iceberg.types.TypeUtil.isPromotionAllowed;
-
public class CheckCompatibility extends TypeUtil.CustomOrderSchemaVisitor<List<String>> {
/**
* Returns a list of compatibility errors for writing with the given write schema.
@@ -217,7 +215,7 @@ public class CheckCompatibility extends TypeUtil.CustomOrderSchemaVisitor<List<S
currentType.typeId().toString().toLowerCase(Locale.ENGLISH), readPrimitive));
}
- if (!isPromotionAllowed(currentType.asPrimitiveType(), readPrimitive)) {
+ if (!TypeUtil.isPromotionAllowed(currentType.asPrimitiveType(), readPrimitive)) {
return ImmutableList.of(String.format(": %s cannot be promoted to %s",
currentType, readPrimitive));
}
diff --git a/api/src/main/java/org/apache/iceberg/types/Comparators.java b/api/src/main/java/org/apache/iceberg/types/Comparators.java
index d885f9a..57cfc28 100644
--- a/api/src/main/java/org/apache/iceberg/types/Comparators.java
+++ b/api/src/main/java/org/apache/iceberg/types/Comparators.java
@@ -24,6 +24,9 @@ import java.nio.ByteBuffer;
import java.util.Comparator;
public class Comparators {
+
+ private Comparators() {}
+
private static final ImmutableMap<Type.PrimitiveType, Comparator<?>> COMPARATORS = ImmutableMap
.<Type.PrimitiveType, Comparator<?>>builder()
.put(Types.BooleanType.get(), Comparator.naturalOrder())
@@ -130,7 +133,7 @@ public class Comparators {
private final Comparator<T> first;
private final Comparator<? super T> second;
- public NullSafeChainedComparator(Comparator<T> first, Comparator<? super T> second) {
+ NullSafeChainedComparator(Comparator<T> first, Comparator<? super T> second) {
this.first = first;
this.second = second;
}
diff --git a/api/src/main/java/org/apache/iceberg/types/Conversions.java b/api/src/main/java/org/apache/iceberg/types/Conversions.java
index ed795ca..e2c728d 100644
--- a/api/src/main/java/org/apache/iceberg/types/Conversions.java
+++ b/api/src/main/java/org/apache/iceberg/types/Conversions.java
@@ -19,7 +19,6 @@
package org.apache.iceberg.types;
-import com.google.common.base.Charsets;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.nio.ByteBuffer;
@@ -28,11 +27,15 @@ import java.nio.CharBuffer;
import java.nio.charset.CharacterCodingException;
import java.nio.charset.CharsetDecoder;
import java.nio.charset.CharsetEncoder;
+import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.UUID;
import org.apache.iceberg.exceptions.RuntimeIOException;
public class Conversions {
+
+ private Conversions() {}
+
private static final String HIVE_NULL = "__HIVE_DEFAULT_PARTITION__";
public static Object fromPartitionString(Type type, String asString) {
@@ -58,9 +61,9 @@ public class Conversions {
case FIXED:
Types.FixedType fixed = (Types.FixedType) type;
return Arrays.copyOf(
- asString.getBytes(Charsets.UTF_8), fixed.length());
+ asString.getBytes(StandardCharsets.UTF_8), fixed.length());
case BINARY:
- return asString.getBytes(Charsets.UTF_8);
+ return asString.getBytes(StandardCharsets.UTF_8);
case DECIMAL:
return new BigDecimal(asString);
default:
@@ -70,9 +73,9 @@ public class Conversions {
}
private static final ThreadLocal<CharsetEncoder> ENCODER =
- ThreadLocal.withInitial(Charsets.UTF_8::newEncoder);
+ ThreadLocal.withInitial(StandardCharsets.UTF_8::newEncoder);
private static final ThreadLocal<CharsetDecoder> DECODER =
- ThreadLocal.withInitial(Charsets.UTF_8::newDecoder);
+ ThreadLocal.withInitial(StandardCharsets.UTF_8::newDecoder);
public static ByteBuffer toByteBuffer(Type type, Object value) {
switch (type.typeId()) {
@@ -125,7 +128,7 @@ public class Conversions {
}
switch (type.typeId()) {
case BOOLEAN:
- return (tmp.get() != 0x00);
+ return tmp.get() != 0x00;
case INTEGER:
case DATE:
return tmp.getInt();
diff --git a/api/src/main/java/org/apache/iceberg/types/IndexById.java b/api/src/main/java/org/apache/iceberg/types/IndexById.java
index 0f36836..d1bed5d 100644
--- a/api/src/main/java/org/apache/iceberg/types/IndexById.java
+++ b/api/src/main/java/org/apache/iceberg/types/IndexById.java
@@ -33,12 +33,14 @@ class IndexById extends TypeUtil.SchemaVisitor<Map<Integer, Types.NestedField>>
}
@Override
- public Map<Integer, Types.NestedField> struct(Types.StructType struct, List<Map<Integer, Types.NestedField>> fieldResults) {
+ public Map<Integer, Types.NestedField> struct(
+ Types.StructType struct, List<Map<Integer, Types.NestedField>> fieldResults) {
return index;
}
@Override
- public Map<Integer, Types.NestedField> field(Types.NestedField field, Map<Integer, Types.NestedField> fieldResult) {
+ public Map<Integer, Types.NestedField> field(
+ Types.NestedField field, Map<Integer, Types.NestedField> fieldResult) {
index.put(field.fieldId(), field);
return null;
}
@@ -52,7 +54,8 @@ class IndexById extends TypeUtil.SchemaVisitor<Map<Integer, Types.NestedField>>
}
@Override
- public Map<Integer, Types.NestedField> map(Types.MapType map, Map<Integer, Types.NestedField> keyResult, Map<Integer, Types.NestedField> valueResult) {
+ public Map<Integer, Types.NestedField> map(
+ Types.MapType map, Map<Integer, Types.NestedField> keyResult, Map<Integer, Types.NestedField> valueResult) {
for (Types.NestedField field : map.fields()) {
index.put(field.fieldId(), field);
}
diff --git a/api/src/main/java/org/apache/iceberg/types/IndexByName.java b/api/src/main/java/org/apache/iceberg/types/IndexByName.java
index 4acbcaa..112d16d 100644
--- a/api/src/main/java/org/apache/iceberg/types/IndexByName.java
+++ b/api/src/main/java/org/apache/iceberg/types/IndexByName.java
@@ -64,8 +64,8 @@ public class IndexByName extends TypeUtil.SchemaVisitor<Map<String, Integer>> {
private void addField(String name, int fieldId) {
String fullName = name;
- if (!fieldNames.isEmpty()) {
- fullName = DOT.join(DOT.join(fieldNames.descendingIterator()), name);
+ if (!fieldNames().isEmpty()) {
+ fullName = DOT.join(DOT.join(fieldNames().descendingIterator()), name);
}
nameToId.put(fullName, fieldId);
}
diff --git a/api/src/main/java/org/apache/iceberg/types/PruneColumns.java b/api/src/main/java/org/apache/iceberg/types/PruneColumns.java
index b303282..a816edf 100644
--- a/api/src/main/java/org/apache/iceberg/types/PruneColumns.java
+++ b/api/src/main/java/org/apache/iceberg/types/PruneColumns.java
@@ -27,7 +27,7 @@ import org.apache.iceberg.Schema;
class PruneColumns extends TypeUtil.SchemaVisitor<Type> {
private final Set<Integer> selected;
- public PruneColumns(Set<Integer> selected) {
+ PruneColumns(Set<Integer> selected) {
this.selected = selected;
}
diff --git a/api/src/main/java/org/apache/iceberg/types/ReassignIds.java b/api/src/main/java/org/apache/iceberg/types/ReassignIds.java
index 98cced6..2a73145 100644
--- a/api/src/main/java/org/apache/iceberg/types/ReassignIds.java
+++ b/api/src/main/java/org/apache/iceberg/types/ReassignIds.java
@@ -46,7 +46,7 @@ class ReassignIds extends TypeUtil.CustomOrderSchemaVisitor<Type> {
@Override
public Type struct(Types.StructType struct, Iterable<Type> fieldTypes) {
Preconditions.checkNotNull(sourceType, "Evaluation must start with a schema.");
- Preconditions.checkArgument(sourceType.isStructType(), "Not a struct: " + sourceType);
+ Preconditions.checkArgument(sourceType.isStructType(), "Not a struct: %s", sourceType);
Types.StructType sourceStruct = sourceType.asStructType();
List<Types.NestedField> fields = struct.fields();
@@ -69,7 +69,7 @@ class ReassignIds extends TypeUtil.CustomOrderSchemaVisitor<Type> {
@Override
public Type field(Types.NestedField field, Supplier<Type> future) {
- Preconditions.checkArgument(sourceType.isStructType(), "Not a struct: " + sourceType);
+ Preconditions.checkArgument(sourceType.isStructType(), "Not a struct: %s", sourceType);
Types.StructType sourceStruct = sourceType.asStructType();
Types.NestedField sourceField = sourceStruct.field(field.name());
@@ -84,7 +84,7 @@ class ReassignIds extends TypeUtil.CustomOrderSchemaVisitor<Type> {
@Override
public Type list(Types.ListType list, Supplier<Type> elementTypeFuture) {
- Preconditions.checkArgument(sourceType.isListType(), "Not a list: " + sourceType);
+ Preconditions.checkArgument(sourceType.isListType(), "Not a list: %s", sourceType);
Types.ListType sourceList = sourceType.asListType();
int sourceElementId = sourceList.elementId();
@@ -104,7 +104,7 @@ class ReassignIds extends TypeUtil.CustomOrderSchemaVisitor<Type> {
@Override
public Type map(Types.MapType map, Supplier<Type> keyTypeFuture, Supplier<Type> valueTypeFuture) {
- Preconditions.checkArgument(sourceType.isMapType(), "Not a map: " + sourceType);
+ Preconditions.checkArgument(sourceType.isMapType(), "Not a map: %s", sourceType);
Types.MapType sourceMap = sourceType.asMapType();
int sourceKeyId = sourceMap.keyId();
diff --git a/api/src/main/java/org/apache/iceberg/types/TypeUtil.java b/api/src/main/java/org/apache/iceberg/types/TypeUtil.java
index 83fbd74..e3267dd 100644
--- a/api/src/main/java/org/apache/iceberg/types/TypeUtil.java
+++ b/api/src/main/java/org/apache/iceberg/types/TypeUtil.java
@@ -25,7 +25,7 @@ import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
-import java.util.LinkedList;
+import java.util.Deque;
import java.util.List;
import java.util.Locale;
import java.util.Map;
@@ -35,6 +35,9 @@ import java.util.function.Supplier;
import org.apache.iceberg.Schema;
public class TypeUtil {
+
+ private TypeUtil() {}
+
public static Schema select(Schema schema, Set<Integer> fieldIds) {
Preconditions.checkNotNull(schema, "Schema cannot be null");
Preconditions.checkNotNull(fieldIds, "Field ids cannot be null");
@@ -83,8 +86,8 @@ public class TypeUtil {
public static Map<String, Integer> indexByLowerCaseName(Types.StructType struct) {
Map<String, Integer> indexByLowerCaseName = Maps.newHashMap();
- indexByName(struct).forEach( (name, integer) ->
- indexByLowerCaseName.put(name.toLowerCase(Locale.ROOT), integer));
+ indexByName(struct).forEach((name, integer) ->
+ indexByLowerCaseName.put(name.toLowerCase(Locale.ROOT), integer));
return indexByLowerCaseName;
}
@@ -160,8 +163,8 @@ public class TypeUtil {
}
Types.DecimalType toDecimal = (Types.DecimalType) to;
- return (fromDecimal.scale() == toDecimal.scale() &&
- fromDecimal.precision() <= toDecimal.precision());
+ return fromDecimal.scale() == toDecimal.scale() &&
+ fromDecimal.precision() <= toDecimal.precision();
}
return false;
@@ -175,8 +178,8 @@ public class TypeUtil {
}
public static class SchemaVisitor<T> {
- protected LinkedList<String> fieldNames = Lists.newLinkedList();
- protected LinkedList<Integer> fieldIds = Lists.newLinkedList();
+ private final Deque<String> fieldNames = Lists.newLinkedList();
+ private final Deque<Integer> fieldIds = Lists.newLinkedList();
public T schema(Schema schema, T structResult) {
return null;
@@ -201,6 +204,14 @@ public class TypeUtil {
public T primitive(Type.PrimitiveType primitive) {
return null;
}
+
+ protected Deque<String> fieldNames() {
+ return fieldNames;
+ }
+
+ protected Deque<Integer> fieldIds() {
+ return fieldIds;
+ }
}
public static <T> T visit(Schema schema, SchemaVisitor<T> visitor) {
@@ -369,23 +380,23 @@ public class TypeUtil {
static int decimalMaxPrecision(int numBytes) {
Preconditions.checkArgument(numBytes >= 0 && numBytes < 24,
- "Unsupported decimal length: " + numBytes);
+ "Unsupported decimal length: %s", numBytes);
return MAX_PRECISION[numBytes];
}
public static int decimalRequriedBytes(int precision) {
Preconditions.checkArgument(precision >= 0 && precision < 40,
- "Unsupported decimal precision: " + precision);
+ "Unsupported decimal precision: %s", precision);
return REQUIRED_LENGTH[precision];
}
- private static int[] MAX_PRECISION = new int[24];
- private static int[] REQUIRED_LENGTH = new int[40];
+ private static final int[] MAX_PRECISION = new int[24];
+ private static final int[] REQUIRED_LENGTH = new int[40];
static {
// for each length, calculate the max precision
for (int len = 0; len < MAX_PRECISION.length; len += 1) {
- MAX_PRECISION[len] = (int) Math.floor(Math.log10(Math.pow(2, 8*len - 1) - 1));
+ MAX_PRECISION[len] = (int) Math.floor(Math.log10(Math.pow(2, 8 * len - 1) - 1));
}
// for each precision, find the first length that can hold it
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 e924cd4..9eca4db 100644
--- a/api/src/main/java/org/apache/iceberg/types/Types.java
+++ b/api/src/main/java/org/apache/iceberg/types/Types.java
@@ -35,6 +35,9 @@ import org.apache.iceberg.types.Type.NestedType;
import org.apache.iceberg.types.Type.PrimitiveType;
public class Types {
+
+ private Types() {}
+
private static final ImmutableMap<String, PrimitiveType> TYPES = ImmutableMap
.<String, PrimitiveType>builder()
.put(BooleanType.get().toString(), BooleanType.get())
@@ -536,8 +539,13 @@ public class Types {
return lazyFieldsByName().get(name);
}
+ @Override
+ public NestedField field(int id) {
+ return lazyFieldsById().get(id);
+ }
+
public NestedField caseInsensitiveField(String name) {
- return lazyFieldsByLowerCaseName().get(name.toLowerCase(Locale.ROOT));
+ return lazyFieldsByLowerCaseName().get(name.toLowerCase(Locale.ROOT));
}
@Override
@@ -550,11 +558,6 @@ public class Types {
}
@Override
- public NestedField field(int id) {
- return lazyFieldsById().get(id);
- }
-
- @Override
public TypeID typeId() {
return TypeID.STRUCT;
}
@@ -606,10 +609,10 @@ public class Types {
}
private Map<String, NestedField> lazyFieldsByLowerCaseName() {
- if (fieldsByLowerCaseName == null) {
- indexFields();
- }
- return fieldsByLowerCaseName;
+ if (fieldsByLowerCaseName == null) {
+ indexFields();
+ }
+ return fieldsByLowerCaseName;
}
private Map<Integer, NestedField> lazyFieldsById() {
diff --git a/api/src/test/java/org/apache/iceberg/TestHelpers.java b/api/src/test/java/org/apache/iceberg/TestHelpers.java
index bcf5553..ae6a69f 100644
--- a/api/src/test/java/org/apache/iceberg/TestHelpers.java
+++ b/api/src/test/java/org/apache/iceberg/TestHelpers.java
@@ -35,6 +35,9 @@ import org.apache.iceberg.expressions.UnboundPredicate;
import org.junit.Assert;
public class TestHelpers {
+
+ private TestHelpers() {}
+
public static <T> T assertAndUnwrap(Expression expr, Class<T> expected) {
Assert.assertTrue("Expression should have expected type: " + expected,
expected.isInstance(expr));
@@ -75,7 +78,7 @@ public class TestHelpers {
private static class CheckReferencesBound extends ExpressionVisitors.ExpressionVisitor<Void> {
private final String message;
- public CheckReferencesBound(String message) {
+ CheckReferencesBound(String message) {
this.message = message;
}
diff --git a/api/src/test/java/org/apache/iceberg/events/TestListeners.java b/api/src/test/java/org/apache/iceberg/events/TestListeners.java
index 5e1c110..301d36a 100644
--- a/api/src/test/java/org/apache/iceberg/events/TestListeners.java
+++ b/api/src/test/java/org/apache/iceberg/events/TestListeners.java
@@ -36,6 +36,7 @@ public class TestListeners {
public static class TestListener {
private static final TestListener INSTANCE = new TestListener();
+
public static TestListener get() {
return INSTANCE;
}
@@ -43,12 +44,12 @@ public class TestListeners {
private Event1 e1 = null;
private Event2 e2 = null;
- public void event1(Event1 e) {
- this.e1 = e;
+ public void event1(Event1 event) {
+ this.e1 = event;
}
- public void event2(Event2 e) {
- this.e2 = e;
+ public void event2(Event2 event) {
+ this.e2 = event;
}
}
diff --git a/api/src/test/java/org/apache/iceberg/expressions/TestEvaluatior.java b/api/src/test/java/org/apache/iceberg/expressions/TestEvaluatior.java
index 9494226..a0aacef 100644
--- a/api/src/test/java/org/apache/iceberg/expressions/TestEvaluatior.java
+++ b/api/src/test/java/org/apache/iceberg/expressions/TestEvaluatior.java
@@ -156,11 +156,10 @@ public class TestEvaluatior {
@Test
public void testCaseSensitiveNot() {
TestHelpers.assertThrows(
- "X != x when case sensitivity is on",
- ValidationException.class,
- "Cannot find field 'X' in struct",
- () -> { new Evaluator(STRUCT, not(equal("X", 7)), true); }
- );
+ "X != x when case sensitivity is on",
+ ValidationException.class,
+ "Cannot find field 'X' in struct",
+ () -> new Evaluator(STRUCT, not(equal("X", 7)), true));
}
@Test
diff --git a/api/src/test/java/org/apache/iceberg/expressions/TestExpressionSerialization.java b/api/src/test/java/org/apache/iceberg/expressions/TestExpressionSerialization.java
index d84ca54..f4eeffd 100644
--- a/api/src/test/java/org/apache/iceberg/expressions/TestExpressionSerialization.java
+++ b/api/src/test/java/org/apache/iceberg/expressions/TestExpressionSerialization.java
@@ -82,15 +82,11 @@ public class TestExpressionSerialization {
case NOT:
return equals(((Not) left).child(), ((Not) right).child());
case AND:
- return (
- equals(((And) left).left(), ((And) right).left()) &&
- equals(((And) left).right(), ((And) right).right())
- );
+ return equals(((And) left).left(), ((And) right).left()) &&
+ equals(((And) left).right(), ((And) right).right());
case OR:
- return (
- equals(((Or) left).left(), ((Or) right).left()) &&
- equals(((Or) left).right(), ((Or) right).right())
- );
+ return equals(((Or) left).left(), ((Or) right).left()) &&
+ equals(((Or) left).right(), ((Or) right).right());
default:
return false;
}
@@ -123,8 +119,7 @@ public class TestExpressionSerialization {
NamedReference lref = (NamedReference) left;
NamedReference rref = (NamedReference) right;
- return lref.name.equals(rref.name);
-
+ return lref.name().equals(rref.name());
} else if (left instanceof BoundReference) {
if (!(right instanceof BoundReference)) {
return false;
@@ -133,10 +128,8 @@ public class TestExpressionSerialization {
BoundReference lref = (BoundReference) left;
BoundReference rref = (BoundReference) right;
- return (
- lref.fieldId() == rref.fieldId() &&
- lref.type().equals(rref.type())
- );
+ return lref.fieldId() == rref.fieldId() &&
+ lref.type().equals(rref.type());
}
return false;
diff --git a/api/src/test/java/org/apache/iceberg/expressions/TestMiscLiteralConversions.java b/api/src/test/java/org/apache/iceberg/expressions/TestMiscLiteralConversions.java
index 25c1c16..b9006df 100644
--- a/api/src/test/java/org/apache/iceberg/expressions/TestMiscLiteralConversions.java
+++ b/api/src/test/java/org/apache/iceberg/expressions/TestMiscLiteralConversions.java
@@ -321,24 +321,24 @@ public class TestMiscLiteralConversions {
}
private static class Pair<X, Y> {
- public static <X, Y> Pair<X, Y> of(X x, Y y) {
- return new Pair<>(x, y);
+ public static <X, Y> Pair<X, Y> of(X first, Y second) {
+ return new Pair<>(first, second);
}
- private final X x;
- private final Y y;
+ private final X first;
+ private final Y second;
- private Pair(X x, Y y) {
- this.x = x;
- this.y = y;
+ private Pair(X first, Y second) {
+ this.first = first;
+ this.second = second;
}
public X first() {
- return x;
+ return first;
}
public Y second() {
- return y;
+ return second;
}
}
}
diff --git a/api/src/test/java/org/apache/iceberg/expressions/TestPredicateBinding.java b/api/src/test/java/org/apache/iceberg/expressions/TestPredicateBinding.java
index 42d1157..bc5013c 100644
--- a/api/src/test/java/org/apache/iceberg/expressions/TestPredicateBinding.java
+++ b/api/src/test/java/org/apache/iceberg/expressions/TestPredicateBinding.java
@@ -42,7 +42,7 @@ import static org.apache.iceberg.types.Types.NestedField.optional;
import static org.apache.iceberg.types.Types.NestedField.required;
public class TestPredicateBinding {
- private static List<Expression.Operation> COMPARISONS = Arrays.asList(
+ private static final List<Expression.Operation> COMPARISONS = Arrays.asList(
LT, LT_EQ, GT, GT_EQ, EQ, NOT_EQ);
@Test
diff --git a/api/src/test/java/org/apache/iceberg/transforms/TestBucketing.java b/api/src/test/java/org/apache/iceberg/transforms/TestBucketing.java
index 6b1ddd7..311fff4 100644
--- a/api/src/test/java/org/apache/iceberg/transforms/TestBucketing.java
+++ b/api/src/test/java/org/apache/iceberg/transforms/TestBucketing.java
@@ -19,7 +19,6 @@
package org.apache.iceberg.transforms;
-import com.google.common.base.Charsets;
import com.google.common.hash.HashFunction;
import com.google.common.hash.Hashing;
import java.lang.reflect.Constructor;
@@ -27,6 +26,7 @@ import java.lang.reflect.InvocationTargetException;
import java.math.BigDecimal;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
+import java.nio.charset.StandardCharsets;
import java.util.Random;
import java.util.UUID;
import org.apache.avro.util.Utf8;
@@ -73,10 +73,10 @@ public class TestBucketing {
-142385009, new Bucket.BucketDouble(100).hash(1.0D));
Assert.assertEquals("Spec example: hash(decimal2(14.20)) = -500754589",
-500754589,
- Bucket.<BigDecimal>get(Types.DecimalType.of(9,2), 100).hash(new BigDecimal("14.20")));
+ Bucket.<BigDecimal>get(Types.DecimalType.of(9, 2), 100).hash(new BigDecimal("14.20")));
Assert.assertEquals("Spec example: hash(decimal2(14.20)) = -500754589",
-500754589,
- Bucket.<BigDecimal>get(Types.DecimalType.of(9,2), 100).hash(new BigDecimal("14.20")));
+ Bucket.<BigDecimal>get(Types.DecimalType.of(9, 2), 100).hash(new BigDecimal("14.20")));
Literal<Integer> date = Literal.of("2017-11-16").to(Types.DateType.get());
Assert.assertEquals("Spec example: hash(2017-11-16) = -653330422",
@@ -148,10 +148,10 @@ public class TestBucketing {
Bucket<Integer> bucketInts = Bucket.get(Types.IntegerType.get(), 100);
Bucket<Long> bucketLongs = Bucket.get(Types.LongType.get(), 100);
- int r = testRandom.nextInt();
+ int randomInt = testRandom.nextInt();
Assert.assertEquals("Integer and Long bucket results should match",
- bucketInts.apply(r), bucketLongs.apply((long) r));
+ bucketInts.apply(randomInt), bucketLongs.apply((long) randomInt));
}
@Test
@@ -185,10 +185,10 @@ public class TestBucketing {
Bucket<Float> bucketFloats = new Bucket.BucketFloat(100);
Bucket<Double> bucketDoubles = new Bucket.BucketDouble(100);
- float r = testRandom.nextFloat();
+ float randomFloat = testRandom.nextFloat();
Assert.assertEquals("Float and Double bucket results should match",
- bucketFloats.apply(r), bucketDoubles.apply((double) r));
+ bucketFloats.apply(randomFloat), bucketDoubles.apply((double) randomFloat));
}
@Test
@@ -206,7 +206,7 @@ public class TestBucketing {
@Test
public void testString() {
String string = "string to test murmur3 hash";
- byte[] asBytes = string.getBytes(Charsets.UTF_8);
+ byte[] asBytes = string.getBytes(StandardCharsets.UTF_8);
Bucket<CharSequence> bucketFunc = Bucket.get(Types.StringType.get(), 100);
@@ -217,7 +217,7 @@ public class TestBucketing {
@Test
public void testUtf8() {
Utf8 utf8 = new Utf8("string to test murmur3 hash");
- byte[] asBytes = utf8.toString().getBytes(Charsets.UTF_8);
+ byte[] asBytes = utf8.toString().getBytes(StandardCharsets.UTF_8);
Bucket<CharSequence> bucketFunc = Bucket.get(Types.StringType.get(), 100);
diff --git a/api/src/test/java/org/apache/iceberg/transforms/TestIdentity.java b/api/src/test/java/org/apache/iceberg/transforms/TestIdentity.java
index b339651..a092dda 100644
--- a/api/src/test/java/org/apache/iceberg/transforms/TestIdentity.java
+++ b/api/src/test/java/org/apache/iceberg/transforms/TestIdentity.java
@@ -60,10 +60,10 @@ public class TestIdentity {
Transform<Integer, Integer> identity = Transforms.identity(date);
String dateString = "2017-12-01";
- Literal<Integer> d = Literal.of(dateString).to(date);
+ Literal<Integer> dateLit = Literal.of(dateString).to(date);
Assert.assertEquals("Should produce identical date",
- dateString, identity.toHumanString(d.value()));
+ dateString, identity.toHumanString(dateLit.value()));
}
@Test
@@ -72,10 +72,10 @@ public class TestIdentity {
Transform<Long, Long> identity = Transforms.identity(time);
String timeString = "10:12:55.038194";
- Literal<Long> d = Literal.of(timeString).to(time);
+ Literal<Long> timeLit = Literal.of(timeString).to(time);
Assert.assertEquals("Should produce identical time",
- timeString, identity.toHumanString(d.value()));
+ timeString, identity.toHumanString(timeLit.value()));
}
@Test
@@ -127,7 +127,7 @@ public class TestIdentity {
Transform<BigDecimal, BigDecimal> identity = Transforms.identity(decimal);
String decimalString = "-1.50";
- BigDecimal d = new BigDecimal(decimalString);
- Assert.assertEquals("Should not modify Strings", decimalString, identity.toHumanString(d));
+ BigDecimal bigDecimal = new BigDecimal(decimalString);
+ Assert.assertEquals("Should not modify Strings", decimalString, identity.toHumanString(bigDecimal));
}
}
diff --git a/api/src/test/java/org/apache/iceberg/transforms/TestProjection.java b/api/src/test/java/org/apache/iceberg/transforms/TestProjection.java
index f17e6d9..e77bb2c 100644
--- a/api/src/test/java/org/apache/iceberg/transforms/TestProjection.java
+++ b/api/src/test/java/org/apache/iceberg/transforms/TestProjection.java
@@ -132,10 +132,11 @@ public class TestProjection {
.identity("id")
.build();
- assertThrows("X != x when case sensitivity is on",
+ assertThrows(
+ "X != x when case sensitivity is on",
ValidationException.class,
"Cannot find field 'ID' in struct",
- () -> { Projections.inclusive(spec, true).project(Expressions.notNull("ID")); });
+ () -> Projections.inclusive(spec, true).project(Expressions.notNull("ID")));
}
@Test
@@ -216,15 +217,13 @@ public class TestProjection {
@Test
public void testCaseSensitiveStrictIdentityProjection() {
- PartitionSpec spec = PartitionSpec.builderFor(SCHEMA)
- .identity("id")
- .build();
+ PartitionSpec spec = PartitionSpec.builderFor(SCHEMA).identity("id").build();
assertThrows(
- "X != x when case sensitivity is on",
- ValidationException.class,
- "Cannot find field 'ID' in struct",
- () -> { Projections.strict(spec, true).project(Expressions.notNull("ID")); });
+ "X != x when case sensitivity is on",
+ ValidationException.class,
+ "Cannot find field 'ID' in struct",
+ () -> Projections.strict(spec, true).project(Expressions.notNull("ID")));
}
@Test
diff --git a/api/src/test/java/org/apache/iceberg/types/TestReadabilityChecks.java b/api/src/test/java/org/apache/iceberg/types/TestReadabilityChecks.java
index e905df3..c2af6bf 100644
--- a/api/src/test/java/org/apache/iceberg/types/TestReadabilityChecks.java
+++ b/api/src/test/java/org/apache/iceberg/types/TestReadabilityChecks.java
@@ -21,6 +21,7 @@ package org.apache.iceberg.types;
import java.util.List;
import org.apache.iceberg.Schema;
+import org.apache.iceberg.types.Type.PrimitiveType;
import org.junit.Assert;
import org.junit.Test;
@@ -66,50 +67,42 @@ public class TestReadabilityChecks {
}
}
- {
- Schema structSchema = new Schema(required(1, "struct_field", Types.StructType.of(
- required(2, "from", from))
- ));
-
- List<String> errors = CheckCompatibility.writeCompatibilityErrors(structSchema, fromSchema);
- Assert.assertEquals("Should produce 1 error message", 1, errors.size());
-
- Assert.assertTrue("Should complain that primitive to struct is not allowed",
- errors.get(0).contains("cannot be read as a struct"));
- }
-
- {
- Schema listSchema = new Schema(required(1, "list_field", Types.ListType.ofRequired(2, from)));
+ testDisallowPrimitiveToStruct(from, fromSchema);
+ testDisallowPrimitiveToList(from, fromSchema);
+ testDisallowPrimitiveToMap(from, fromSchema);
+ }
+ }
- List<String> errors = CheckCompatibility.writeCompatibilityErrors(listSchema, fromSchema);
- Assert.assertEquals("Should produce 1 error message", 1, errors.size());
+ private void testDisallowPrimitiveToMap(PrimitiveType from, Schema fromSchema) {
+ Schema mapSchema = new Schema(required(1, "map_field",
+ Types.MapType.ofRequired(2, 3, Types.StringType.get(), from)));
- Assert.assertTrue("Should complain that primitive to list is not allowed",
- errors.get(0).contains("cannot be read as a list"));
- }
+ List<String> errors = CheckCompatibility.writeCompatibilityErrors(mapSchema, fromSchema);
+ Assert.assertEquals("Should produce 1 error message", 1, errors.size());
- {
- Schema mapSchema = new Schema(required(1, "map_field",
- Types.MapType.ofRequired(2, 3, Types.StringType.get(), from)));
+ Assert.assertTrue("Should complain that primitive to map is not allowed",
+ errors.get(0).contains("cannot be read as a map"));
+ }
- List<String> errors = CheckCompatibility.writeCompatibilityErrors(mapSchema, fromSchema);
- Assert.assertEquals("Should produce 1 error message", 1, errors.size());
+ private void testDisallowPrimitiveToList(PrimitiveType from, Schema fromSchema) {
- Assert.assertTrue("Should complain that primitive to map is not allowed",
- errors.get(0).contains("cannot be read as a map"));
- }
+ Schema listSchema = new Schema(required(1, "list_field", Types.ListType.ofRequired(2, from)));
- {
- Schema mapSchema = new Schema(required(1, "map_field",
- Types.MapType.ofRequired(2, 3, from, Types.StringType.get())));
+ List<String> errors = CheckCompatibility.writeCompatibilityErrors(listSchema, fromSchema);
+ Assert.assertEquals("Should produce 1 error message", 1, errors.size());
+ Assert.assertTrue("Should complain that primitive to list is not allowed",
+ errors.get(0).contains("cannot be read as a list"));
+ }
- List<String> errors = CheckCompatibility.writeCompatibilityErrors(mapSchema, fromSchema);
- Assert.assertEquals("Should produce 1 error message", 1, errors.size());
+ private void testDisallowPrimitiveToStruct(PrimitiveType from, Schema fromSchema) {
+ Schema structSchema = new Schema(required(1, "struct_field", Types.StructType.of(
+ required(2, "from", from))
+ ));
- Assert.assertTrue("Should complain that primitive to map is not allowed",
- errors.get(0).contains("cannot be read as a map"));
- }
- }
+ List<String> errors = CheckCompatibility.writeCompatibilityErrors(structSchema, fromSchema);
+ Assert.assertEquals("Should produce 1 error message", 1, errors.size());
+ Assert.assertTrue("Should complain that primitive to struct is not allowed",
+ errors.get(0).contains("cannot be read as a struct"));
}
@Test
diff --git a/build.gradle b/build.gradle
index e715274..ec1f1bf 100644
--- a/build.gradle
+++ b/build.gradle
@@ -18,11 +18,17 @@
*/
buildscript {
- repositories { jcenter() }
+ repositories {
+ jcenter()
+ gradlePluginPortal()
+ maven { url "http://palantir.bintray.com/releases" }
+ }
dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.0'
classpath 'com.netflix.nebula:gradle-aggregate-javadocs-plugin:2.2.+'
classpath 'com.netflix.nebula:nebula-publishing-plugin:5.1.5'
+ classpath 'com.palantir.baseline:gradle-baseline-java:0.53.0'
+ classpath 'gradle.plugin.org.inferred:gradle-processors:2.1.0'
}
}
@@ -37,7 +43,7 @@ if (JavaVersion.current() != JavaVersion.VERSION_1_8) {
allprojects {
group = "org.apache.iceberg"
- apply plugin: 'idea'
+ apply plugin: 'com.palantir.baseline-idea'
version = gitVersion()
}
@@ -49,10 +55,10 @@ subprojects {
apply plugin: 'java'
apply plugin: 'maven' // make pom files for deployment
apply plugin: 'nebula.maven-base-publish'
-
repositories {
mavenCentral()
mavenLocal()
+ maven { url "http://palantir.bintray.com/releases" }
}
configurations {
@@ -103,6 +109,12 @@ project(':iceberg-api') {
testCompile "org.apache.avro:avro:$avroVersion"
testCompile 'joda-time:joda-time:2.9.9'
}
+ apply plugin: 'org.inferred.processors'
+ pluginManager.withPlugin('com.palantir.baseline') {
+ // Disable Baseline's Spotless Java checks for now. It does not support having the static
+ // imports being at the bottom of the import list.
+ tasks.spotlessJava.enabled = false
+ }
}
project(':iceberg-common') {
@@ -135,6 +147,11 @@ project(':iceberg-data') {
exclude group: 'org.slf4j', module: 'slf4j-log4j12'
}
}
+
+ test {
+ // Only for TestSplitScan as of Gradle 5.0+
+ maxHeapSize '1500m'
+ }
}
project(':iceberg-hive') {
diff --git a/core/src/main/java/org/apache/iceberg/avro/TypeToSchema.java b/core/src/main/java/org/apache/iceberg/avro/TypeToSchema.java
index 109f456..a436a9c 100644
--- a/core/src/main/java/org/apache/iceberg/avro/TypeToSchema.java
+++ b/core/src/main/java/org/apache/iceberg/avro/TypeToSchema.java
@@ -81,7 +81,7 @@ class TypeToSchema extends TypeUtil.SchemaVisitor<Schema> {
String recordName = names.get(struct);
if (recordName == null) {
- recordName = "r" + fieldIds.peek();
+ recordName = "r" + fieldIds().peek();
}
List<Types.NestedField> structFields = struct.fields();
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 976f7d2..510cee0 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -21,4 +21,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-bin.zip