diff options
author | Simon Brandhof <simon.brandhof@gmail.com> | 2013-08-16 14:00:09 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@gmail.com> | 2013-08-16 14:00:09 +0200 |
commit | 6ed0c6c21ad38ece31a96c9db3e2fdfa0e07eb21 (patch) | |
tree | b7a670c274dff1a01aeafad4f85de37266ae248a /sonar-ws-client/src/main/java | |
parent | 424cffa7da8a34ab30cf4426cb3ee897ba01c743 (diff) | |
download | sonarqube-6ed0c6c21ad38ece31a96c9db3e2fdfa0e07eb21.tar.gz sonarqube-6ed0c6c21ad38ece31a96c9db3e2fdfa0e07eb21.zip |
Fix some quality flaws
Diffstat (limited to 'sonar-ws-client/src/main/java')
-rw-r--r-- | sonar-ws-client/src/main/java/org/sonar/wsclient/services/AbstractQuery.java | 4 | ||||
-rw-r--r-- | sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/JsonUtils.java | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/sonar-ws-client/src/main/java/org/sonar/wsclient/services/AbstractQuery.java b/sonar-ws-client/src/main/java/org/sonar/wsclient/services/AbstractQuery.java index f6c8e398bdc..979e43b51c2 100644 --- a/sonar-ws-client/src/main/java/org/sonar/wsclient/services/AbstractQuery.java +++ b/sonar-ws-client/src/main/java/org/sonar/wsclient/services/AbstractQuery.java @@ -75,7 +75,7 @@ public abstract class AbstractQuery<M extends Model> { * @since 2.10 */ public final AbstractQuery<M> setTimeoutMilliseconds(int i) { - this.timeoutMilliseconds = (i < 0 ? 0 : i); + this.timeoutMilliseconds = i<0 ? 0 : i; return this; } @@ -138,7 +138,7 @@ public abstract class AbstractQuery<M extends Model> { protected static void appendUrlParameter(StringBuilder url, String paramKey, @Nullable Date paramValue, boolean includeTime) { if (paramValue != null) { - String format = (includeTime ? "yyyy-MM-dd'T'HH:mm:ssZ" : "yyyy-MM-dd"); + String format = includeTime ? "yyyy-MM-dd'T'HH:mm:ssZ" : "yyyy-MM-dd"; url.append(paramKey) .append('=') .append(encode(WSUtils.getINSTANCE().format(paramValue, format))) diff --git a/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/JsonUtils.java b/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/JsonUtils.java index 943974d2c3e..c1825cfb03b 100644 --- a/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/JsonUtils.java +++ b/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/JsonUtils.java @@ -111,7 +111,7 @@ public final class JsonUtils { return dateFormat.parse(value); } catch (ParseException e) { - throw new RuntimeException(e); + throw new IllegalArgumentException("Fail to parse date property '" + field + "': " + format, e); } } return null; |