Fixed some issues found in FindBugs security analysis.

merge-requests/7/head
Maninda 8 years ago
parent 148c8046fe
commit 0fb5a577b8

@ -119,7 +119,7 @@ public class ApiPermissionFilter implements Filter {
.getThreadLocalCarbonContext().getTenantId());
return userRealm.getAuthorizationManager().isUserAuthorized(username, permission, action);
} catch (UserStoreException e) {
String errorMsg = String.format("Unable to authorize the user : %s", username, e);
String errorMsg = String.format("Unable to authorize the user : %s", username);
log.error(errorMsg, e);
return false;
}

@ -83,11 +83,7 @@ public class GsonMessageBodyHandler implements MessageBodyWriter<Object>, Messag
OutputStreamWriter writer = new OutputStreamWriter(entityStream, UTF_8);
try {
Type jsonType = null;
if (type.equals(type)) {
jsonType = type;
}
getGson().toJson(object, jsonType, writer);
getGson().toJson(object, type, writer);
} finally {
writer.close();
}

@ -83,11 +83,7 @@ public class GsonMessageBodyHandler implements MessageBodyWriter<Object>, Messag
OutputStreamWriter writer = new OutputStreamWriter(entityStream, UTF_8);
try {
Type jsonType = null;
if (type.equals(type)) {
jsonType = type;
}
getGson().toJson(object, jsonType, writer);
getGson().toJson(object, type, writer);
} finally {
writer.close();
}

@ -83,11 +83,7 @@ public class GsonMessageBodyHandler implements MessageBodyWriter<Object>, Messag
OutputStreamWriter writer = new OutputStreamWriter(entityStream, UTF_8);
try {
Type jsonType = null;
if (type.equals(type)) {
jsonType = type;
}
getGson().toJson(object, jsonType, writer);
getGson().toJson(object, type, writer);
} finally {
writer.close();
}

@ -370,7 +370,7 @@ public class DeviceInfo implements Serializable {
}
public Date getUpdatedTime() {
if(updatedTime.equals(null)){
if(updatedTime == null){
updatedTime = new Date();
}
return updatedTime;

@ -137,7 +137,7 @@ public class DeviceLocation implements Serializable {
}
public Date getUpdatedTime() {
if(updatedTime.equals(null)){
if(updatedTime == null ){
updatedTime = new Date();
}
return updatedTime;

Loading…
Cancel
Save