TSK-520: Replaced code smells found by FindBugs
This commit is contained in:
parent
2b1ee855cf
commit
dd0ad1253a
|
@ -98,7 +98,7 @@ public class ClassificationServiceImpl implements ClassificationService {
|
|||
}
|
||||
|
||||
private void addClassificationToRootDomain(ClassificationImpl classificationImpl) {
|
||||
if (classificationImpl.getDomain() != "") {
|
||||
if (!classificationImpl.getDomain().equals("")) {
|
||||
boolean doesExist = true;
|
||||
String idBackup = classificationImpl.getId();
|
||||
String domainBackup = classificationImpl.getDomain();
|
||||
|
@ -178,7 +178,14 @@ public class ClassificationServiceImpl implements ClassificationService {
|
|||
}
|
||||
classificationMapper.update(classificationImpl);
|
||||
boolean priorityChanged = oldClassification.getPriority() != classification.getPriority();
|
||||
boolean serviceLevelChanged = oldClassification.getServiceLevel() != classification.getServiceLevel();
|
||||
boolean serviceLevelChanged = true;
|
||||
if (oldClassification.getServiceLevel() == null) {
|
||||
if (classification.getServiceLevel() == null) {
|
||||
serviceLevelChanged = false;
|
||||
}
|
||||
} else if (oldClassification.getServiceLevel().equals(classification.getServiceLevel())) {
|
||||
serviceLevelChanged = false;
|
||||
}
|
||||
|
||||
if (priorityChanged || serviceLevelChanged) {
|
||||
Map<String, String> args = new HashMap<>();
|
||||
|
|
|
@ -297,7 +297,7 @@ public class TaskServiceImpl implements TaskService {
|
|||
TaskImpl task = (TaskImpl) taskToCreate;
|
||||
try {
|
||||
taskanaEngine.openConnection();
|
||||
if (task.getId() != "" && task.getId() != null) {
|
||||
if (task.getId() != null && !task.getId().equals("")) {
|
||||
throw new TaskAlreadyExistException(task.getId());
|
||||
} else {
|
||||
LOGGER.debug("Task {} cannot be be found, so it can be created.", task.getId());
|
||||
|
|
|
@ -4,6 +4,7 @@ import java.security.Principal;
|
|||
import java.security.acl.Group;
|
||||
import java.util.Collections;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
|
@ -16,6 +17,7 @@ public class GroupPrincipal implements Group {
|
|||
|
||||
public GroupPrincipal(String name) {
|
||||
this.name = name;
|
||||
this.members = new HashSet<Principal>();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -79,7 +79,9 @@ public class TestDataGenerator {
|
|||
.forEach(runner::runScript);
|
||||
|
||||
} finally {
|
||||
runner.closeConnection();
|
||||
if (runner != null) {
|
||||
runner.closeConnection();
|
||||
}
|
||||
LOGGER.debug(outWriter.toString());
|
||||
if (!errorWriter.toString().trim().isEmpty()) {
|
||||
LOGGER.error(errorWriter.toString());
|
||||
|
@ -109,8 +111,9 @@ public class TestDataGenerator {
|
|||
new ByteArrayInputStream(
|
||||
sqlReplacer.monitoringTestDataSql.getBytes(StandardCharsets.UTF_8))));
|
||||
} finally {
|
||||
|
||||
runner.closeConnection();
|
||||
if (runner != null) {
|
||||
runner.closeConnection();
|
||||
}
|
||||
LOGGER.debug(outWriter.toString());
|
||||
if (!errorWriter.toString().trim().isEmpty()) {
|
||||
LOGGER.error(errorWriter.toString());
|
||||
|
|
|
@ -34,7 +34,9 @@ public abstract class AbstractPagingController {
|
|||
|
||||
protected String[] extractCommaSeparatedFields(List<String> list) {
|
||||
List<String> values = new ArrayList<>();
|
||||
list.forEach(item -> values.addAll(Arrays.asList(item.split(","))));
|
||||
if (list != null) {
|
||||
list.forEach(item -> values.addAll(Arrays.asList(item.split(","))));
|
||||
}
|
||||
return values.toArray(new String[0]);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue