Use "final" where required to be consistent with rest of codebase.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/45abdcc3 Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/45abdcc3 Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/45abdcc3 Branch: refs/heads/tp31 Commit: 45abdcc35e9a80036ca669cc1d65ad16d09d2461 Parents: 293fe29 Author: Stephen Mallette <sp...@genoprime.com> Authored: Tue Jun 7 08:06:30 2016 -0400 Committer: Stephen Mallette <sp...@genoprime.com> Committed: Tue Jun 7 08:06:30 2016 -0400 ---------------------------------------------------------------------- .../gremlin/structure/io/gryo/GryoMapper.java | 32 ++++++------ .../structure/io/gryo/GryoSerializers.java | 20 ++++---- .../structure/io/gryo/JavaTimeSerializers.java | 52 ++++++++++---------- .../structure/io/gryo/PairSerializer.java | 4 +- .../structure/io/gryo/TypeRegistration.java | 2 +- .../structure/io/gryo/kryoshim/InputShim.java | 12 ++--- .../structure/io/gryo/kryoshim/KryoShim.java | 12 ++--- .../io/gryo/kryoshim/KryoShimService.java | 8 +-- .../io/gryo/kryoshim/KryoShimServiceLoader.java | 30 +++++------ .../structure/io/gryo/kryoshim/OutputShim.java | 14 +++--- .../io/gryo/kryoshim/SerializerShim.java | 6 +-- .../kryoshim/shaded/ShadedInputAdapter.java | 4 +- .../gryo/kryoshim/shaded/ShadedKryoAdapter.java | 14 +++--- .../kryoshim/shaded/ShadedOutputAdapter.java | 17 +++---- .../shaded/ShadedSerializerAdapter.java | 14 +++--- .../util/star/StarGraphSerializer.java | 2 +- .../structure/io/HadoopPoolShimService.java | 8 +-- .../hadoop/structure/io/ObjectWritable.java | 4 +- .../hadoop/structure/io/VertexWritable.java | 4 +- .../structure/io/gryo/GryoRegistrator.java | 16 +++--- .../io/gryo/IoRegistryAwareKryoSerializer.java | 8 +-- .../io/gryo/ObjectWritableSerializer.java | 4 +- .../io/gryo/VertexWritableSerializer.java | 4 +- .../kryoshim/unshaded/UnshadedInputAdapter.java | 4 +- .../kryoshim/unshaded/UnshadedKryoAdapter.java | 14 +++--- .../unshaded/UnshadedKryoShimService.java | 22 ++++----- .../unshaded/UnshadedOutputAdapter.java | 14 +++--- .../unshaded/UnshadedSerializerAdapter.java | 6 +-- 28 files changed, 175 insertions(+), 176 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/45abdcc3/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoMapper.java ---------------------------------------------------------------------- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoMapper.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoMapper.java index 7bf9b7d..577c1ce 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoMapper.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoMapper.java @@ -48,7 +48,6 @@ import org.apache.tinkerpop.gremlin.process.traversal.traverser.util.TraverserSe import org.apache.tinkerpop.gremlin.process.traversal.util.DefaultTraversalMetrics; import org.apache.tinkerpop.gremlin.process.traversal.util.ImmutableMetrics; import org.apache.tinkerpop.gremlin.process.traversal.util.MutableMetrics; -import org.apache.tinkerpop.gremlin.process.traversal.util.PureTraversal; import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalExplanation; import org.apache.tinkerpop.gremlin.structure.Direction; import org.apache.tinkerpop.gremlin.structure.Edge; @@ -380,7 +379,7 @@ public final class GryoMapper implements Mapper<Kryo> { null == tr.getSerializerShim() /* a shim serializer is acceptable */ && !(tr.getShadedSerializer() instanceof JavaSerializer) /* shaded JavaSerializer is acceptable */) { // everything else is invalid - String msg = String.format("The default GryoMapper type registration %s is invalid. " + + final String msg = String.format("The default GryoMapper type registration %s is invalid. " + "It must supply either an implementation of %s or %s, but supplies neither. " + "This is probably a bug in GryoMapper's default serialization class registrations.", tr, SerializerShim.class.getCanonicalName(), JavaSerializer.class.getCanonicalName()); @@ -505,11 +504,12 @@ public final class GryoMapper implements Mapper<Kryo> { return new GryoMapper(this); } - private <T> void addOrOverrideRegistration(Class<?> clazz, Function<Integer, TypeRegistration<T>> newRegistrationBuilder) { - Iterator<TypeRegistration<?>> iter = typeRegistrations.iterator(); + private <T> void addOrOverrideRegistration(final Class<?> clazz, + final Function<Integer, TypeRegistration<T>> newRegistrationBuilder) { + final Iterator<TypeRegistration<?>> iter = typeRegistrations.iterator(); Integer registrationId = null; while (iter.hasNext()) { - TypeRegistration<?> existingRegistration = iter.next(); + final TypeRegistration<?> existingRegistration = iter.next(); if (existingRegistration.getTargetClass().equals(clazz)) { // when overridding a registration, use the old id registrationId = existingRegistration.getId(); @@ -534,11 +534,11 @@ public final class GryoMapper implements Mapper<Kryo> { private final Function<Kryo, Serializer> functionOfShadedKryo; private final int id; - private GryoTypeReg(Class<T> clazz, - Serializer<T> shadedSerializer, - SerializerShim<T> serializerShim, - Function<Kryo, Serializer> functionOfShadedKryo, - int id) { + private GryoTypeReg(final Class<T> clazz, + final Serializer<T> shadedSerializer, + final SerializerShim<T> serializerShim, + final Function<Kryo, Serializer> functionOfShadedKryo, + final int id) { this.clazz = clazz; this.shadedSerializer = shadedSerializer; this.serializerShim = serializerShim; @@ -554,7 +554,7 @@ public final class GryoMapper implements Mapper<Kryo> { serializerCount++; if (1 < serializerCount) { - String msg = String.format( + final String msg = String.format( "GryoTypeReg accepts at most one kind of serializer, but multiple " + "serializers were supplied for class %s (id %s). " + "Shaded serializer: %s. Shim serializer: %s. Shaded serializer function: %s.", @@ -564,19 +564,19 @@ public final class GryoMapper implements Mapper<Kryo> { } } - private static <T> GryoTypeReg<T> of(Class<T> clazz, int id) { + private static <T> GryoTypeReg<T> of(final Class<T> clazz, final int id) { return new GryoTypeReg<>(clazz, null, null, null, id); } - private static <T> GryoTypeReg<T> of(Class<T> clazz, int id, Serializer<T> shadedSerializer) { + private static <T> GryoTypeReg<T> of(final Class<T> clazz, final int id, final Serializer<T> shadedSerializer) { return new GryoTypeReg<>(clazz, shadedSerializer, null, null, id); } - private static <T> GryoTypeReg<T> of(Class<T> clazz, int id, SerializerShim<T> serializerShim) { + private static <T> GryoTypeReg<T> of(final Class<T> clazz, final int id, final SerializerShim<T> serializerShim) { return new GryoTypeReg<>(clazz, null, serializerShim, null, id); } - private static <T> GryoTypeReg<T> of(Class clazz, int id, Function<Kryo, Serializer> fct) { + private static <T> GryoTypeReg<T> of(final Class clazz, final int id, final Function<Kryo, Serializer> fct) { return new GryoTypeReg<>(clazz, null, null, fct, id); } @@ -606,7 +606,7 @@ public final class GryoMapper implements Mapper<Kryo> { } @Override - public Kryo registerWith(Kryo kryo) { + public Kryo registerWith(final Kryo kryo) { if (null != functionOfShadedKryo) kryo.register(clazz, functionOfShadedKryo.apply(kryo), id); else if (null != shadedSerializer) http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/45abdcc3/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializers.java ---------------------------------------------------------------------- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializers.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializers.java index 2042a4a..da4fd7a 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializers.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializers.java @@ -49,12 +49,12 @@ public final class GryoSerializers { */ public final static class EdgeSerializer implements SerializerShim<Edge> { @Override - public <O extends OutputShim> void write(KryoShim<?, O> kryo, O output, Edge edge) { + public <O extends OutputShim> void write(final KryoShim<?, O> kryo, final O output, final Edge edge) { kryo.writeClassAndObject(output, DetachedFactory.detach(edge, true)); } @Override - public <I extends InputShim> Edge read(KryoShim<I, ?> kryo, I input, Class<Edge> edgeClass) { + public <I extends InputShim> Edge read(final KryoShim<I, ?> kryo, final I input, final Class<Edge> edgeClass) { final Object o = kryo.readClassAndObject(input); return (Edge) o; } @@ -65,12 +65,12 @@ public final class GryoSerializers { */ public final static class VertexSerializer implements SerializerShim<Vertex> { @Override - public <O extends OutputShim> void write(KryoShim<?, O> kryo, O output, Vertex vertex) { + public <O extends OutputShim> void write(final KryoShim<?, O> kryo, final O output, final Vertex vertex) { kryo.writeClassAndObject(output, DetachedFactory.detach(vertex, true)); } @Override - public <I extends InputShim> Vertex read(KryoShim<I, ?> kryo, I input, Class<Vertex> vertexClass) { + public <I extends InputShim> Vertex read(final KryoShim<I, ?> kryo, final I input, final Class<Vertex> vertexClass) { return (Vertex) kryo.readClassAndObject(input); } } @@ -80,12 +80,12 @@ public final class GryoSerializers { */ public final static class PropertySerializer implements SerializerShim<Property> { @Override - public <O extends OutputShim> void write(KryoShim<?, O> kryo, O output, Property property) { + public <O extends OutputShim> void write(final KryoShim<?, O> kryo, final O output, final Property property) { kryo.writeClassAndObject(output, property instanceof VertexProperty ? DetachedFactory.detach((VertexProperty) property, true) : DetachedFactory.detach(property)); } @Override - public <I extends InputShim> Property read(KryoShim<I, ?> kryo, I input, Class<Property> propertyClass) { + public <I extends InputShim> Property read(final KryoShim<I, ?> kryo, final I input, final Class<Property> propertyClass) { return (Property) kryo.readClassAndObject(input); } } @@ -95,12 +95,12 @@ public final class GryoSerializers { */ public final static class VertexPropertySerializer implements SerializerShim<VertexProperty> { @Override - public <O extends OutputShim> void write(KryoShim<?, O> kryo, O output, VertexProperty vertexProperty) { + public <O extends OutputShim> void write(final KryoShim<?, O> kryo, final O output, final VertexProperty vertexProperty) { kryo.writeClassAndObject(output, DetachedFactory.detach(vertexProperty, true)); } @Override - public <I extends InputShim> VertexProperty read(KryoShim<I, ?> kryo, I input, Class<VertexProperty> vertexPropertyClass) { + public <I extends InputShim> VertexProperty read(final KryoShim<I, ?> kryo, final I input, final Class<VertexProperty> vertexPropertyClass) { return (VertexProperty) kryo.readClassAndObject(input); } } @@ -110,12 +110,12 @@ public final class GryoSerializers { */ public final static class PathSerializer implements SerializerShim<Path> { @Override - public <O extends OutputShim> void write(KryoShim<?, O> kryo, O output, Path path) { + public <O extends OutputShim> void write(final KryoShim<?, O> kryo, final O output, final Path path) { kryo.writeClassAndObject(output, DetachedFactory.detach(path, false)); } @Override - public <I extends InputShim> Path read(KryoShim<I, ?> kryo, I input, Class<Path> pathClass) { + public <I extends InputShim> Path read(final KryoShim<I, ?> kryo, final I input, final Class<Path> pathClass) { return (Path) kryo.readClassAndObject(input); } } http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/45abdcc3/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/JavaTimeSerializers.java ---------------------------------------------------------------------- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/JavaTimeSerializers.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/JavaTimeSerializers.java index 24df032..85bb3c0 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/JavaTimeSerializers.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/JavaTimeSerializers.java @@ -50,12 +50,12 @@ final class JavaTimeSerializers { */ final static class DurationSerializer implements SerializerShim<Duration> { @Override - public <O extends OutputShim> void write(KryoShim<?, O> kryo, O output, Duration duration) { + public <O extends OutputShim> void write(final KryoShim<?, O> kryo, final O output, final Duration duration) { output.writeLong(duration.toNanos()); } @Override - public <I extends InputShim> Duration read(KryoShim<I, ?> kryo, I input, Class<Duration> durationClass) { + public <I extends InputShim> Duration read(final KryoShim<I, ?> kryo, final I input, final Class<Duration> durationClass) { return Duration.ofNanos(input.readLong()); } } @@ -65,13 +65,13 @@ final class JavaTimeSerializers { */ final static class InstantSerializer implements SerializerShim<Instant> { @Override - public <O extends OutputShim> void write(KryoShim<?, O> kryo, O output, Instant instant) { + public <O extends OutputShim> void write(final KryoShim<?, O> kryo, final O output, final Instant instant) { output.writeLong(instant.getEpochSecond()); output.writeInt(instant.getNano()); } @Override - public <I extends InputShim> Instant read(KryoShim<I, ?> kryo, I input, Class<Instant> aClass) { + public <I extends InputShim> Instant read(final KryoShim<I, ?> kryo, final I input, final Class<Instant> aClass) { return Instant.ofEpochSecond(input.readLong(), input.readInt()); } } @@ -81,12 +81,12 @@ final class JavaTimeSerializers { */ final static class LocalDateSerializer implements SerializerShim<LocalDate> { @Override - public <O extends OutputShim> void write(KryoShim<?, O> kryo, O output, LocalDate localDate) { + public <O extends OutputShim> void write(final KryoShim<?, O> kryo, final O output, final LocalDate localDate) { output.writeLong(localDate.toEpochDay()); } @Override - public <I extends InputShim> LocalDate read(KryoShim<I, ?> kryo, I input, Class<LocalDate> clazz) { + public <I extends InputShim> LocalDate read(final KryoShim<I, ?> kryo, final I input, final Class<LocalDate> clazz) { return LocalDate.ofEpochDay(input.readLong()); } } @@ -96,7 +96,7 @@ final class JavaTimeSerializers { */ final static class LocalDateTimeSerializer implements SerializerShim<LocalDateTime> { @Override - public <O extends OutputShim> void write(KryoShim<?, O> kryo, O output, LocalDateTime localDateTime) { + public <O extends OutputShim> void write(final KryoShim<?, O> kryo, final O output, final LocalDateTime localDateTime) { output.writeInt(localDateTime.getYear()); output.writeInt(localDateTime.getMonthValue()); output.writeInt(localDateTime.getDayOfMonth()); @@ -107,7 +107,7 @@ final class JavaTimeSerializers { } @Override - public <I extends InputShim> LocalDateTime read(KryoShim<I, ?> kryo, I input, Class<LocalDateTime> clazz) { + public <I extends InputShim> LocalDateTime read(final KryoShim<I, ?> kryo, final I input, final Class<LocalDateTime> clazz) { return LocalDateTime.of(input.readInt(), input.readInt(), input.readInt(), input.readInt(), input.readInt(), input.readInt(), input.readInt()); } } @@ -117,12 +117,12 @@ final class JavaTimeSerializers { */ final static class LocalTimeSerializer implements SerializerShim<LocalTime> { @Override - public <O extends OutputShim> void write(KryoShim<?, O> kryo, O output, LocalTime localTime) { + public <O extends OutputShim> void write(final KryoShim<?, O> kryo, final O output, final LocalTime localTime) { output.writeLong(localTime.toNanoOfDay()); } @Override - public <I extends InputShim> LocalTime read(KryoShim<I, ?> kryo, I input, Class<LocalTime> clazz) { + public <I extends InputShim> LocalTime read(final KryoShim<I, ?> kryo, final I input, final Class<LocalTime> clazz) { return LocalTime.ofNanoOfDay(input.readLong()); } } @@ -132,13 +132,13 @@ final class JavaTimeSerializers { */ final static class MonthDaySerializer implements SerializerShim<MonthDay> { @Override - public <O extends OutputShim> void write(KryoShim<?, O> kryo, O output, MonthDay monthDay) { + public <O extends OutputShim> void write(final KryoShim<?, O> kryo, final O output, final MonthDay monthDay) { output.writeInt(monthDay.getMonthValue()); output.writeInt(monthDay.getDayOfMonth()); } @Override - public <I extends InputShim> MonthDay read(KryoShim<I, ?> kryo, I input, Class<MonthDay> clazz) { + public <I extends InputShim> MonthDay read(final KryoShim<I, ?> kryo, final I input, final Class<MonthDay> clazz) { return MonthDay.of(input.readInt(), input.readInt()); } } @@ -148,13 +148,13 @@ final class JavaTimeSerializers { */ final static class OffsetDateTimeSerializer implements SerializerShim<OffsetDateTime> { @Override - public <O extends OutputShim> void write(KryoShim<?, O> kryo, O output, OffsetDateTime offsetDateTime) { + public <O extends OutputShim> void write(final KryoShim<?, O> kryo, final O output, final OffsetDateTime offsetDateTime) { kryo.writeObject(output, offsetDateTime.toLocalDateTime()); kryo.writeObject(output, offsetDateTime.getOffset()); } @Override - public <I extends InputShim> OffsetDateTime read(KryoShim<I, ?> kryo, I input, Class<OffsetDateTime> clazz) { + public <I extends InputShim> OffsetDateTime read(final KryoShim<I, ?> kryo, final I input, final Class<OffsetDateTime> clazz) { return OffsetDateTime.of(kryo.readObject(input, LocalDateTime.class), kryo.readObject(input, ZoneOffset.class)); } } @@ -164,13 +164,13 @@ final class JavaTimeSerializers { */ final static class OffsetTimeSerializer implements SerializerShim<OffsetTime> { @Override - public <O extends OutputShim> void write(KryoShim<?, O> kryo, O output, OffsetTime offsetTime) { + public <O extends OutputShim> void write(final KryoShim<?, O> kryo, final O output, final OffsetTime offsetTime) { kryo.writeObject(output, offsetTime.toLocalTime()); kryo.writeObject(output, offsetTime.getOffset()); } @Override - public <I extends InputShim> OffsetTime read(KryoShim<I, ?> kryo, I input, Class<OffsetTime> clazz) { + public <I extends InputShim> OffsetTime read(final KryoShim<I, ?> kryo, final I input, final Class<OffsetTime> clazz) { return OffsetTime.of(kryo.readObject(input, LocalTime.class), kryo.readObject(input, ZoneOffset.class)); } } @@ -180,14 +180,14 @@ final class JavaTimeSerializers { */ final static class PeriodSerializer implements SerializerShim<Period> { @Override - public <O extends OutputShim> void write(KryoShim<?, O> kryo, O output, Period period) { + public <O extends OutputShim> void write(final KryoShim<?, O> kryo, final O output, final Period period) { output.writeInt(period.getYears()); output.writeInt(period.getMonths()); output.writeInt(period.getDays()); } @Override - public <I extends InputShim> Period read(KryoShim<I, ?> kryo, I input, Class<Period> clazz) { + public <I extends InputShim> Period read(final KryoShim<I, ?> kryo, final I input, final Class<Period> clazz) { return Period.of(input.readInt(), input.readInt(), input.readInt()); } } @@ -197,12 +197,12 @@ final class JavaTimeSerializers { */ final static class YearSerializer implements SerializerShim<Year> { @Override - public <O extends OutputShim> void write(KryoShim<?, O> kryo, O output, Year year) { + public <O extends OutputShim> void write(final KryoShim<?, O> kryo, final O output, final Year year) { output.writeInt(year.getValue()); } @Override - public <I extends InputShim> Year read(KryoShim<I, ?> kryo, I input, Class<Year> clazz) { + public <I extends InputShim> Year read(final KryoShim<I, ?> kryo, final I input, final Class<Year> clazz) { return Year.of(input.readInt()); } } @@ -212,13 +212,13 @@ final class JavaTimeSerializers { */ final static class YearMonthSerializer implements SerializerShim<YearMonth> { @Override - public <O extends OutputShim> void write(KryoShim<?, O> kryo, O output, YearMonth monthDay) { + public <O extends OutputShim> void write(final KryoShim<?, O> kryo, final O output, final YearMonth monthDay) { output.writeInt(monthDay.getYear()); output.writeInt(monthDay.getMonthValue()); } @Override - public <I extends InputShim> YearMonth read(KryoShim<I, ?> kryo, I input, Class<YearMonth> clazz) { + public <I extends InputShim> YearMonth read(final KryoShim<I, ?> kryo, final I input, final Class<YearMonth> clazz) { return YearMonth.of(input.readInt(), input.readInt()); } } @@ -228,7 +228,7 @@ final class JavaTimeSerializers { */ final static class ZonedDateTimeSerializer implements SerializerShim<ZonedDateTime> { @Override - public <O extends OutputShim> void write(KryoShim<?, O> kryo, O output, ZonedDateTime zonedDateTime) { + public <O extends OutputShim> void write(final KryoShim<?, O> kryo, final O output, final ZonedDateTime zonedDateTime) { output.writeInt(zonedDateTime.getYear()); output.writeInt(zonedDateTime.getMonthValue()); output.writeInt(zonedDateTime.getDayOfMonth()); @@ -240,7 +240,7 @@ final class JavaTimeSerializers { } @Override - public <I extends InputShim> ZonedDateTime read(KryoShim<I, ?> kryo, I input, Class<ZonedDateTime> clazz) { + public <I extends InputShim> ZonedDateTime read(final KryoShim<I, ?> kryo, final I input, final Class<ZonedDateTime> clazz) { return ZonedDateTime.of(input.readInt(), input.readInt(), input.readInt(), input.readInt(), input.readInt(), input.readInt(), input.readInt(), ZoneId.of(input.readString())); @@ -252,12 +252,12 @@ final class JavaTimeSerializers { */ final static class ZoneOffsetSerializer implements SerializerShim<ZoneOffset> { @Override - public <O extends OutputShim> void write(KryoShim<?, O> kryo, O output, ZoneOffset zoneOffset) { + public <O extends OutputShim> void write(final KryoShim<?, O> kryo, final O output, final ZoneOffset zoneOffset) { output.writeString(zoneOffset.getId()); } @Override - public <I extends InputShim> ZoneOffset read(KryoShim<I, ?> kryo, I input, Class<ZoneOffset> clazz) { + public <I extends InputShim> ZoneOffset read(final KryoShim<I, ?> kryo, final I input, final Class<ZoneOffset> clazz) { return ZoneOffset.of(input.readString()); } } http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/45abdcc3/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/PairSerializer.java ---------------------------------------------------------------------- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/PairSerializer.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/PairSerializer.java index 0464b22..1465b24 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/PairSerializer.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/PairSerializer.java @@ -33,13 +33,13 @@ import org.javatuples.Pair; */ final class PairSerializer implements SerializerShim<Pair> { @Override - public <O extends OutputShim> void write(KryoShim<?, O> kryo, O output, Pair pair) { + public <O extends OutputShim> void write(final KryoShim<?, O> kryo, final O output, final Pair pair) { kryo.writeClassAndObject(output, pair.getValue0()); kryo.writeClassAndObject(output, pair.getValue1()); } @Override - public <I extends InputShim> Pair read(KryoShim<I, ?> kryo, I input, Class<Pair> pairClass) { + public <I extends InputShim> Pair read(final KryoShim<I, ?> kryo, final I input, final Class<Pair> pairClass) { return Pair.with(kryo.readClassAndObject(input), kryo.readClassAndObject(input)); } } http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/45abdcc3/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/TypeRegistration.java ---------------------------------------------------------------------- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/TypeRegistration.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/TypeRegistration.java index 1f41c0d..a01d967 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/TypeRegistration.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/TypeRegistration.java @@ -66,7 +66,7 @@ public interface TypeRegistration<T> { * @param kryo Kryo instance into which this type is registered * @return the sole parameter */ - Kryo registerWith(Kryo kryo); + Kryo registerWith(final Kryo kryo); /** * Returns true if at least one of {@link #getShadedSerializer()}, {@link #getSerializerShim()}, or http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/45abdcc3/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/InputShim.java ---------------------------------------------------------------------- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/InputShim.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/InputShim.java index 23bec16..424b1bf 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/InputShim.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/InputShim.java @@ -24,15 +24,15 @@ package org.apache.tinkerpop.gremlin.structure.io.gryo.kryoshim; */ public interface InputShim { - byte readByte(); + public byte readByte(); - byte[] readBytes(int size); + public byte[] readBytes(final int size); - String readString(); + public String readString(); - long readLong(); + public long readLong(); - int readInt(); + public int readInt(); - double readDouble(); + public double readDouble(); } http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/45abdcc3/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/KryoShim.java ---------------------------------------------------------------------- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/KryoShim.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/KryoShim.java index a0f3f87..a4eb2cb 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/KryoShim.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/KryoShim.java @@ -27,15 +27,15 @@ package org.apache.tinkerpop.gremlin.structure.io.gryo.kryoshim; */ public interface KryoShim<I extends InputShim, O extends OutputShim> { - <T> T readObject(I input, Class<T> type); + public <T> T readObject(final I input, final Class<T> type); - Object readClassAndObject(I input); + public Object readClassAndObject(final I input); - void writeObject(O output, Object object); + public void writeObject(final O output, final Object object); - void writeClassAndObject(O output, Object object); + public void writeClassAndObject(final O output, final Object object); - <T> T readObjectOrNull(I input, Class<T> type); + public <T> T readObjectOrNull(final I input, final Class<T> type); - void writeObjectOrNull(O output, Object object, Class type); + public void writeObjectOrNull(final O output, final Object object, final Class type); } http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/45abdcc3/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/KryoShimService.java ---------------------------------------------------------------------- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/KryoShimService.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/KryoShimService.java index 7783856..ee0c8b3 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/KryoShimService.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/KryoShimService.java @@ -52,7 +52,7 @@ public interface KryoShimService { * @param source the stream from which to read an object's serialized form * @return the first deserialized object available from {@code source} */ - Object readClassAndObject(InputStream source); + public Object readClassAndObject(final InputStream source); /** * Serializes an object to an output stream. This may flush the output stream. @@ -60,7 +60,7 @@ public interface KryoShimService { * @param o the object to serialize * @param sink the stream into which the serialized object is written */ - void writeClassAndObject(Object o, OutputStream sink); + public void writeClassAndObject(final Object o, final OutputStream sink); /** * Returns this service's relative priority number. Unless explicitly overridden through a @@ -81,7 +81,7 @@ public interface KryoShimService { * * @return this implementation's priority value */ - int getPriority(); + public int getPriority(); /** * Attempt to incorporate the supplied configuration in future read/write calls. @@ -95,5 +95,5 @@ public interface KryoShimService { * * @param conf the configuration to apply to this service's internal serializer */ - void applyConfiguration(Configuration conf); + public void applyConfiguration(final Configuration conf); } http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/45abdcc3/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/KryoShimServiceLoader.java ---------------------------------------------------------------------- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/KryoShimServiceLoader.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/KryoShimServiceLoader.java index fd57a3c..d16b1a5 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/KryoShimServiceLoader.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/KryoShimServiceLoader.java @@ -49,7 +49,7 @@ public class KryoShimServiceLoader { */ public static final String SHIM_CLASS_SYSTEM_PROPERTY = "tinkerpop.kryo.shim"; - public static void applyConfiguration(Configuration conf) { + public static void applyConfiguration(final Configuration conf) { KryoShimServiceLoader.conf = conf; load(true); } @@ -64,15 +64,15 @@ public class KryoShimServiceLoader { * before selecting a new service to return * @return the shim service */ - public static KryoShimService load(boolean forceReload) { + public static KryoShimService load(final boolean forceReload) { if (null != cachedShimService && !forceReload) { return cachedShimService; } - ArrayList<KryoShimService> services = new ArrayList<>(); + final ArrayList<KryoShimService> services = new ArrayList<>(); - ServiceLoader<KryoShimService> sl = ServiceLoader.load(KryoShimService.class); + final ServiceLoader<KryoShimService> sl = ServiceLoader.load(KryoShimService.class); KryoShimService result = null; @@ -117,7 +117,7 @@ public class KryoShimServiceLoader { log.info("Set {} provider to {} ({}) because its priority value ({}) is the highest available", KryoShimService.class.getSimpleName(), result, result.getClass(), result.getPriority()); - Configuration userConf = conf; + final Configuration userConf = conf; if (null != userConf) { log.info("Configuring {} provider {} with user-provided configuration", @@ -145,10 +145,10 @@ public class KryoShimServiceLoader { * @param o an object for which the instance and class are serialized * @return the serialized form */ - public static byte[] writeClassAndObjectToBytes(Object o) { - KryoShimService shimService = load(); + public static byte[] writeClassAndObjectToBytes(final Object o) { + final KryoShimService shimService = load(); - ByteArrayOutputStream baos = new ByteArrayOutputStream(); + final ByteArrayOutputStream baos = new ByteArrayOutputStream(); shimService.writeClassAndObject(o, baos); @@ -163,8 +163,8 @@ public class KryoShimServiceLoader { * @param <T> the type to which the deserialized object is cast as it is returned * @return the deserialized object */ - public static <T> T readClassAndObject(InputStream source) { - KryoShimService shimService = load(); + public static <T> T readClassAndObject(final InputStream source) { + final KryoShimService shimService = load(); return (T)shimService.readClassAndObject(source); } @@ -183,16 +183,16 @@ public class KryoShimServiceLoader { INSTANCE; @Override - public int compare(KryoShimService a, KryoShimService b) { - int ap = a.getPriority(); - int bp = b.getPriority(); + public int compare(final KryoShimService a, final KryoShimService b) { + final int ap = a.getPriority(); + final int bp = b.getPriority(); if (ap < bp) { return -1; } else if (bp < ap) { return 1; } else { - int result = a.getClass().getCanonicalName().compareTo(b.getClass().getCanonicalName()); + final int result = a.getClass().getCanonicalName().compareTo(b.getClass().getCanonicalName()); if (0 == result) { log.warn("Found two {} implementations with the same canonical classname: {}. " + @@ -201,7 +201,7 @@ public class KryoShimServiceLoader { "META-INF/services/org.apache.tinkerpop.gremlin.structure.io.gryo.kryoshim.KryoShimService.", a.getClass().getCanonicalName()); } else { - String winner = 0 < result ? a.getClass().getCanonicalName() : b.getClass().getCanonicalName(); + final String winner = 0 < result ? a.getClass().getCanonicalName() : b.getClass().getCanonicalName(); log.warn("{} implementations {} and {} are tied with priority value {}. " + "Preferring {} to the other because it has a lexicographically greater classname. " + "Consider setting the system property \"{}\" instead of relying on priority tie-breaking.", http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/45abdcc3/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/OutputShim.java ---------------------------------------------------------------------- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/OutputShim.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/OutputShim.java index e4ca3d5..e3647f3 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/OutputShim.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/OutputShim.java @@ -24,17 +24,17 @@ package org.apache.tinkerpop.gremlin.structure.io.gryo.kryoshim; */ public interface OutputShim { - void writeByte(byte b); + public void writeByte(final byte b); - void writeBytes(byte[] array, int offset, int count); + public void writeBytes(final byte[] array, final int offset, final int count); - void writeString(String s); + public void writeString(final String s); - void writeLong(long l); + public void writeLong(final long l); - void writeInt(int i); + public void writeInt(final int i); - void writeDouble(double d); + public void writeDouble(final double d); - void flush(); + public void flush(); } http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/45abdcc3/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/SerializerShim.java ---------------------------------------------------------------------- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/SerializerShim.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/SerializerShim.java index e5f9005..c36cfee 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/SerializerShim.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/SerializerShim.java @@ -26,11 +26,11 @@ package org.apache.tinkerpop.gremlin.structure.io.gryo.kryoshim; */ public interface SerializerShim<T> { - <O extends OutputShim> void write(KryoShim<?, O> kryo, O output, T object); + public <O extends OutputShim> void write(final KryoShim<?, O> kryo, final O output, final T object); - <I extends InputShim> T read(KryoShim<I, ?> kryo, I input, Class<T> clazz); + public <I extends InputShim> T read(final KryoShim<I, ?> kryo, final I input, final Class<T> clazz); - default boolean isImmutable() { + public default boolean isImmutable() { return false; } } http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/45abdcc3/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/shaded/ShadedInputAdapter.java ---------------------------------------------------------------------- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/shaded/ShadedInputAdapter.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/shaded/ShadedInputAdapter.java index d11c1c4..29524b9 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/shaded/ShadedInputAdapter.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/shaded/ShadedInputAdapter.java @@ -25,7 +25,7 @@ public class ShadedInputAdapter implements InputShim { private final Input shadedInput; - public ShadedInputAdapter(Input shadedInput) { + public ShadedInputAdapter(final Input shadedInput) { this.shadedInput = shadedInput; } @@ -40,7 +40,7 @@ public class ShadedInputAdapter implements InputShim { } @Override - public byte[] readBytes(int size) { + public byte[] readBytes(final int size) { return shadedInput.readBytes(size); } http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/45abdcc3/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/shaded/ShadedKryoAdapter.java ---------------------------------------------------------------------- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/shaded/ShadedKryoAdapter.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/shaded/ShadedKryoAdapter.java index 4283298..5ce0f6d 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/shaded/ShadedKryoAdapter.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/shaded/ShadedKryoAdapter.java @@ -25,42 +25,42 @@ public class ShadedKryoAdapter implements KryoShim<ShadedInputAdapter, ShadedOut private final Kryo shadedKryo; - public ShadedKryoAdapter(Kryo shadedKryo) { + public ShadedKryoAdapter(final Kryo shadedKryo) { this.shadedKryo = shadedKryo; } @Override - public <T> T readObject(ShadedInputAdapter input, Class<T> type) + public <T> T readObject(final ShadedInputAdapter input, final Class<T> type) { return shadedKryo.readObject(input.getShadedInput(), type); } @Override - public Object readClassAndObject(ShadedInputAdapter input) + public Object readClassAndObject(final ShadedInputAdapter input) { return shadedKryo.readClassAndObject(input.getShadedInput()); } @Override - public void writeObject(ShadedOutputAdapter output, Object object) + public void writeObject(final ShadedOutputAdapter output, final Object object) { shadedKryo.writeObject(output.getShadedOutput(), object); } @Override - public void writeClassAndObject(ShadedOutputAdapter output, Object object) + public void writeClassAndObject(final ShadedOutputAdapter output, final Object object) { shadedKryo.writeClassAndObject(output.getShadedOutput(), object); } @Override - public <T> T readObjectOrNull(ShadedInputAdapter input, Class<T> type) + public <T> T readObjectOrNull(final ShadedInputAdapter input, final Class<T> type) { return shadedKryo.readObjectOrNull(input.getShadedInput(), type); } @Override - public void writeObjectOrNull(ShadedOutputAdapter output, Object object, Class type) + public void writeObjectOrNull(final ShadedOutputAdapter output, final Object object, final Class type) { shadedKryo.writeObjectOrNull(output.getShadedOutput(), object, type); } http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/45abdcc3/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/shaded/ShadedOutputAdapter.java ---------------------------------------------------------------------- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/shaded/ShadedOutputAdapter.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/shaded/ShadedOutputAdapter.java index 7547466..b05f528 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/shaded/ShadedOutputAdapter.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/shaded/ShadedOutputAdapter.java @@ -25,38 +25,38 @@ public class ShadedOutputAdapter implements OutputShim { private final Output shadedOutput; - public ShadedOutputAdapter(Output shadedOutput) { + public ShadedOutputAdapter(final Output shadedOutput) { this.shadedOutput = shadedOutput; } @Override - public void writeByte(byte b) + public void writeByte(final byte b) { shadedOutput.writeByte(b); } @Override - public void writeBytes(byte[] array, int offset, int count) { + public void writeBytes(final byte[] array, final int offset, final int count) { shadedOutput.writeBytes(array, offset, count); } @Override - public void writeString(String s) { + public void writeString(final String s) { shadedOutput.writeString(s); } @Override - public void writeLong(long l) { + public void writeLong(final long l) { shadedOutput.writeLong(l); } @Override - public void writeInt(int i) { + public void writeInt(final int i) { shadedOutput.writeInt(i); } @Override - public void writeDouble(double d) { + public void writeDouble(final double d) { shadedOutput.writeDouble(d); } @@ -65,8 +65,7 @@ public class ShadedOutputAdapter implements OutputShim { shadedOutput.flush(); } - Output getShadedOutput() - { + Output getShadedOutput() { return shadedOutput; } } http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/45abdcc3/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/shaded/ShadedSerializerAdapter.java ---------------------------------------------------------------------- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/shaded/ShadedSerializerAdapter.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/shaded/ShadedSerializerAdapter.java index 4ce27b1..28a44bd 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/shaded/ShadedSerializerAdapter.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/shaded/ShadedSerializerAdapter.java @@ -28,27 +28,27 @@ public class ShadedSerializerAdapter<T> extends Serializer<T> { SerializerShim<T> serializer; - public ShadedSerializerAdapter(SerializerShim<T> serializer) { + public ShadedSerializerAdapter(final SerializerShim<T> serializer) { this.serializer = serializer; setImmutable(this.serializer.isImmutable()); } @Override - public void write(Kryo kryo, Output output, T t) { + public void write(final Kryo kryo, final Output output, final T t) { /* These adapters could be cached pretty efficiently in instance fields if it were guaranteed that this * class was never subject to concurrent use. That's true of Kryo instances, but it is not clear that * it is true of Serializer instances. */ - ShadedKryoAdapter shadedKryoAdapter = new ShadedKryoAdapter(kryo); - ShadedOutputAdapter shadedOutputAdapter = new ShadedOutputAdapter(output); + final ShadedKryoAdapter shadedKryoAdapter = new ShadedKryoAdapter(kryo); + final ShadedOutputAdapter shadedOutputAdapter = new ShadedOutputAdapter(output); serializer.write(shadedKryoAdapter, shadedOutputAdapter, t); } @Override - public T read(Kryo kryo, Input input, Class<T> aClass) { + public T read(final Kryo kryo, final Input input, final Class<T> aClass) { // Same caching opportunity as in write(...) - ShadedKryoAdapter shadedKryoAdapter = new ShadedKryoAdapter(kryo); - ShadedInputAdapter shadedInputAdapter = new ShadedInputAdapter(input); + final ShadedKryoAdapter shadedKryoAdapter = new ShadedKryoAdapter(kryo); + final ShadedInputAdapter shadedInputAdapter = new ShadedInputAdapter(input); return serializer.read(shadedKryoAdapter, shadedInputAdapter, aClass); } } http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/45abdcc3/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraphSerializer.java ---------------------------------------------------------------------- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraphSerializer.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraphSerializer.java index 431e1eb..f4ffa7d 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraphSerializer.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraphSerializer.java @@ -81,7 +81,7 @@ public class StarGraphSerializer implements SerializerShim<StarGraph> { * If the returned {@link StarGraph} is null, that means that the {@link GraphFilter} filtered the vertex. */ @Override - public <I extends InputShim> StarGraph read(KryoShim<I, ?> kryo, I input, Class<StarGraph> clazz) { + public <I extends InputShim> StarGraph read(final KryoShim<I, ?> kryo, final I input, final Class<StarGraph> clazz) { final StarGraph starGraph = StarGraph.open(); input.readByte(); // version field ignored for now - for future use with backward compatibility starGraph.edgeProperties = kryo.readObjectOrNull(input, HashMap.class); http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/45abdcc3/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/HadoopPoolShimService.java ---------------------------------------------------------------------- diff --git a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/HadoopPoolShimService.java b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/HadoopPoolShimService.java index 12b5d07..3fad4fd 100644 --- a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/HadoopPoolShimService.java +++ b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/HadoopPoolShimService.java @@ -29,7 +29,7 @@ import java.io.OutputStream; public class HadoopPoolShimService implements KryoShimService { - public Object readClassAndObject(InputStream source) { + public Object readClassAndObject(final InputStream source) { Kryo k = null; @@ -44,14 +44,14 @@ public class HadoopPoolShimService implements KryoShimService { } } - public void writeClassAndObject(Object o, OutputStream sink) { + public void writeClassAndObject(final Object o, final OutputStream sink) { Kryo k = null; try { k = HadoopPools.getGryoPool().takeKryo(); - Output output = new Output(sink); + final Output output = new Output(sink); k.writeClassAndObject(output, o); @@ -69,7 +69,7 @@ public class HadoopPoolShimService implements KryoShimService { } @Override - public void applyConfiguration(Configuration conf) { + public void applyConfiguration(final Configuration conf) { HadoopPools.initialize(conf); } } http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/45abdcc3/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/ObjectWritable.java ---------------------------------------------------------------------- diff --git a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/ObjectWritable.java b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/ObjectWritable.java index 88f7ee1..0379ee6 100644 --- a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/ObjectWritable.java +++ b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/ObjectWritable.java @@ -63,13 +63,13 @@ public final class ObjectWritable<T> implements WritableComparable<ObjectWritabl @Override public void readFields(final DataInput input) throws IOException { - ByteArrayInputStream bais = new ByteArrayInputStream(WritableUtils.readCompressedByteArray(input)); + final ByteArrayInputStream bais = new ByteArrayInputStream(WritableUtils.readCompressedByteArray(input)); this.t = KryoShimServiceLoader.readClassAndObject(bais); } @Override public void write(final DataOutput output) throws IOException { - byte serialized[] = KryoShimServiceLoader.writeClassAndObjectToBytes(this.t); + final byte serialized[] = KryoShimServiceLoader.writeClassAndObjectToBytes(this.t); WritableUtils.writeCompressedByteArray(output, serialized); } http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/45abdcc3/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/VertexWritable.java ---------------------------------------------------------------------- diff --git a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/VertexWritable.java b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/VertexWritable.java index 2252ded..be09941 100644 --- a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/VertexWritable.java +++ b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/VertexWritable.java @@ -61,13 +61,13 @@ public final class VertexWritable implements Writable, Serializable { @Override public void readFields(final DataInput input) throws IOException { this.vertex = null; - ByteArrayInputStream bais = new ByteArrayInputStream(WritableUtils.readCompressedByteArray(input)); + final ByteArrayInputStream bais = new ByteArrayInputStream(WritableUtils.readCompressedByteArray(input)); this.vertex = ((StarGraph)KryoShimServiceLoader.readClassAndObject(bais)).getStarVertex(); // read the star graph; } @Override public void write(final DataOutput output) throws IOException { - byte serialized[] = KryoShimServiceLoader.writeClassAndObjectToBytes(this.vertex.graph()); + final byte serialized[] = KryoShimServiceLoader.writeClassAndObjectToBytes(this.vertex.graph()); WritableUtils.writeCompressedByteArray(output, serialized); } http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/45abdcc3/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/GryoRegistrator.java ---------------------------------------------------------------------- diff --git a/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/GryoRegistrator.java b/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/GryoRegistrator.java index 68112d7..412fd3b 100644 --- a/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/GryoRegistrator.java +++ b/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/GryoRegistrator.java @@ -74,11 +74,11 @@ public class GryoRegistrator implements KryoRegistrator { * or if they would be registered by this class by default (does not affect Kryo's * built-in registrations, e.g. String.class). */ - public void registerClasses(Kryo kryo, Map<Class<?>, Serializer<?>> serializerOverrides, Set<Class<?>> blacklist) { + public void registerClasses(final Kryo kryo, final Map<Class<?>, Serializer<?>> serializerOverrides, final Set<Class<?>> blacklist) { // Apply TinkerPop type registrations copied from GyroSerializer's constructor for (Map.Entry<Class<?>, Serializer<?>> ent : getExtraRegistrations().entrySet()) { - Class<?> targetClass = ent.getKey(); - Serializer<?> ser = ent.getValue(); + final Class<?> targetClass = ent.getKey(); + final Serializer<?> ser = ent.getValue(); // Is this class blacklisted? Skip it. (takes precedence over serializerOverrides) if (blacklist.contains(targetClass)) { @@ -97,7 +97,7 @@ public class GryoRegistrator implements KryoRegistrator { } } - Set<Class<?>> shimmedClassesFromGryoMapper = new HashSet<>(); + final Set<Class<?>> shimmedClassesFromGryoMapper = new HashSet<>(); // Apply GryoMapper's default registrations for (TypeRegistration<?> tr : GryoMapper.build().create().getTypeRegistrations()) { @@ -171,7 +171,7 @@ public class GryoRegistrator implements KryoRegistrator { * iteration in key-insertion-order). */ - LinkedHashMap<Class<?>, Serializer<?>> m = new LinkedHashMap<>(); + final LinkedHashMap<Class<?>, Serializer<?>> m = new LinkedHashMap<>(); // The following entries were copied from GryoSerializer's constructor // This could be turned into a static collection on GryoSerializer to avoid // duplication, but it would be a bit cumbersome to do so without disturbing @@ -218,10 +218,10 @@ public class GryoRegistrator implements KryoRegistrator { return m; } - private boolean checkForAndApplySerializerOverride(Map<Class<?>, Serializer<?>> serializerOverrides, - Kryo kryo, Class<?> targetClass) { + private boolean checkForAndApplySerializerOverride(final Map<Class<?>, Serializer<?>> serializerOverrides, + final Kryo kryo, Class<?> targetClass) { if (serializerOverrides.containsKey(targetClass)) { - Serializer<?> ser = serializerOverrides.get(targetClass); + final Serializer<?> ser = serializerOverrides.get(targetClass); if (null == ser) { // null means use Kryo's default serializer log.debug("Registering {} with default serializer per overrides", targetClass); http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/45abdcc3/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/IoRegistryAwareKryoSerializer.java ---------------------------------------------------------------------- diff --git a/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/IoRegistryAwareKryoSerializer.java b/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/IoRegistryAwareKryoSerializer.java index 8b21e21..bf71fae 100644 --- a/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/IoRegistryAwareKryoSerializer.java +++ b/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/IoRegistryAwareKryoSerializer.java @@ -46,7 +46,7 @@ public class IoRegistryAwareKryoSerializer extends KryoSerializer { private static final Logger log = LoggerFactory.getLogger(IoRegistryAwareKryoSerializer.class); - public IoRegistryAwareKryoSerializer(SparkConf conf) { + public IoRegistryAwareKryoSerializer(final SparkConf conf) { super(conf); // store conf so that we can access its registry (if one is present) in newKryo() this.conf = conf; @@ -54,19 +54,19 @@ public class IoRegistryAwareKryoSerializer extends KryoSerializer { @Override public Kryo newKryo() { - Kryo kryo = super.newKryo(); + final Kryo kryo = super.newKryo(); return applyIoRegistryIfPresent(kryo); } - private Kryo applyIoRegistryIfPresent(Kryo kryo) { + private Kryo applyIoRegistryIfPresent(final Kryo kryo) { if (!conf.contains(GryoPool.CONFIG_IO_REGISTRY)) { log.info("SparkConf {} does not contain setting {}, skipping {} handling", GryoPool.CONFIG_IO_REGISTRY, conf, IoRegistry.class.getCanonicalName()); return kryo; } - String registryClassnames = conf.get(GryoPool.CONFIG_IO_REGISTRY); + final String registryClassnames = conf.get(GryoPool.CONFIG_IO_REGISTRY); for (String registryClassname : registryClassnames.split(",")) { final IoRegistry registry; http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/45abdcc3/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/ObjectWritableSerializer.java ---------------------------------------------------------------------- diff --git a/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/ObjectWritableSerializer.java b/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/ObjectWritableSerializer.java index 4ceb045..01be50d 100644 --- a/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/ObjectWritableSerializer.java +++ b/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/ObjectWritableSerializer.java @@ -35,13 +35,13 @@ import org.apache.tinkerpop.shaded.kryo.io.Output; public final class ObjectWritableSerializer<T> implements SerializerShim<ObjectWritable<T>> { @Override - public <O extends OutputShim> void write(KryoShim<?, O> kryo, O output, ObjectWritable<T> starGraph) { + public <O extends OutputShim> void write(final KryoShim<?, O> kryo, final O output, final ObjectWritable<T> starGraph) { kryo.writeClassAndObject(output, starGraph.get()); output.flush(); } @Override - public <I extends InputShim> ObjectWritable<T> read(KryoShim<I, ?> kryo, I input, Class<ObjectWritable<T>> clazz) { + public <I extends InputShim> ObjectWritable<T> read(final KryoShim<I, ?> kryo, final I input, final Class<ObjectWritable<T>> clazz) { return new ObjectWritable(kryo.readClassAndObject(input)); } } http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/45abdcc3/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/VertexWritableSerializer.java ---------------------------------------------------------------------- diff --git a/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/VertexWritableSerializer.java b/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/VertexWritableSerializer.java index f3c1b15..c89fb05 100644 --- a/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/VertexWritableSerializer.java +++ b/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/VertexWritableSerializer.java @@ -36,13 +36,13 @@ import org.apache.tinkerpop.shaded.kryo.io.Output; public final class VertexWritableSerializer implements SerializerShim<VertexWritable> { @Override - public <O extends OutputShim> void write(KryoShim<?, O> kryo, O output, VertexWritable vertexWritable) { + public <O extends OutputShim> void write(final KryoShim<?, O> kryo, final O output, final VertexWritable vertexWritable) { kryo.writeObject(output, vertexWritable.get().graph()); output.flush(); } @Override - public <I extends InputShim> VertexWritable read(KryoShim<I, ?> kryo, I input, Class<VertexWritable> clazz) { + public <I extends InputShim> VertexWritable read(final KryoShim<I, ?> kryo, final I input, final Class<VertexWritable> clazz) { return new VertexWritable(kryo.readObject(input, StarGraph.class).getStarVertex()); } } http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/45abdcc3/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/kryoshim/unshaded/UnshadedInputAdapter.java ---------------------------------------------------------------------- diff --git a/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/kryoshim/unshaded/UnshadedInputAdapter.java b/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/kryoshim/unshaded/UnshadedInputAdapter.java index c533af7..0f13bb2 100644 --- a/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/kryoshim/unshaded/UnshadedInputAdapter.java +++ b/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/kryoshim/unshaded/UnshadedInputAdapter.java @@ -32,7 +32,7 @@ public class UnshadedInputAdapter implements InputShim private final Input unshadedInput; - public UnshadedInputAdapter(Input unshadedInput) + public UnshadedInputAdapter(final Input unshadedInput) { this.unshadedInput = unshadedInput; } @@ -49,7 +49,7 @@ public class UnshadedInputAdapter implements InputShim } @Override - public byte[] readBytes(int size) { + public byte[] readBytes(final int size) { return unshadedInput.readBytes(size); } http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/45abdcc3/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/kryoshim/unshaded/UnshadedKryoAdapter.java ---------------------------------------------------------------------- diff --git a/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/kryoshim/unshaded/UnshadedKryoAdapter.java b/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/kryoshim/unshaded/UnshadedKryoAdapter.java index b14abe0..94918a3 100644 --- a/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/kryoshim/unshaded/UnshadedKryoAdapter.java +++ b/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/kryoshim/unshaded/UnshadedKryoAdapter.java @@ -31,43 +31,43 @@ public class UnshadedKryoAdapter implements KryoShim<UnshadedInputAdapter, Unsha { private final Kryo unshadedKryo; - public UnshadedKryoAdapter(Kryo unshadedKryo) + public UnshadedKryoAdapter(final Kryo unshadedKryo) { this.unshadedKryo = unshadedKryo; } @Override - public <T> T readObject(UnshadedInputAdapter input, Class<T> type) + public <T> T readObject(final UnshadedInputAdapter input, final Class<T> type) { return unshadedKryo.readObject(input.getUnshadedInput(), type); } @Override - public Object readClassAndObject(UnshadedInputAdapter input) + public Object readClassAndObject(final UnshadedInputAdapter input) { return unshadedKryo.readClassAndObject(input.getUnshadedInput()); } @Override - public void writeObject(UnshadedOutputAdapter output, Object object) + public void writeObject(final UnshadedOutputAdapter output, final Object object) { unshadedKryo.writeObject(output.getUnshadedOutput(), object); } @Override - public void writeClassAndObject(UnshadedOutputAdapter output, Object object) + public void writeClassAndObject(final UnshadedOutputAdapter output, final Object object) { unshadedKryo.writeClassAndObject(output.getUnshadedOutput(), object); } @Override - public <T> T readObjectOrNull(UnshadedInputAdapter input, Class<T> type) + public <T> T readObjectOrNull(final UnshadedInputAdapter input, final Class<T> type) { return unshadedKryo.readObjectOrNull(input.getUnshadedInput(), type); } @Override - public void writeObjectOrNull(UnshadedOutputAdapter output, Object object, Class type) + public void writeObjectOrNull(final UnshadedOutputAdapter output, final Object object, final Class type) { unshadedKryo.writeObjectOrNull(output.getUnshadedOutput(), object, type); } http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/45abdcc3/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/kryoshim/unshaded/UnshadedKryoShimService.java ---------------------------------------------------------------------- diff --git a/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/kryoshim/unshaded/UnshadedKryoShimService.java b/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/kryoshim/unshaded/UnshadedKryoShimService.java index 95ebb0d..41e0001 100644 --- a/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/kryoshim/unshaded/UnshadedKryoShimService.java +++ b/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/kryoshim/unshaded/UnshadedKryoShimService.java @@ -51,9 +51,9 @@ public class UnshadedKryoShimService implements KryoShimService { public UnshadedKryoShimService() { } @Override - public Object readClassAndObject(InputStream source) { + public Object readClassAndObject(final InputStream source) { - LinkedBlockingQueue<Kryo> kryos = initialize(); + final LinkedBlockingQueue<Kryo> kryos = initialize(); Kryo k = null; try { @@ -72,15 +72,15 @@ public class UnshadedKryoShimService implements KryoShimService { } @Override - public void writeClassAndObject(Object o, OutputStream sink) { + public void writeClassAndObject(final Object o, OutputStream sink) { - LinkedBlockingQueue<Kryo> kryos = initialize(); + final LinkedBlockingQueue<Kryo> kryos = initialize(); Kryo k = null; try { k = kryos.take(); - Output kryoOutput = new Output(sink); + final Output kryoOutput = new Output(sink); k.writeClassAndObject(kryoOutput, o); @@ -102,7 +102,7 @@ public class UnshadedKryoShimService implements KryoShimService { } @Override - public void applyConfiguration(Configuration conf) { + public void applyConfiguration(final Configuration conf) { initialize(conf); } @@ -110,22 +110,22 @@ public class UnshadedKryoShimService implements KryoShimService { return initialize(new BaseConfiguration()); } - private LinkedBlockingQueue<Kryo> initialize(Configuration conf) { + private LinkedBlockingQueue<Kryo> initialize(final Configuration conf) { // DCL is safe in this case due to volatility if (!initialized) { synchronized (UnshadedKryoShimService.class) { if (!initialized) { - SparkConf sparkConf = new SparkConf(); + final SparkConf sparkConf = new SparkConf(); // Copy the user's IoRegistry from the param conf to the SparkConf we just created - String regStr = conf.getString(GryoPool.CONFIG_IO_REGISTRY); + final String regStr = conf.getString(GryoPool.CONFIG_IO_REGISTRY); if (null != regStr) { // SparkConf rejects null values with NPE, so this has to be checked before set(...) sparkConf.set(GryoPool.CONFIG_IO_REGISTRY, regStr); } // Setting spark.serializer here almost certainly isn't necessary, but it doesn't hurt sparkConf.set("spark.serializer", IoRegistryAwareKryoSerializer.class.getCanonicalName()); - String registrator = conf.getString("spark.kryo.registrator"); + final String registrator = conf.getString("spark.kryo.registrator"); if (null != registrator) { sparkConf.set("spark.kryo.registrator", registrator); log.info("Copied spark.kryo.registrator: {}", registrator); @@ -134,7 +134,7 @@ public class UnshadedKryoShimService implements KryoShimService { } // Reuse Gryo poolsize for Kryo poolsize (no need to copy this to SparkConf) - int poolSize = conf.getInt(GryoPool.CONFIG_IO_GRYO_POOL_SIZE, + final int poolSize = conf.getInt(GryoPool.CONFIG_IO_GRYO_POOL_SIZE, GryoPool.CONFIG_IO_GRYO_POOL_SIZE_DEFAULT); // Instantiate the spark.serializer final IoRegistryAwareKryoSerializer ioReg = new IoRegistryAwareKryoSerializer(sparkConf); http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/45abdcc3/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/kryoshim/unshaded/UnshadedOutputAdapter.java ---------------------------------------------------------------------- diff --git a/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/kryoshim/unshaded/UnshadedOutputAdapter.java b/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/kryoshim/unshaded/UnshadedOutputAdapter.java index 9cc59d4..8dd8eb3 100644 --- a/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/kryoshim/unshaded/UnshadedOutputAdapter.java +++ b/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/kryoshim/unshaded/UnshadedOutputAdapter.java @@ -31,7 +31,7 @@ public class UnshadedOutputAdapter implements OutputShim { private final Output unshadedOutput; - public UnshadedOutputAdapter(Output unshadedOutput) + public UnshadedOutputAdapter(final Output unshadedOutput) { this.unshadedOutput = unshadedOutput; } @@ -42,35 +42,35 @@ public class UnshadedOutputAdapter implements OutputShim } @Override - public void writeByte(byte b) + public void writeByte(final byte b) { unshadedOutput.writeByte(b); } @Override - public void writeBytes(byte[] array, int offset, int count) { + public void writeBytes(final byte[] array, final int offset, final int count) { unshadedOutput.writeBytes(array, offset, count); } @Override - public void writeString(String s) + public void writeString(final String s) { unshadedOutput.writeString(s); } @Override - public void writeLong(long l) + public void writeLong(final long l) { unshadedOutput.writeLong(l); } @Override - public void writeInt(int i) { + public void writeInt(final int i) { unshadedOutput.writeInt(i); } @Override - public void writeDouble(double d) + public void writeDouble(final double d) { unshadedOutput.writeDouble(d); } http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/45abdcc3/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/kryoshim/unshaded/UnshadedSerializerAdapter.java ---------------------------------------------------------------------- diff --git a/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/kryoshim/unshaded/UnshadedSerializerAdapter.java b/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/kryoshim/unshaded/UnshadedSerializerAdapter.java index efc9a4f..a5f8b05 100644 --- a/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/kryoshim/unshaded/UnshadedSerializerAdapter.java +++ b/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/kryoshim/unshaded/UnshadedSerializerAdapter.java @@ -35,20 +35,20 @@ public class UnshadedSerializerAdapter<T> extends Serializer<T> SerializerShim<T> serializer; - public UnshadedSerializerAdapter(SerializerShim<T> serializer) { + public UnshadedSerializerAdapter(final SerializerShim<T> serializer) { this.serializer = serializer; setImmutable(this.serializer.isImmutable()); } @Override - public void write(Kryo kryo, Output output, T t) { + public void write(final Kryo kryo, final Output output, final T t) { UnshadedKryoAdapter shadedKryoAdapter = new UnshadedKryoAdapter(kryo); UnshadedOutputAdapter shadedOutputAdapter = new UnshadedOutputAdapter(output); serializer.write(shadedKryoAdapter, shadedOutputAdapter, t); } @Override - public T read(Kryo kryo, Input input, Class<T> aClass) + public T read(final Kryo kryo, final Input input, final Class<T> aClass) { UnshadedKryoAdapter shadedKryoAdapter = new UnshadedKryoAdapter(kryo); UnshadedInputAdapter shadedInputAdapter = new UnshadedInputAdapter(input);