However, the parameter is of of Map interface type which means, one can not assume anything about the implementation. Therefore, more appropriate fix could be e.g. in the constructor of PgRow:
pgColumns = new PgColumn[row.getColumns().size()];
for (PgColumn col : row.getColumns().values()) {
pgColumns[col.index] = col;
}
In: https://github.com/alaisi/postgres-async-driver/blob/master/src/main/java/com/github/pgasync/impl/PgRow.java#L47 PgColumn[] pgColumns order might be different from PgColumn.index values which makes get...(int index) methods quite useless at the moment.
See example situation in debugger:
Unfortunately this issue can most likely re-produce by random, so I can not provide a particular test case that would always fail.
This is caused by relying on HashMap.values() order although the order is not the same as the order they are put into the Map by its contract. This issue could most likely be resolved by using LinkedHashMap in com.github.pgasync.impl.PgConnection#getColumns: https://github.com/alaisi/postgres-async-driver/blob/master/src/main/java/com/github/pgasync/impl/PgConnection.java#L187
However, the parameter is of of Map interface type which means, one can not assume anything about the implementation. Therefore, more appropriate fix could be e.g. in the constructor of PgRow: