)]}'
{"java/src/main/java/monasca/api/app/validation/Validation.java":[{"author":{"_account_id":11809,"name":"Craig Bryant","email":"craig.bryant@hpe.com","username":"craig-bryant"},"change_message_id":"f8b0ee98ca657b29eb2912da4c817a4ede32e2cb","unresolved":false,"context_lines":[{"line_number":150,"context_line":"   * @throws WebApplicationException if the {@code startTime} or {@code endTime} are invalid"},{"line_number":151,"context_line":"   */"},{"line_number":152,"context_line":"  public static void validateTimes(DateTime startTime, DateTime endTime) {"},{"line_number":153,"context_line":"    if (endTime !\u003d null \u0026\u0026 !startTime.isBefore(endTime))"},{"line_number":154,"context_line":"        throw Exceptions.badRequest(\"start_time must be before end_time\");"},{"line_number":155,"context_line":"  }"},{"line_number":156,"context_line":""}],"source_content_type":"text/x-java","patch_set":1,"id":"7a740942_29e5fa36","line":153,"updated":"2015-12-08 01:27:51.000000000","message":"The definition of isBefore correctly handles endTime \u003d\u003d null, see the javadoc below. What problem are you seeing?\n\nboolean org.joda.time.base.AbstractInstant.isBefore(ReadableInstant instant)\n\nIs this instant before the instant passed in comparing solely by millisecond.\n\nSpecified by: isBefore(...) in ReadableInstant\nParameters:\ninstant an instant to check against, null means now\nReturns:\ntrue if the instant is before the instant passed in","commit_id":"716dbfcae354ebfa371cef0f202fd9d078783774"},{"author":{"_account_id":18286,"name":"Shinya Kawabata","email":"s-kawabata@wx.jp.nec.com","username":"kawabata"},"change_message_id":"879bc84aacda1e4de757157d4a944b711058bf0c","unresolved":false,"context_lines":[{"line_number":150,"context_line":"   * @throws WebApplicationException if the {@code startTime} or {@code endTime} are invalid"},{"line_number":151,"context_line":"   */"},{"line_number":152,"context_line":"  public static void validateTimes(DateTime startTime, DateTime endTime) {"},{"line_number":153,"context_line":"    if (endTime !\u003d null \u0026\u0026 !startTime.isBefore(endTime))"},{"line_number":154,"context_line":"        throw Exceptions.badRequest(\"start_time must be before end_time\");"},{"line_number":155,"context_line":"  }"},{"line_number":156,"context_line":""}],"source_content_type":"text/x-java","patch_set":1,"id":"7a740942_73e9abe5","line":153,"in_reply_to":"7a740942_18ce462e","updated":"2015-12-08 04:49:51.000000000","message":"Hi Craig. Sorry, my English ability is poor and I may have caused you a misunderstanding.\n\nThis validation has two factors. First is startTime before endTime. Second is startTime before system time. But I think second is insufficient. If startTime and endTime supplied and both are little older than system time, these are not checked.\nSo I think this validation should have First only. I think this reason makes sense.","commit_id":"716dbfcae354ebfa371cef0f202fd9d078783774"},{"author":{"_account_id":18286,"name":"Shinya Kawabata","email":"s-kawabata@wx.jp.nec.com","username":"kawabata"},"change_message_id":"9679424e98cf300171e63735aa10d2e3b3ba4a3b","unresolved":false,"context_lines":[{"line_number":150,"context_line":"   * @throws WebApplicationException if the {@code startTime} or {@code endTime} are invalid"},{"line_number":151,"context_line":"   */"},{"line_number":152,"context_line":"  public static void validateTimes(DateTime startTime, DateTime endTime) {"},{"line_number":153,"context_line":"    if (endTime !\u003d null \u0026\u0026 !startTime.isBefore(endTime))"},{"line_number":154,"context_line":"        throw Exceptions.badRequest(\"start_time must be before end_time\");"},{"line_number":155,"context_line":"  }"},{"line_number":156,"context_line":""}],"source_content_type":"text/x-java","patch_set":1,"id":"7a740942_ace498df","line":153,"in_reply_to":"7a740942_29e5fa36","updated":"2015-12-08 02:16:57.000000000","message":"Hi Craig. Some tempest tests(written in launchpad) have failed my develop environment.\n\nI think my api server\u0027s system time was a little earlier than my tempest test machine\u0027s. It was in one minute perhaps.\nWhen endTime is null, it means now. So startTime is compared to system time. If api server\u0027s system time is earlier than monasca-client it has potential to raise exception.","commit_id":"716dbfcae354ebfa371cef0f202fd9d078783774"},{"author":{"_account_id":11809,"name":"Craig Bryant","email":"craig.bryant@hpe.com","username":"craig-bryant"},"change_message_id":"b30826761d8e753498eb6f99387f1100dc880b2c","unresolved":false,"context_lines":[{"line_number":150,"context_line":"   * @throws WebApplicationException if the {@code startTime} or {@code endTime} are invalid"},{"line_number":151,"context_line":"   */"},{"line_number":152,"context_line":"  public static void validateTimes(DateTime startTime, DateTime endTime) {"},{"line_number":153,"context_line":"    if (endTime !\u003d null \u0026\u0026 !startTime.isBefore(endTime))"},{"line_number":154,"context_line":"        throw Exceptions.badRequest(\"start_time must be before end_time\");"},{"line_number":155,"context_line":"  }"},{"line_number":156,"context_line":""}],"source_content_type":"text/x-java","patch_set":1,"id":"7a740942_b3e5d3a4","line":153,"in_reply_to":"7a740942_73e9abe5","updated":"2015-12-08 05:06:20.000000000","message":"Hi Shinya, I\u0027m not sure I agree. The previous check was:\n1. If endTime is given, then startTime must be \u003c endTime\n2. If endTime is not given, then startTime must be \u003c current system time\n\nYour change removed #2 but left #1. Removing #1 avoids errors in the case where the user doesn\u0027t specify an endTime but their clock is skewed enough that startTime is later than the current system time. I\u0027m not sure that the error is really helpful in that case, but maybe it is.\n\nLet\u0027s see what other people think","commit_id":"716dbfcae354ebfa371cef0f202fd9d078783774"},{"author":{"_account_id":11809,"name":"Craig Bryant","email":"craig.bryant@hpe.com","username":"craig-bryant"},"change_message_id":"fb594ee21962e3d1f02997ebbd8ee7706806d647","unresolved":false,"context_lines":[{"line_number":150,"context_line":"   * @throws WebApplicationException if the {@code startTime} or {@code endTime} are invalid"},{"line_number":151,"context_line":"   */"},{"line_number":152,"context_line":"  public static void validateTimes(DateTime startTime, DateTime endTime) {"},{"line_number":153,"context_line":"    if (endTime !\u003d null \u0026\u0026 !startTime.isBefore(endTime))"},{"line_number":154,"context_line":"        throw Exceptions.badRequest(\"start_time must be before end_time\");"},{"line_number":155,"context_line":"  }"},{"line_number":156,"context_line":""}],"source_content_type":"text/x-java","patch_set":1,"id":"7a740942_18ce462e","line":153,"in_reply_to":"7a740942_a257bf58","updated":"2015-12-08 04:23:17.000000000","message":"Hi Shinya, actually after your explanation and thinking about it some more, I like your change. I just wanted a comment explaining why this is a good change","commit_id":"716dbfcae354ebfa371cef0f202fd9d078783774"},{"author":{"_account_id":11809,"name":"Craig Bryant","email":"craig.bryant@hpe.com","username":"craig-bryant"},"change_message_id":"6bf89d345a51c96b028a4fab2948fac88fe3e07b","unresolved":false,"context_lines":[{"line_number":150,"context_line":"   * @throws WebApplicationException if the {@code startTime} or {@code endTime} are invalid"},{"line_number":151,"context_line":"   */"},{"line_number":152,"context_line":"  public static void validateTimes(DateTime startTime, DateTime endTime) {"},{"line_number":153,"context_line":"    if (endTime !\u003d null \u0026\u0026 !startTime.isBefore(endTime))"},{"line_number":154,"context_line":"        throw Exceptions.badRequest(\"start_time must be before end_time\");"},{"line_number":155,"context_line":"  }"},{"line_number":156,"context_line":""}],"source_content_type":"text/x-java","patch_set":1,"id":"7a740942_ff8ec42c","line":153,"in_reply_to":"7a740942_ace498df","updated":"2015-12-08 02:32:18.000000000","message":"Hi Shinya, Monasca does not like out of sync clocks. That causes issues because measurements can actually be rejected for being too new or too old. Or it messes up the Threshold Engine. That being said, what this change really means is: just give me newer measurements than what my start_time, ignoring the server\u0027s time. Which allows a small discrepancy without causing the exception so that makes sense. Can you add a comment explaining the reasoning here?","commit_id":"716dbfcae354ebfa371cef0f202fd9d078783774"},{"author":{"_account_id":18286,"name":"Shinya Kawabata","email":"s-kawabata@wx.jp.nec.com","username":"kawabata"},"change_message_id":"8cf86da7b1d7f6402682bb72a5a641b0e77222e7","unresolved":false,"context_lines":[{"line_number":150,"context_line":"   * @throws WebApplicationException if the {@code startTime} or {@code endTime} are invalid"},{"line_number":151,"context_line":"   */"},{"line_number":152,"context_line":"  public static void validateTimes(DateTime startTime, DateTime endTime) {"},{"line_number":153,"context_line":"    if (endTime !\u003d null \u0026\u0026 !startTime.isBefore(endTime))"},{"line_number":154,"context_line":"        throw Exceptions.badRequest(\"start_time must be before end_time\");"},{"line_number":155,"context_line":"  }"},{"line_number":156,"context_line":""}],"source_content_type":"text/x-java","patch_set":1,"id":"7a740942_a257bf58","line":153,"in_reply_to":"7a740942_ff8ec42c","updated":"2015-12-08 03:06:21.000000000","message":"Craig. I just wanted to fix tempest test failing. And I didn\u0027t accurately know why tempest test was failed in writing patch. I understood Monasca time policy so I\u0027m going to drop my proposal.","commit_id":"716dbfcae354ebfa371cef0f202fd9d078783774"}]}
