Fixed some issues found in FindBugs security analysis.

This commit is contained in:
Maninda 2017-01-05 11:47:09 +05:30
parent 148c8046fe
commit 0fb5a577b8
6 changed files with 6 additions and 18 deletions

View File

@ -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;
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

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

View File

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