mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
FIX: DataReader was read twice in exception-path (#1314)
This commit is contained in:
committed by
Rob Bygrave
parent
83b463040f
commit
0e1c815826
@@ -70,11 +70,12 @@ public class ScalarTypeJsonList {
|
||||
|
||||
@Override
|
||||
public List read(DataReader dataReader) throws SQLException {
|
||||
String json = dataReader.getString();
|
||||
try {
|
||||
// parse JSON into modifyAware list
|
||||
return EJson.parseList(dataReader.getString(), true);
|
||||
return EJson.parseList(json, true);
|
||||
} catch (IOException e) {
|
||||
throw new SQLException("Failed to parse JSON content as List: [" + dataReader.getString() + "]", e);
|
||||
throw new SQLException("Failed to parse JSON content as List: [" + json + "]", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -73,11 +73,12 @@ public class ScalarTypeJsonSet {
|
||||
|
||||
@Override
|
||||
public Set read(DataReader dataReader) throws SQLException {
|
||||
String json = dataReader.getString();
|
||||
try {
|
||||
// parse JSON into modifyAware list
|
||||
return EJson.parseSet(dataReader.getString(), true);
|
||||
return EJson.parseSet(json, true);
|
||||
} catch (IOException e) {
|
||||
throw new SQLException("Failed to parse JSON content as List: [" + dataReader.getString() + "]", e);
|
||||
throw new SQLException("Failed to parse JSON content as List: [" + json + "]", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user