Fix some build warnings.

This commit is contained in:
Synced Synapse 2015-03-09 22:05:58 +00:00
parent c5b3208535
commit 551583aa9d
2 changed files with 12 additions and 0 deletions

View File

@ -48,6 +48,14 @@ android {
disable 'MissingTranslation'
}
// allprojects {
// gradle.projectsEvaluated {
// tasks.withType(JavaCompile) {
// options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
// }
// }
// }
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'

View File

@ -725,7 +725,9 @@ public class HostConnection {
if (methodCallInfo != null) {
try {
@SuppressWarnings("unchecked")
final T result = (T) methodCallInfo.method.resultFromJson(jsonResponse);
@SuppressWarnings("unchecked")
final ApiCallback<T> callback = (ApiCallback<T>) methodCallInfo.callback;
if ((methodCallInfo.handler != null) && (callback != null)) {
@ -755,6 +757,7 @@ public class HostConnection {
// Send error back to client
final MethodCallInfo<?> methodCallInfo = clientCallbacks.get(methodId);
if (methodCallInfo != null) {
@SuppressWarnings("unchecked")
final ApiCallback<T> callback = (ApiCallback<T>) methodCallInfo.callback;
if ((methodCallInfo.handler != null) && (callback != null)) {
@ -771,6 +774,7 @@ public class HostConnection {
// Notify all pending clients, it might be an error for them
for (String id : clientCallbacks.keySet()) {
final MethodCallInfo<?> methodCallInfo = clientCallbacks.get(id);
@SuppressWarnings("unchecked")
final ApiCallback<T> callback = (ApiCallback<T>)methodCallInfo.callback;
if ((methodCallInfo.handler != null) && (callback != null)) {