diff --git a/pom.xml b/pom.xml
index 6158b58b7..edf8f411e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -84,7 +84,21 @@
- org.codehaus.mojo
+ org.apache.maven.plugins
+ maven-source-plugin
+ 2.4
+
+
+ attach-sources
+
+ jar
+ test-jar
+
+
+
+
+
+ org.codehaus.mojo
build-helper-maven-plugin
1.9.1
diff --git a/src/main/java/com/impossibl/postgres/system/procs/BinaryDecoder.java b/src/main/java/com/impossibl/postgres/system/procs/BinaryDecoder.java
index 5ff8dfa55..c18491a52 100644
--- a/src/main/java/com/impossibl/postgres/system/procs/BinaryDecoder.java
+++ b/src/main/java/com/impossibl/postgres/system/procs/BinaryDecoder.java
@@ -37,7 +37,7 @@
public abstract class BinaryDecoder implements Type.Codec.Decoder {
- abstract Object decode(Type type, Short typeLength, Integer typeModifier, ByteBuf buffer, Context context) throws IOException;
+ protected abstract Object decode(Type type, Short typeLength, Integer typeModifier, ByteBuf buffer, Context context) throws IOException;
@Override
public Object decode(Type type, Short typeLength, Integer typeModifier, Object buffer, Context context) throws IOException {
diff --git a/src/main/java/com/impossibl/postgres/system/procs/BinaryEncoder.java b/src/main/java/com/impossibl/postgres/system/procs/BinaryEncoder.java
index ef9e977a7..ce7d6996a 100644
--- a/src/main/java/com/impossibl/postgres/system/procs/BinaryEncoder.java
+++ b/src/main/java/com/impossibl/postgres/system/procs/BinaryEncoder.java
@@ -38,7 +38,7 @@
public abstract class BinaryEncoder implements Type.Codec.Encoder {
- abstract void encode(Type type, ByteBuf buffer, Object val, Context context) throws IOException;
+ protected abstract void encode(Type type, ByteBuf buffer, Object val, Context context) throws IOException;
@Override
public void encode(Type type, Object buffer, Object value, Context context) throws IOException {
diff --git a/src/main/java/com/impossibl/postgres/system/procs/Dates.java b/src/main/java/com/impossibl/postgres/system/procs/Dates.java
index dc9a247a5..bc4b558d1 100644
--- a/src/main/java/com/impossibl/postgres/system/procs/Dates.java
+++ b/src/main/java/com/impossibl/postgres/system/procs/Dates.java
@@ -204,7 +204,7 @@ public Class> getOutputType() {
}
@Override
- Object decode(Type type, Short typeLength, Integer typeModifier, CharSequence buffer, Context context) throws IOException {
+ protected Object decode(Type type, Short typeLength, Integer typeModifier, CharSequence buffer, Context context) throws IOException {
Map pieces = new HashMap<>();
@@ -228,7 +228,7 @@ public Class> getInputType() {
}
@Override
- void encode(Type type, StringBuilder buffer, Object val, Context context) throws IOException {
+ protected void encode(Type type, StringBuilder buffer, Object val, Context context) throws IOException {
String strVal = context.getDateFormatter().getPrinter().format((Instant) val);
diff --git a/src/main/java/com/impossibl/postgres/system/procs/TextDecoder.java b/src/main/java/com/impossibl/postgres/system/procs/TextDecoder.java
index add01a693..0ddc481fd 100644
--- a/src/main/java/com/impossibl/postgres/system/procs/TextDecoder.java
+++ b/src/main/java/com/impossibl/postgres/system/procs/TextDecoder.java
@@ -37,7 +37,7 @@
public abstract class TextDecoder implements Type.Codec.Decoder {
- abstract Object decode(Type type, Short typeLength, Integer typeModifier, CharSequence buffer, Context context) throws IOException;
+ protected abstract Object decode(Type type, Short typeLength, Integer typeModifier, CharSequence buffer, Context context) throws IOException;
@Override
public Object decode(Type type, Short typeLength, Integer typeModifier, Object buffer, Context context) throws IOException {
diff --git a/src/main/java/com/impossibl/postgres/system/procs/TextEncoder.java b/src/main/java/com/impossibl/postgres/system/procs/TextEncoder.java
index e9d98cd69..d5fabc7f3 100644
--- a/src/main/java/com/impossibl/postgres/system/procs/TextEncoder.java
+++ b/src/main/java/com/impossibl/postgres/system/procs/TextEncoder.java
@@ -37,7 +37,7 @@
public abstract class TextEncoder implements Type.Codec.Encoder {
- abstract void encode(Type type, StringBuilder buffer, Object val, Context context) throws IOException;
+ protected abstract void encode(Type type, StringBuilder buffer, Object val, Context context) throws IOException;
@Override
public void encode(Type type, Object buffer, Object value, Context context) throws IOException {
diff --git a/src/main/java/com/impossibl/postgres/system/procs/Tids.java b/src/main/java/com/impossibl/postgres/system/procs/Tids.java
index e8ac69934..dfc13a835 100644
--- a/src/main/java/com/impossibl/postgres/system/procs/Tids.java
+++ b/src/main/java/com/impossibl/postgres/system/procs/Tids.java
@@ -58,7 +58,7 @@ public Class> getOutputType() {
}
@Override
- Object decode(Type type, Short typeLength, Integer typeModifier, ByteBuf buffer, Context context) throws IOException {
+ protected Object decode(Type type, Short typeLength, Integer typeModifier, ByteBuf buffer, Context context) throws IOException {
int length = buffer.readInt();
if (length == -1) {
@@ -89,7 +89,7 @@ public Class> getInputType() {
}
@Override
- void encode(Type type, ByteBuf buffer, Object val, Context context) throws IOException {
+ protected void encode(Type type, ByteBuf buffer, Object val, Context context) throws IOException {
if (val == null) {
@@ -126,7 +126,7 @@ public Class> getOutputType() {
}
@Override
- Tid decode(Type type, Short typeLength, Integer typeModifier, CharSequence buffer, Context context) throws IOException {
+ protected Tid decode(Type type, Short typeLength, Integer typeModifier, CharSequence buffer, Context context) throws IOException {
String[] items = buffer.subSequence(1, buffer.length() - 1).toString().split(",");
@@ -151,7 +151,7 @@ public Class> getInputType() {
}
@Override
- void encode(Type type, StringBuilder buffer, Object val, Context context) throws IOException {
+ protected void encode(Type type, StringBuilder buffer, Object val, Context context) throws IOException {
Tid tid = (Tid) val;
diff --git a/src/main/java/com/impossibl/postgres/system/procs/TimesWithTZ.java b/src/main/java/com/impossibl/postgres/system/procs/TimesWithTZ.java
index 08b966d12..d620c6cc8 100644
--- a/src/main/java/com/impossibl/postgres/system/procs/TimesWithTZ.java
+++ b/src/main/java/com/impossibl/postgres/system/procs/TimesWithTZ.java
@@ -145,7 +145,7 @@ public Class> getOutputType() {
}
@Override
- Object decode(Type type, Short typeLength, Integer typeModifier, CharSequence buffer, Context context) throws IOException {
+ protected Object decode(Type type, Short typeLength, Integer typeModifier, CharSequence buffer, Context context) throws IOException {
Map pieces = new HashMap<>();
@@ -169,7 +169,7 @@ public Class> getInputType() {
}
@Override
- void encode(Type type, StringBuilder buffer, Object val, Context context) throws IOException {
+ protected void encode(Type type, StringBuilder buffer, Object val, Context context) throws IOException {
String strVal = context.getTimeFormatter().getPrinter().format((Instant) val);
diff --git a/src/main/java/com/impossibl/postgres/system/procs/TimesWithoutTZ.java b/src/main/java/com/impossibl/postgres/system/procs/TimesWithoutTZ.java
index f11b567db..ef2ee2563 100644
--- a/src/main/java/com/impossibl/postgres/system/procs/TimesWithoutTZ.java
+++ b/src/main/java/com/impossibl/postgres/system/procs/TimesWithoutTZ.java
@@ -135,7 +135,7 @@ public Class> getOutputType() {
}
@Override
- Object decode(Type type, Short typeLength, Integer typeModifier, CharSequence buffer, Context context) throws IOException {
+ protected Object decode(Type type, Short typeLength, Integer typeModifier, CharSequence buffer, Context context) throws IOException {
Map pieces = new HashMap<>();
@@ -159,7 +159,7 @@ public Class> getInputType() {
}
@Override
- void encode(Type type, StringBuilder buffer, Object val, Context context) throws IOException {
+ protected void encode(Type type, StringBuilder buffer, Object val, Context context) throws IOException {
String strVal = context.getTimeFormatter().getPrinter().format((Instant) val);
diff --git a/src/main/java/com/impossibl/postgres/system/procs/Timestamps.java b/src/main/java/com/impossibl/postgres/system/procs/Timestamps.java
index 7d458d049..90971d3ff 100644
--- a/src/main/java/com/impossibl/postgres/system/procs/Timestamps.java
+++ b/src/main/java/com/impossibl/postgres/system/procs/Timestamps.java
@@ -190,7 +190,7 @@ public Class> getOutputType() {
}
@Override
- Object decode(Type type, Short typeLength, Integer typeModifier, CharSequence buffer, Context context) throws IOException {
+ protected Object decode(Type type, Short typeLength, Integer typeModifier, CharSequence buffer, Context context) throws IOException {
Map pieces = new HashMap<>();
@@ -220,7 +220,7 @@ public Class> getInputType() {
}
@Override
- void encode(Type type, StringBuilder buffer, Object val, Context context) throws IOException {
+ protected void encode(Type type, StringBuilder buffer, Object val, Context context) throws IOException {
String strVal = context.getTimestampFormatter().getPrinter().format((Instant) val);
diff --git a/src/test/java/com/impossibl/postgres/jdbc/CodecTest.java b/src/test/java/com/impossibl/postgres/jdbc/CodecTest.java
index 0d2bd0c06..485cb7efc 100644
--- a/src/test/java/com/impossibl/postgres/jdbc/CodecTest.java
+++ b/src/test/java/com/impossibl/postgres/jdbc/CodecTest.java
@@ -85,9 +85,9 @@
@RunWith(Parameterized.class)
public class CodecTest {
- PGConnectionImpl conn;
- String typeName;
- Object value;
+ protected PGConnectionImpl conn;
+ protected String typeName;
+ protected Object value;
public CodecTest(String typeName, Object value) {
this.typeName = typeName;
@@ -340,7 +340,7 @@ private void assertStreamEquals(InputStream expected, InputStream actual) throws
assertArrayEquals(ByteStreams.toByteArray(expected), ByteStreams.toByteArray(actual));
}
- interface Maker {
+ public interface Maker {
Object make(PGConnectionImpl conn) throws SQLException;
}
@@ -447,6 +447,10 @@ public Object make(PGConnectionImpl conn) throws SQLException {
{"tid", new PGRowId(new Tid(0, (short) 1))},
};
+ return expandDataTypesToStructsAndArrays(scalarTypesData);
+ }
+
+ public static Collection