Skip to content

Commit

Permalink
alarms: remove default value for LogEntry received
Browse files Browse the repository at this point in the history
Motivation:

The RESTful services are set to use an object mapper
which suppresses default values on the JSON objects
contained in an ArrayList.

Rather than check for undefined in the javascript
client, it makes more sense to set the value explicitly
rather than relying on the default.

Modification:

Remove the default value for the LogEntry received field
and set it in the DAO implementation.

Result:

The default value appears in the JSON object.

No visible changes to user.

Target: master
Request: 3.2
Require-notes: no
Require-book: no
Acked-by: Tigran
  • Loading branch information
alrossi committed Oct 10, 2017
1 parent 00ecfe0 commit 4c66ad3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ private static String getFormattedDate(Date date) {
private String notes;
private Boolean closed = false;
private Boolean alarm = false;
private Integer received = 1;
private Integer received;

/*
* Reset by request processor according to current mapping.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ public void put(LogEntry entry) {
*/
logger.trace("makePersistent alarm, key={}",
entry.getKey());
entry.setReceived(1);
insertManager.makePersistent(entry);
logger.trace("committing");
}
Expand Down

0 comments on commit 4c66ad3

Please sign in to comment.