Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
## version 5.1.0-SNAPSHOT
*Released*: TBD

## version 5.0.1
*Released*: 30 January 2023
* Fix regression introduced in 5.0.0: `RowsResponse.fixupParsedData()` was called before `_requiredVersion` was set. This caused
the fixup method to skip `BigDecimal` to `Double` conversions in the returned data maps.

## version 5.0.0
*Released*: 24 January 2023
* Refactor the `Command` class hierarchy:
Expand All @@ -23,7 +28,7 @@
* Introduce `HasRequiredVersion` interface and use it when instantiating `CommandResponse` subclasses that need required version
* Remove all `Command` copy constructors. Same rationale as the earlier removal of `copy` methods.
* Switch `SelectRowsCommand` and `NAbRunsCommand` to post their parameters as JSON
* Fix NAbReplicate to handle `"NaN"` values
* Fix `NAbReplicate` to handle `"NaN"` values
* Remove `CommandException` from `getHttpRequest()` throws list
* Adjust the `Demo.java` and `Test.java` tests to match current sample data and `Command` hierarchy changes

Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ artifactory_contextUrl=https://labkey.jfrog.io/artifactory
sourceCompatibility=17
targetCompatibility=17

gradlePluginsVersion=1.39.0
gradlePluginsVersion=1.39.1

commonsCodecVersion=1.15
commonsLoggingVersion=1.2

hamcrestVersion=1.3

httpclient5Version=5.2.1
httpcore5Version=5.2
httpcore5Version=5.2.1

jsonObjectVersion=20220924

Expand Down
9 changes: 5 additions & 4 deletions src/org/labkey/remoteapi/query/RowsResponse.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,17 @@ abstract class RowsResponse extends CommandResponse
RowsResponse(String text, int statusCode, String contentType, JSONObject json, HasRequiredVersion hasRequiredVersion)
{
super(text, statusCode, contentType, json);
fixupParsedData();
caseInsensitizeRowMaps();
_requiredVersion = hasRequiredVersion.getRequiredVersion();
fixupParsedData(_requiredVersion);
caseInsensitizeRowMaps();
}

/**
* Returns the API version number required by the source command. This response returns data in a different format
* depending on the required version
* @return the requested API version number
*/
@Deprecated // Just needed for fixup -- exposing this outside the class seems unnecessary. TODO: Remove this in v6.0.0
public double getRequiredVersion()
{
return _requiredVersion;
Expand All @@ -83,7 +84,7 @@ public List<Map<String, Object>> getRows()
/**
* Fixes up the parsed data. Currently, this converts string-based date literals into real Java Date objects.
*/
private void fixupParsedData()
private void fixupParsedData(double requiredVersion)
{
if (null == getParsedData())
return;
Expand Down Expand Up @@ -124,7 +125,7 @@ else if ("int".equalsIgnoreCase(type))
// date classes. If this format ever changes, we'll need to change the format string used here.
// CONSIDER: use a library like ConvertUtils to avoid this dependency?
DateParser dateFormat = new DateParser();
boolean expandedFormat = getRequiredVersion() == 9.1;
boolean expandedFormat = requiredVersion == 9.1;

for (Map<String, Object> row : rows)
{
Expand Down