mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Fixed some issues found in FindBugs security analysis.
This commit is contained in:
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…
Reference in New Issue
Block a user