diff --git a/src/main/java/com/samskivert/depot/Transformers.java b/src/main/java/com/samskivert/depot/Transformers.java index 915f204..a00ac9f 100644 --- a/src/main/java/com/samskivert/depot/Transformers.java +++ b/src/main/java/com/samskivert/depot/Transformers.java @@ -23,7 +23,6 @@ package com.samskivert.depot; import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; -import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Collections; @@ -32,22 +31,18 @@ import java.util.LinkedList; import java.util.List; import java.util.Set; +import com.google.common.base.Preconditions; +import com.google.common.collect.Interner; +import com.google.common.collect.Interners; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; + import com.samskivert.util.ByteEnum; import com.samskivert.util.ByteEnumUtil; import com.samskivert.depot.annotation.Column; import com.samskivert.depot.annotation.Transform; -import com.google.common.base.Preconditions; - -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Interner; -import com.google.common.collect.Interners; -import com.google.common.collect.Iterables; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; - /** * Contains various generally useful {@link Transformer} implementations. To use a transformer, you * specify it via a {@link Column} annotation. For example: @@ -97,12 +92,12 @@ public class Transformers */ public static class StringArray extends StringBase { - protected Iterable asIterable (String[] value) + @Override protected Iterable asIterable (String[] value) { return Arrays.asList(value); } - protected Builder createBuilder (String encoded) + @Override protected Builder createBuilder (String encoded) { // jog through and count the elements so that we can populate the array directly final String[] result = new String[countElements(encoded)]; @@ -126,12 +121,12 @@ public class Transformers */ public static class StringIterable extends StringBase> { - protected Iterable asIterable (Iterable value) + @Override protected Iterable asIterable (Iterable value) { return value; } - protected Builder> createBuilder (String encoded) + @Override protected Builder> createBuilder (String encoded) { Collection adder; Collection retval = null; @@ -200,7 +195,7 @@ public class Transformers if (s == null) { buf.append("\\\n"); // encode nulls as slash followed by the terminator } else { - s = s.replace("\\", "\\\\"); // turn \ into \\ + s = s.replace("\\", "\\\\"); // turn \ into \\ s = s.replace("\n", "\\n"); // turn a newline in a String to "\n" buf.append(s).append('\n'); } diff --git a/src/test/java/com/samskivert/depot/TransformTest.java b/src/test/java/com/samskivert/depot/TransformTest.java index d12c9d1..d6c2ef0 100644 --- a/src/test/java/com/samskivert/depot/TransformTest.java +++ b/src/test/java/com/samskivert/depot/TransformTest.java @@ -101,11 +101,11 @@ public class TransformTest extends TestBase public static class CustomTypeTransformer extends Transformer { - public String toPersistent (CustomType value) { + @Override public String toPersistent (CustomType value) { return value.value; } - public CustomType fromPersistent (String value) { + @Override public CustomType fromPersistent (String value) { return new CustomType(value); } } @@ -116,10 +116,10 @@ public class TransformTest extends TestBase @SuppressWarnings("unchecked") Class eclass = (Class)ftype; _eclass = eclass; } - public Short toPersistent (ShortEnum value) { + @Override public Short toPersistent (ShortEnum value) { return value.toShort(); } - public ShortEnum fromPersistent (Short value) { + @Override public ShortEnum fromPersistent (Short value) { return fromShort(_eclass, value); } private enum Dummy implements ShortEnum {