diff options
author | Simon Brandhof <simon.brandhof@gmail.com> | 2012-10-23 11:12:33 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@gmail.com> | 2012-10-23 11:12:33 +0200 |
commit | 8a8788fb4e8eb083935fdca81884f21fb443d6a4 (patch) | |
tree | ec0cb8c97db35104b1ceb85562e08616cb1e676c /sonar-ws-client/src | |
parent | c408b3c0bf41d1b897d58f394a9a7133f53bfd1e (diff) | |
download | sonarqube-8a8788fb4e8eb083935fdca81884f21fb443d6a4.tar.gz sonarqube-8a8788fb4e8eb083935fdca81884f21fb443d6a4.zip |
Fix quality flaws
Diffstat (limited to 'sonar-ws-client/src')
7 files changed, 25 insertions, 25 deletions
diff --git a/sonar-ws-client/src/main/java/org/sonar/wsclient/Sonar.java b/sonar-ws-client/src/main/java/org/sonar/wsclient/Sonar.java index b41b73b32c7..ed6d749220f 100644 --- a/sonar-ws-client/src/main/java/org/sonar/wsclient/Sonar.java +++ b/sonar-ws-client/src/main/java/org/sonar/wsclient/Sonar.java @@ -45,12 +45,12 @@ public class Sonar { return connector; } - public <MODEL extends Model> MODEL find(Query<MODEL> query) { + public <M extends Model> M find(Query<M> query) { String json = connector.execute(query); - MODEL result = null; + M result = null; if (json != null) { try { - Unmarshaller<MODEL> unmarshaller = Unmarshallers.forModel(query.getModelClass()); + Unmarshaller<M> unmarshaller = Unmarshallers.forModel(query.getModelClass()); result = unmarshaller.toModel(json); } catch (Exception e) { throw new UnmarshalException(query, json, e); @@ -59,14 +59,14 @@ public class Sonar { return result; } - public <MODEL extends Model> List<MODEL> findAll(Query<MODEL> query) { + public <M extends Model> List<M> findAll(Query<M> query) { String json = connector.execute(query); - List<MODEL> result; + List<M> result; if (json == null) { result = Collections.emptyList(); } else { try { - Unmarshaller<MODEL> unmarshaller = Unmarshallers.forModel(query.getModelClass()); + Unmarshaller<M> unmarshaller = Unmarshallers.forModel(query.getModelClass()); result = unmarshaller.toModels(json); } catch (Exception e) { throw new UnmarshalException(query, json, e); @@ -75,12 +75,12 @@ public class Sonar { return result; } - public <MODEL extends Model> MODEL create(CreateQuery<MODEL> query) { + public <M extends Model> M create(CreateQuery<M> query) { String json = connector.execute(query); - MODEL result = null; + M result = null; if (json != null) { try { - Unmarshaller<MODEL> unmarshaller = Unmarshallers.forModel(query.getModelClass()); + Unmarshaller<M> unmarshaller = Unmarshallers.forModel(query.getModelClass()); result = unmarshaller.toModel(json); } catch (Exception e) { throw new UnmarshalException(query, json, e); 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 a63ad110dbe..3bf6f10b2f1 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 @@ -24,7 +24,7 @@ import java.util.Date; /** * @since 2.2 */ -public abstract class AbstractQuery<MODEL extends Model> { +public abstract class AbstractQuery<M extends Model> { /** * Default timeout for waiting data, in milliseconds. @@ -72,7 +72,7 @@ public abstract class AbstractQuery<MODEL extends Model> { * * @since 2.10 */ - public final AbstractQuery<MODEL> setTimeoutMilliseconds(int i) { + public final AbstractQuery<M> setTimeoutMilliseconds(int i) { this.timeoutMilliseconds = (i < 0 ? 0 : i); return this; } @@ -91,7 +91,7 @@ public abstract class AbstractQuery<MODEL extends Model> { * * @since 2.10 */ - public final AbstractQuery<MODEL> setLocale(String locale) { + public final AbstractQuery<M> setLocale(String locale) { this.locale = locale; return this; } diff --git a/sonar-ws-client/src/main/java/org/sonar/wsclient/services/CreateQuery.java b/sonar-ws-client/src/main/java/org/sonar/wsclient/services/CreateQuery.java index a0ab64cafc9..8f8d5ef2057 100644 --- a/sonar-ws-client/src/main/java/org/sonar/wsclient/services/CreateQuery.java +++ b/sonar-ws-client/src/main/java/org/sonar/wsclient/services/CreateQuery.java @@ -24,8 +24,8 @@ package org.sonar.wsclient.services; * * @since 2.2 */ -public abstract class CreateQuery<MODEL extends Model> extends AbstractQuery<MODEL> { +public abstract class CreateQuery<M extends Model> extends AbstractQuery<M> { - public abstract Class<MODEL> getModelClass(); + public abstract Class<M> getModelClass(); } diff --git a/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Query.java b/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Query.java index 11168d3a6e4..72c95c21990 100644 --- a/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Query.java +++ b/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Query.java @@ -22,8 +22,8 @@ package org.sonar.wsclient.services; /** * @since 2.1 */ -public abstract class Query<MODEL extends Model> extends AbstractQuery<MODEL> { +public abstract class Query<M extends Model> extends AbstractQuery<M> { - public abstract Class<MODEL> getModelClass(); + public abstract Class<M> getModelClass(); }
\ No newline at end of file diff --git a/sonar-ws-client/src/main/java/org/sonar/wsclient/services/UpdateQuery.java b/sonar-ws-client/src/main/java/org/sonar/wsclient/services/UpdateQuery.java index 0e26c0b1a76..eecce8b992c 100644 --- a/sonar-ws-client/src/main/java/org/sonar/wsclient/services/UpdateQuery.java +++ b/sonar-ws-client/src/main/java/org/sonar/wsclient/services/UpdateQuery.java @@ -24,8 +24,8 @@ package org.sonar.wsclient.services; * * @since 2.6 */ -public abstract class UpdateQuery<MODEL extends Model> extends AbstractQuery<MODEL> { +public abstract class UpdateQuery<M extends Model> extends AbstractQuery<M> { - public abstract Class<MODEL> getModelClass(); + public abstract Class<M> getModelClass(); } diff --git a/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/AbstractUnmarshaller.java b/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/AbstractUnmarshaller.java index 142dea0772e..0170c24e6c5 100644 --- a/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/AbstractUnmarshaller.java +++ b/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/AbstractUnmarshaller.java @@ -25,11 +25,11 @@ import org.sonar.wsclient.services.WSUtils; import java.util.ArrayList; import java.util.List; -public abstract class AbstractUnmarshaller<MODEL extends Model> implements Unmarshaller<MODEL> { +public abstract class AbstractUnmarshaller<M extends Model> implements Unmarshaller<M> { - public final MODEL toModel(String json) { + public final M toModel(String json) { WSUtils utils = WSUtils.getINSTANCE(); - MODEL result = null; + M result = null; Object array = utils.parse(json); if (utils.getArraySize(array) >= 1) { Object elt = utils.getArrayElement(array, 0); @@ -41,9 +41,9 @@ public abstract class AbstractUnmarshaller<MODEL extends Model> implements Unmar } - public final List<MODEL> toModels(String json) { + public final List<M> toModels(String json) { WSUtils utils = WSUtils.getINSTANCE(); - List<MODEL> result = new ArrayList<MODEL>(); + List<M> result = new ArrayList<M>(); Object array = utils.parse(json); for (int i = 0; i < utils.getArraySize(array); i++) { Object elt = utils.getArrayElement(array, i); @@ -54,5 +54,5 @@ public abstract class AbstractUnmarshaller<MODEL extends Model> implements Unmar return result; } - protected abstract MODEL parse(Object elt); + protected abstract M parse(Object elt); } diff --git a/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/Unmarshallers.java b/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/Unmarshallers.java index b34d561fae5..d2bffdec7a5 100644 --- a/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/Unmarshallers.java +++ b/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/Unmarshallers.java @@ -70,7 +70,7 @@ public final class Unmarshallers { unmarshallers.put(Authentication.class, new AuthenticationUnmarshaller()); } - public static <MODEL extends Model> Unmarshaller<MODEL> forModel(Class<MODEL> modelClass) { + public static <M extends Model> Unmarshaller<M> forModel(Class<M> modelClass) { return unmarshallers.get(modelClass); } } |