diff --git a/.travis.yml b/.travis.yml index 87b7e383d..7ec328094 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,7 +21,7 @@ addons: install: true script: - - ./gradlew clean build + - ./gradlew clean build javadoc # required for gradle artifact caching (see https://docs.travis-ci.com/user/languages/java/#caching) before_cache: @@ -46,4 +46,4 @@ deploy: on: all_branches: true tags: true - # the condition on the tag name (should be a semantic version) is inside the script, for ease of development \ No newline at end of file + # the condition on the tag name (should be a semantic version) is inside the script, for ease of development diff --git a/avro-fastserde/src/main/java/com/linkedin/avro/fastserde/FastAvroConcurrentHashMap.java b/avro-fastserde/src/main/java/com/linkedin/avro/fastserde/FastAvroConcurrentHashMap.java index 24282b404..74977bc1f 100644 --- a/avro-fastserde/src/main/java/com/linkedin/avro/fastserde/FastAvroConcurrentHashMap.java +++ b/avro-fastserde/src/main/java/com/linkedin/avro/fastserde/FastAvroConcurrentHashMap.java @@ -25,9 +25,17 @@ public FastAvroConcurrentHashMap(int initialCapacity) { * optimization might not be ideal for the workload that most keys are unique, so be cautious * about the workload before adopting the FastAvroConcurrentHashMap. * - * @param key - * @param mappingFunction - * @return + * @param key key with which the specified value is to be associated + * @param mappingFunction the function to compute a value + * @return the current (existing or computed) value associated with + * the specified key, or null if the computed value is null + * @throws NullPointerException if the specified key or mappingFunction + * is null + * @throws IllegalStateException if the computation detectably + * attempts a recursive update to this map that would + * otherwise never complete + * @throws RuntimeException or Error if the mappingFunction does so, + * in which case the mapping is left unestablished */ @Override public V computeIfAbsent(K key, Function mappingFunction) { diff --git a/avro-fastserde/src/main/java/com/linkedin/avro/fastserde/FastSerdeBase.java b/avro-fastserde/src/main/java/com/linkedin/avro/fastserde/FastSerdeBase.java index e59406fbb..ab6b937a1 100644 --- a/avro-fastserde/src/main/java/com/linkedin/avro/fastserde/FastSerdeBase.java +++ b/avro-fastserde/src/main/java/com/linkedin/avro/fastserde/FastSerdeBase.java @@ -63,7 +63,7 @@ public FastSerdeBase(String description, boolean useGenericTypes, Class defaultS * schema pair). * * @param prefix String to serve as a prefix for the unique name - * @return a unique prefix composed of the {@param prefix} appended by a unique number + * @return a unique prefix composed of the prefix appended by a unique number */ protected String getUniqueName(String prefix) { String uncapitalizedPrefix = StringUtils.uncapitalize(prefix); diff --git a/avro-fastserde/src/main/java/com/linkedin/avro/fastserde/primitive/PrimitiveArrayList.java b/avro-fastserde/src/main/java/com/linkedin/avro/fastserde/primitive/PrimitiveArrayList.java index 5753315b7..a17ba98ed 100644 --- a/avro-fastserde/src/main/java/com/linkedin/avro/fastserde/primitive/PrimitiveArrayList.java +++ b/avro-fastserde/src/main/java/com/linkedin/avro/fastserde/primitive/PrimitiveArrayList.java @@ -39,15 +39,15 @@ public abstract class PrimitiveArrayList extends AbstractList /** * @param that an instance of primitive list to use for comparison * @param index the index of the element to compare - * @return the comparison result between element of this and {@param that} list at the provided {@param index} + * @return the comparison result between element of this and that list at the provided index */ protected abstract int compareElementAtIndex(L that, int index); /** - * @param o instance of an Object that may or may not be a primitive list - * @return true if {@param o} instanceof the right type of primitive list for comparison + * @param object instance of an Object that may or may not be a primitive list + * @return true if the passed in object is an instance of the right type of primitive list for comparison */ - protected abstract boolean isInstanceOfCorrectPrimitiveList(Object o); + protected abstract boolean isInstanceOfCorrectPrimitiveList(Object object); // Public API @@ -138,12 +138,12 @@ public String toString() { * instance had a larger number of elements than the new one, in which case, we will reuse the array, but * use the {@link #size} as a boundary within the larger array. * - * @param i an index position which may or may not be within bound of the current list - * @throws IndexOutOfBoundsException if {@param i} is larger than the index of the last valid element + * @param index an index position which may or may not be within bound of the current list + * @throws IndexOutOfBoundsException if the index param is larger than the index of the last valid element */ - protected void checkIfLargerThanSize(int i) { - if (i >= size) { - throw new IndexOutOfBoundsException("Index " + i + " out of bounds."); + protected void checkIfLargerThanSize(int index) { + if (index >= size) { + throw new IndexOutOfBoundsException("Index " + index + " out of bounds."); } } @@ -167,7 +167,11 @@ protected void capacityCheck() { } } - /** Create an empty space in the array at the index specified by {@param location} by shifting the elements to the right */ + /** + * Create an empty space in the array at the index specified by shifting the elements to the right + * + * @param location index where the element will be added + */ protected void addInternal(int location) { if (location > size || location < 0) { throw new IndexOutOfBoundsException("Index " + location + " out of bounds."); diff --git a/avro-fastserde/src/main/java/com/linkedin/avro/fastserde/primitive/PrimitiveBooleanArrayList.java b/avro-fastserde/src/main/java/com/linkedin/avro/fastserde/primitive/PrimitiveBooleanArrayList.java index 9f3cd2b00..0e1e78659 100644 --- a/avro-fastserde/src/main/java/com/linkedin/avro/fastserde/primitive/PrimitiveBooleanArrayList.java +++ b/avro-fastserde/src/main/java/com/linkedin/avro/fastserde/primitive/PrimitiveBooleanArrayList.java @@ -85,7 +85,7 @@ protected int compareElementAtIndex(PrimitiveBooleanList that, int index) { } @Override - protected boolean isInstanceOfCorrectPrimitiveList(Object o) { - return o instanceof PrimitiveBooleanList; + protected boolean isInstanceOfCorrectPrimitiveList(Object object) { + return object instanceof PrimitiveBooleanList; } } diff --git a/avro-fastserde/src/main/java/com/linkedin/avro/fastserde/primitive/PrimitiveDoubleArrayList.java b/avro-fastserde/src/main/java/com/linkedin/avro/fastserde/primitive/PrimitiveDoubleArrayList.java index 675bc817e..69e711e11 100644 --- a/avro-fastserde/src/main/java/com/linkedin/avro/fastserde/primitive/PrimitiveDoubleArrayList.java +++ b/avro-fastserde/src/main/java/com/linkedin/avro/fastserde/primitive/PrimitiveDoubleArrayList.java @@ -86,7 +86,7 @@ protected int compareElementAtIndex(PrimitiveDoubleList that, int index) { } @Override - protected boolean isInstanceOfCorrectPrimitiveList(Object o) { - return o instanceof PrimitiveBooleanList; + protected boolean isInstanceOfCorrectPrimitiveList(Object object) { + return object instanceof PrimitiveBooleanList; } } diff --git a/avro-fastserde/src/main/java/com/linkedin/avro/fastserde/primitive/PrimitiveFloatArrayList.java b/avro-fastserde/src/main/java/com/linkedin/avro/fastserde/primitive/PrimitiveFloatArrayList.java index f4aa2240c..dbf9e267c 100644 --- a/avro-fastserde/src/main/java/com/linkedin/avro/fastserde/primitive/PrimitiveFloatArrayList.java +++ b/avro-fastserde/src/main/java/com/linkedin/avro/fastserde/primitive/PrimitiveFloatArrayList.java @@ -86,7 +86,7 @@ protected int compareElementAtIndex(PrimitiveFloatList that, int index) { } @Override - protected boolean isInstanceOfCorrectPrimitiveList(Object o) { - return o instanceof PrimitiveBooleanList; + protected boolean isInstanceOfCorrectPrimitiveList(Object object) { + return object instanceof PrimitiveBooleanList; } } diff --git a/avro-fastserde/src/main/java/com/linkedin/avro/fastserde/primitive/PrimitiveIntArrayList.java b/avro-fastserde/src/main/java/com/linkedin/avro/fastserde/primitive/PrimitiveIntArrayList.java index d160160f2..79ce6b4b5 100644 --- a/avro-fastserde/src/main/java/com/linkedin/avro/fastserde/primitive/PrimitiveIntArrayList.java +++ b/avro-fastserde/src/main/java/com/linkedin/avro/fastserde/primitive/PrimitiveIntArrayList.java @@ -86,7 +86,7 @@ protected int compareElementAtIndex(PrimitiveIntList that, int index) { } @Override - protected boolean isInstanceOfCorrectPrimitiveList(Object o) { - return o instanceof PrimitiveBooleanList; + protected boolean isInstanceOfCorrectPrimitiveList(Object object) { + return object instanceof PrimitiveBooleanList; } } diff --git a/avro-fastserde/src/main/java/com/linkedin/avro/fastserde/primitive/PrimitiveLongArrayList.java b/avro-fastserde/src/main/java/com/linkedin/avro/fastserde/primitive/PrimitiveLongArrayList.java index f419dc38d..4bd86cf43 100644 --- a/avro-fastserde/src/main/java/com/linkedin/avro/fastserde/primitive/PrimitiveLongArrayList.java +++ b/avro-fastserde/src/main/java/com/linkedin/avro/fastserde/primitive/PrimitiveLongArrayList.java @@ -86,7 +86,7 @@ protected int compareElementAtIndex(PrimitiveLongList that, int index) { } @Override - protected boolean isInstanceOfCorrectPrimitiveList(Object o) { - return o instanceof PrimitiveBooleanList; + protected boolean isInstanceOfCorrectPrimitiveList(Object object) { + return object instanceof PrimitiveBooleanList; } } diff --git a/helper/helper-common/src/main/java/com/linkedin/avroutil1/compatibility/CodeTransformations.java b/helper/helper-common/src/main/java/com/linkedin/avroutil1/compatibility/CodeTransformations.java index 1838c981b..97fb70fd4 100644 --- a/helper/helper-common/src/main/java/com/linkedin/avroutil1/compatibility/CodeTransformations.java +++ b/helper/helper-common/src/main/java/com/linkedin/avroutil1/compatibility/CodeTransformations.java @@ -252,9 +252,9 @@ public static String transformEnumClass(String code, AvroVersion minSupportedVer * producing uncompilable code (see see AVRO-1316). this was only fixed in avro 1.7.5+ * * also - avro 1.6+ issues "new org.apache.avro.Schema.Parser().parse(...)" calls which will not compile - * under avro < 1.6 + * under {@literal avro < 1.6} * - * in addition, avro < 1.6 fails to properly escape control characters in the schema string (like newlines + * in addition, {@literal avro < 1.6} fails to properly escape control characters in the schema string (like newlines * in doc properties) which will result in a json parse error when trying to instantiate the * generated java class (because at that point it will fail to parse the avsc in SCHEMA$) * diff --git a/helper/helper-common/src/main/java/com/linkedin/avroutil1/compatibility/SchemaValidator.java b/helper/helper-common/src/main/java/com/linkedin/avroutil1/compatibility/SchemaValidator.java index 5084ff47f..758fdffaa 100644 --- a/helper/helper-common/src/main/java/com/linkedin/avroutil1/compatibility/SchemaValidator.java +++ b/helper/helper-common/src/main/java/com/linkedin/avroutil1/compatibility/SchemaValidator.java @@ -23,7 +23,7 @@ * a utility class that (in combination with {@link AvroSchemaUtil#traverseSchema(Schema, SchemaVisitor)}) * can validate avro schemas vs the avro specification.
* this class exists because historically avro has been very bad at validating its own specification - * and this allows proper validation under older (<1.9) versions of avro + * and this allows proper validation under versions of {@literal avro < 1.9} */ public class SchemaValidator implements SchemaVisitor { private final static Set NAMED_TYPES = Collections.unmodifiableSet(new HashSet<>(Arrays.asList(