mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Fixed major issues reported by sonar (Simplify Boolean Expression)
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@64169 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -146,11 +146,11 @@ public class DeclarativeCapabilityTest extends BaseRMTestCase
|
||||
for (Capability capability : capabilities)
|
||||
{
|
||||
if (capability instanceof DeclarativeCapability &&
|
||||
capability instanceof DeclarativeCompositeCapability == false &&
|
||||
capability.isPrivate() == false &&
|
||||
capability.getName().equals("MoveRecords") == false &&
|
||||
capability.getName().equals("DeleteLinks") == false &&
|
||||
capability.getName().equals("ChangeOrDeleteReferences") == false)
|
||||
!(capability instanceof DeclarativeCompositeCapability) &&
|
||||
!capability.isPrivate() &&
|
||||
!capability.getName().equals("MoveRecords") &&
|
||||
!capability.getName().equals("DeleteLinks") &&
|
||||
!capability.getName().equals("ChangeOrDeleteReferences"))
|
||||
{
|
||||
testDeclarativeCapability((DeclarativeCapability)capability);
|
||||
}
|
||||
|
@@ -181,7 +181,7 @@ public class DispositionServiceImplTest extends BaseRMTestCase
|
||||
private void doCheckFolder(NodeRef container, String dispositionInstructions, boolean isRecordLevel)
|
||||
{
|
||||
doCheck(container, dispositionInstructions, isRecordLevel);
|
||||
if (isRecordLevel == false)
|
||||
if (!isRecordLevel)
|
||||
{
|
||||
assertNotNull(dispositionService.getNextDispositionAction(container));
|
||||
}
|
||||
|
@@ -578,7 +578,7 @@ public class RMCaveatConfigServiceImplTest extends BaseSpringTest implements DOD
|
||||
if (parentGroupShortName != null)
|
||||
{
|
||||
String parentGroupFullName = authorityService.getName(AuthorityType.GROUP, parentGroupShortName);
|
||||
if (authorityService.authorityExists(parentGroupFullName) == false)
|
||||
if (!authorityService.authorityExists(parentGroupFullName))
|
||||
{
|
||||
authorityService.createAuthority(AuthorityType.GROUP, groupShortName, groupShortName, null);
|
||||
authorityService.addAuthority(parentGroupFullName, groupShortName);
|
||||
|
@@ -108,8 +108,8 @@ public class RecordServiceImplTest extends BaseRMTestCase
|
||||
*/
|
||||
private List<QName> getAspectList()
|
||||
{
|
||||
QName[] aspects = new QName[]
|
||||
{
|
||||
QName[] aspects = new QName[]
|
||||
{
|
||||
ASPECT_RECORD_META_DATA
|
||||
};
|
||||
|
||||
@@ -795,7 +795,7 @@ public class RecordServiceImplTest extends BaseRMTestCase
|
||||
}
|
||||
|
||||
// assert fail not failure
|
||||
if (failure == false)
|
||||
if (!failure)
|
||||
{
|
||||
fail("Property should not have been editable.");
|
||||
}
|
||||
|
@@ -518,7 +518,7 @@ public abstract class BaseRMTestCase extends RetryingTransactionHelperTestCase
|
||||
protected void setupTestDataImpl()
|
||||
{
|
||||
AuthorityDAO authDao = (AuthorityDAO)applicationContext.getBean("authorityDAO");
|
||||
if (authDao.authorityExists(AuthenticationUtil.getSystemUserName()) == false)
|
||||
if (!authDao.authorityExists(AuthenticationUtil.getSystemUserName()))
|
||||
{
|
||||
createPerson(AuthenticationUtil.getSystemUserName(), false);
|
||||
}
|
||||
|
@@ -341,7 +341,7 @@ public class BaseRMWebScriptTestCase extends BaseWebScriptTest
|
||||
|
||||
protected void createUser(String userName)
|
||||
{
|
||||
if (authenticationService.authenticationExists(userName) == false)
|
||||
if (!authenticationService.authenticationExists(userName))
|
||||
{
|
||||
authenticationService.createAuthentication(userName, "PWD".toCharArray());
|
||||
|
||||
@@ -367,7 +367,7 @@ public class BaseRMWebScriptTestCase extends BaseWebScriptTest
|
||||
|
||||
protected void createGroup(String groupName)
|
||||
{
|
||||
if (authorityService.authorityExists(groupName) == false)
|
||||
if (!authorityService.authorityExists(groupName))
|
||||
{
|
||||
authorityService.createAuthority(AuthorityType.GROUP, groupName);
|
||||
}
|
||||
|
@@ -178,7 +178,7 @@ public class CommonRMTestUtils implements RecordsManagementModel
|
||||
{
|
||||
properties = new HashMap<QName, Serializable>(1);
|
||||
}
|
||||
if (properties.containsKey(ContentModel.PROP_NAME) == false)
|
||||
if (!properties.containsKey(ContentModel.PROP_NAME))
|
||||
{
|
||||
properties.put(ContentModel.PROP_NAME, name);
|
||||
}
|
||||
|
@@ -27,20 +27,20 @@ public class TestAction extends RMActionExecuterAbstractBase
|
||||
public static final String NAME = "testAction";
|
||||
public static final String PARAM = "testActionParam";
|
||||
public static final String PARAM_VALUE = "value";
|
||||
|
||||
|
||||
@Override
|
||||
protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
|
||||
{
|
||||
if (action.getParameterValue(PARAM).equals(PARAM_VALUE) == false)
|
||||
if (!action.getParameterValue(PARAM).equals(PARAM_VALUE))
|
||||
{
|
||||
throw new RuntimeException("Unexpected parameter value. Expected " + PARAM_VALUE + " actual " + action.getParameterValue(PARAM));
|
||||
}
|
||||
this.nodeService.addAspect(actionedUponNodeRef, ASPECT_RECORD, null);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDispositionAction()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -27,14 +27,14 @@ public class TestActionParams extends RMActionExecuterAbstractBase
|
||||
{
|
||||
public static final String NAME = "testActionParams";
|
||||
public static final String PARAM_DATE = "paramDate";
|
||||
|
||||
|
||||
@Override
|
||||
protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
|
||||
{
|
||||
Object dateValue = action.getParameterValue(PARAM_DATE);
|
||||
if ((dateValue instanceof java.util.Date) == false)
|
||||
if (!(dateValue instanceof java.util.Date))
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Param was not a Date as expected.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -94,7 +94,7 @@ public class TestActionPropertySubs extends RMActionExecuterAbstractBase
|
||||
|
||||
private void assertEquals(String expected, String actual)
|
||||
{
|
||||
if (expected.equals(actual) == false)
|
||||
if (!expected.equals(actual))
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Expected value " + expected + " does not match actual value " + actual);
|
||||
}
|
||||
|
Reference in New Issue
Block a user