)]}'
{"java/monasca-common-util/src/main/java/monasca/common/util/Conversions.java":[{"author":{"_account_id":11809,"name":"Craig Bryant","email":"craig.bryant@hpe.com","username":"craig-bryant"},"change_message_id":"cbe35e729109d3fdceb0cd5f76db3476d35dde13","unresolved":false,"context_lines":[{"line_number":25,"context_line":"   * @exception IllegalArgumentException"},{"line_number":26,"context_line":"   */"},{"line_number":27,"context_line":"  public static Integer variantToInteger(Object variant) {"},{"line_number":28,"context_line":"    if (variant instanceof Integer) {"},{"line_number":29,"context_line":"      return ((Integer) variant);"},{"line_number":30,"context_line":"    } else if (variant instanceof Long) {"},{"line_number":31,"context_line":"      return ((Long) variant).intValue();"}],"source_content_type":"text/x-java","patch_set":1,"id":"da20952f_18d0ce52","line":28,"updated":"2015-09-03 00:43:39.000000000","message":"Maybe the best thing would be to check if it is a Number and cast it to that. Then use intValue(). That will handle any reasonable return type","commit_id":"c53d6319b1c0b2076cc33c156cb7876182916731"},{"author":{"_account_id":11809,"name":"Craig Bryant","email":"craig.bryant@hpe.com","username":"craig-bryant"},"change_message_id":"cbe35e729109d3fdceb0cd5f76db3476d35dde13","unresolved":false,"context_lines":[{"line_number":30,"context_line":"    } else if (variant instanceof Long) {"},{"line_number":31,"context_line":"      return ((Long) variant).intValue();"},{"line_number":32,"context_line":"    } else {"},{"line_number":33,"context_line":"      throw new IllegalArgumentException(String.format(\"Type is not Long or Integer: 1%s\", variant));"},{"line_number":34,"context_line":"    }"},{"line_number":35,"context_line":"  }"},{"line_number":36,"context_line":"}"}],"source_content_type":"text/x-java","patch_set":1,"id":"da20952f_185e8ee9","line":33,"updated":"2015-09-03 00:43:39.000000000","message":"I think you should add variant.getClass() to the error message.","commit_id":"c53d6319b1c0b2076cc33c156cb7876182916731"},{"author":{"_account_id":12512,"name":"Deklan Dieterly","email":"deklan.dieterly@hpe.com","username":"deklan"},"change_message_id":"325e73ab32113a387f8faf8d067b4d08f6dca93c","unresolved":false,"context_lines":[{"line_number":28,"context_line":"    if (variant instanceof Number) {"},{"line_number":29,"context_line":"      return ((Number) variant).intValue();"},{"line_number":30,"context_line":"    } else {"},{"line_number":31,"context_line":"      throw new IllegalArgumentException(String.format(\"Variant of type \\\"%s\\\", and value \\\"%s\\\" is not a Number.\","},{"line_number":32,"context_line":"                                                       variant.getClass(), variant));"},{"line_number":33,"context_line":"    }"},{"line_number":34,"context_line":"  }"}],"source_content_type":"text/x-java","patch_set":2,"id":"da20952f_f8660dec","line":31,"updated":"2015-09-03 20:05:14.000000000","message":"How about single quotes in double quotes or double quotes in single quotes. That would get rid of the backslashes and make the code more readable.","commit_id":"6cdf714956624e23b129b9d2e3c84eb87aabd43b"},{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"67628370d479ba35990127c3fc08c3852d00b384","unresolved":false,"context_lines":[{"line_number":28,"context_line":"    if (variant instanceof Number) {"},{"line_number":29,"context_line":"      return ((Number) variant).intValue();"},{"line_number":30,"context_line":"    } else {"},{"line_number":31,"context_line":"      throw new IllegalArgumentException(String.format(\"Variant of type \\\"%s\\\", and value \\\"%s\\\" is not a Number.\","},{"line_number":32,"context_line":"                                                       variant.getClass(), variant));"},{"line_number":33,"context_line":"    }"},{"line_number":34,"context_line":"  }"}],"source_content_type":"text/x-java","patch_set":2,"id":"da20952f_58d13956","line":31,"in_reply_to":"da20952f_f8660dec","updated":"2015-09-03 20:10:07.000000000","message":"hmmm, but would the final message be easier to read?\n\nI think double quotes in the message is more readable, and I worry most about our customers, i would readily sacrifice a little code readability to make our customers happier\n\nhappy, happy, happy","commit_id":"6cdf714956624e23b129b9d2e3c84eb87aabd43b"}]}
