From 4413c299ea09c57b94af8647eec901554c2f5c50 Mon Sep 17 00:00:00 2001 From: Inderjeet Singh Date: Tue, 2 Nov 2010 00:13:48 +0000 Subject: [PATCH] Fixing compiler warnings --- .../java/com/google/gson/webservice/client/TaskExecutor.java | 2 +- .../google/gson/webservice/definition/ContentBodySpec.java | 5 +++++ .../com/google/gson/webservice/definition/HeaderMapSpec.java | 3 +++ .../com/google/gson/webservice/definition/rest/HasId.java | 2 +- .../com/google/gson/webservice/definition/rest/MetaData.java | 4 ++-- .../google/gson/webservice/definition/rest/ResourceMap.java | 2 +- wsf/src/main/java/com/google/gson/wsf/server/rest/IdMap.java | 2 +- 7 files changed, 14 insertions(+), 6 deletions(-) diff --git a/wsclient/src/main/java/com/google/gson/webservice/client/TaskExecutor.java b/wsclient/src/main/java/com/google/gson/webservice/client/TaskExecutor.java index 94a7de5d..2d0040d8 100644 --- a/wsclient/src/main/java/com/google/gson/webservice/client/TaskExecutor.java +++ b/wsclient/src/main/java/com/google/gson/webservice/client/TaskExecutor.java @@ -19,7 +19,7 @@ import java.util.concurrent.Executor; /** * An {@link Executor} with an additional method for shutdown. We could have just used - * {@link java.util.concurent.ExecutorService}, however, that requires too many methods to be + * {@link java.util.concurrent.ExecutorService}, however, that requires too many methods to be * implemented. * * @author inder diff --git a/wsdef/src/main/java/com/google/gson/webservice/definition/ContentBodySpec.java b/wsdef/src/main/java/com/google/gson/webservice/definition/ContentBodySpec.java index af8341eb..c3897178 100644 --- a/wsdef/src/main/java/com/google/gson/webservice/definition/ContentBodySpec.java +++ b/wsdef/src/main/java/com/google/gson/webservice/definition/ContentBodySpec.java @@ -36,22 +36,27 @@ public class ContentBodySpec implements ParamMapSpec { this.paramsSpec = Collections.unmodifiableMap(paramsSpec); } + @Override public Type getTypeFor(String paramName) { return paramsSpec.get(paramName); } + @Override public boolean checkIfCompatible(String paramName, Type type) { return type.equals(getTypeFor(paramName)); } + @Override public boolean checkIfCompatible(String paramName, Object object) { return checkIfCompatible(paramName, object.getClass()); } + @Override public Set> entrySet() { return paramsSpec.entrySet(); } + @Override public int size() { return paramsSpec.size(); } diff --git a/wsdef/src/main/java/com/google/gson/webservice/definition/HeaderMapSpec.java b/wsdef/src/main/java/com/google/gson/webservice/definition/HeaderMapSpec.java index 2ed41f91..24b401c7 100644 --- a/wsdef/src/main/java/com/google/gson/webservice/definition/HeaderMapSpec.java +++ b/wsdef/src/main/java/com/google/gson/webservice/definition/HeaderMapSpec.java @@ -44,10 +44,12 @@ public final class HeaderMapSpec implements ParamMapSpec { this.map = map; } + @Override public Type getTypeFor(String headerName) { return map.get(headerName); } + @Override public Set> entrySet() { return map.entrySet(); } @@ -63,6 +65,7 @@ public final class HeaderMapSpec implements ParamMapSpec { return rawClassOfHeader.isAssignableFrom(rawClassOfTargetType); } + @Override public boolean checkIfCompatible(String headerName, Object headerValue) { return checkIfCompatible(headerName, headerValue.getClass()); } diff --git a/wsdef/src/main/java/com/google/gson/webservice/definition/rest/HasId.java b/wsdef/src/main/java/com/google/gson/webservice/definition/rest/HasId.java index 3bd9ad42..677a2b63 100644 --- a/wsdef/src/main/java/com/google/gson/webservice/definition/rest/HasId.java +++ b/wsdef/src/main/java/com/google/gson/webservice/definition/rest/HasId.java @@ -20,7 +20,7 @@ package com.google.gson.webservice.definition.rest; * * @author inder * - * @param type of object + * @param type of object */ public interface HasId { public Id getId(); diff --git a/wsdef/src/main/java/com/google/gson/webservice/definition/rest/MetaData.java b/wsdef/src/main/java/com/google/gson/webservice/definition/rest/MetaData.java index 4450e01a..4caaef7b 100644 --- a/wsdef/src/main/java/com/google/gson/webservice/definition/rest/MetaData.java +++ b/wsdef/src/main/java/com/google/gson/webservice/definition/rest/MetaData.java @@ -62,7 +62,7 @@ public final class MetaData> { } public String getString(String key) { - return (String) map.get(key); + return map.get(key); } public void putString(String key, String value) { @@ -83,7 +83,7 @@ public final class MetaData> { } public Object getFromTransient(Object key) { - return (String) mapTransient.get(key); + return mapTransient.get(key); } public void putInTransient(Object key, Object value) { diff --git a/wsdef/src/main/java/com/google/gson/webservice/definition/rest/ResourceMap.java b/wsdef/src/main/java/com/google/gson/webservice/definition/rest/ResourceMap.java index db2fcd4e..3ada07a1 100644 --- a/wsdef/src/main/java/com/google/gson/webservice/definition/rest/ResourceMap.java +++ b/wsdef/src/main/java/com/google/gson/webservice/definition/rest/ResourceMap.java @@ -49,6 +49,6 @@ public final class ResourceMap { } public RestCallSpec get(CallPath callPath) { - return (RestCallSpec)resources.get(callPath); + return resources.get(callPath); } } diff --git a/wsf/src/main/java/com/google/gson/wsf/server/rest/IdMap.java b/wsf/src/main/java/com/google/gson/wsf/server/rest/IdMap.java index d04f61ae..84752f8b 100644 --- a/wsf/src/main/java/com/google/gson/wsf/server/rest/IdMap.java +++ b/wsf/src/main/java/com/google/gson/wsf/server/rest/IdMap.java @@ -38,7 +38,7 @@ public class IdMap> { private final Type typeOfId; /** - * Use {@link #create(Class)} instead of constructor + * Use {@link #create(Type)} instead of constructor */ protected IdMap(Type typeOfId) { this.typeOfId = typeOfId;