RM-6836 adding the severe and serious sonar fixes

This commit is contained in:
Ross Gale
2019-05-07 17:23:11 +01:00
parent 507abdecad
commit 747280acdf
13 changed files with 100 additions and 2 deletions

View File

@@ -28,6 +28,7 @@
package org.alfresco.module.org_alfresco_module_rm.audit.extractor;
import java.io.Serializable;
import java.util.Objects;
import java.util.Set;
import org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanService;
@@ -124,4 +125,24 @@ public final class AuthenticatedUserRolesDataExtractor extends AbstractDataExtra
// Done
return sb.toString();
}
@Override
public boolean equals(Object o)
{
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
if (!super.equals(o))
return false;
AuthenticatedUserRolesDataExtractor that = (AuthenticatedUserRolesDataExtractor) o;
return Objects.equals(nodeService, that.nodeService) && Objects.equals(filePlanService, that.filePlanService)
&& Objects.equals(filePlanRoleService, that.filePlanRoleService);
}
@Override
public int hashCode()
{
return Objects.hash(nodeService, filePlanService, filePlanRoleService);
}
}

View File

@@ -28,6 +28,7 @@
package org.alfresco.module.org_alfresco_module_rm.audit.extractor;
import java.io.Serializable;
import java.util.Objects;
import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
import org.alfresco.repo.audit.extractor.AbstractDataExtractor;
@@ -76,4 +77,23 @@ public final class FilePlanIdentifierDataExtractor extends AbstractDataExtractor
// Done
return identifier;
}
@Override
public boolean equals(Object o)
{
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
if (!super.equals(o))
return false;
FilePlanIdentifierDataExtractor that = (FilePlanIdentifierDataExtractor) o;
return Objects.equals(nodeService, that.nodeService);
}
@Override
public int hashCode()
{
return Objects.hash(nodeService);
}
}

View File

@@ -29,6 +29,7 @@ package org.alfresco.module.org_alfresco_module_rm.audit.extractor;
import java.io.Serializable;
import java.util.List;
import java.util.Objects;
import org.alfresco.model.ContentModel;
import org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanService;
@@ -126,4 +127,24 @@ public final class FilePlanNamePathDataExtractor extends AbstractDataExtractor
return extractedData;
}
@Override
public boolean equals(Object o)
{
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
if (!super.equals(o))
return false;
FilePlanNamePathDataExtractor that = (FilePlanNamePathDataExtractor) o;
return Objects.equals(nodeService, that.nodeService) && Objects.equals(filePlanService, that.filePlanService)
&& Objects.equals(ruleService, that.ruleService);
}
@Override
public int hashCode()
{
return Objects.hash(nodeService, filePlanService, ruleService);
}
}

View File

@@ -29,6 +29,7 @@ package org.alfresco.module.org_alfresco_module_rm.audit.extractor;
import java.io.Serializable;
import java.util.List;
import java.util.Objects;
import org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanService;
import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
@@ -112,4 +113,24 @@ public final class FilePlanNodeRefPathDataExtractor extends AbstractDataExtracto
return extractedData;
}
@Override
public boolean equals(Object o)
{
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
if (!super.equals(o))
return false;
FilePlanNodeRefPathDataExtractor that = (FilePlanNodeRefPathDataExtractor) o;
return Objects.equals(nodeService, that.nodeService) && Objects.equals(filePlanService, that.filePlanService)
&& Objects.equals(ruleService, that.ruleService);
}
@Override
public int hashCode()
{
return Objects.hash(nodeService, filePlanService, ruleService);
}
}

View File

@@ -98,6 +98,7 @@ public class RMAfterInvocationProvider extends RMSecurityCommon
public void afterPropertiesSet()
{
//Do nothing
}
/**

View File

@@ -284,6 +284,10 @@ public class RMEntryVoter extends RMSecurityCommon
{
break;
}
default:
{
//do nothing
}
}
}
else if (cad.getTypeString().equals(ConfigAttributeDefinition.RM))
@@ -317,6 +321,10 @@ public class RMEntryVoter extends RMSecurityCommon
{
break;
}
default:
{
//do nothing
}
}
}
}
@@ -385,6 +393,7 @@ public class RMEntryVoter extends RMSecurityCommon
*/
public void afterPropertiesSet()
{
//Do nothing
}
/**

View File

@@ -118,7 +118,7 @@ public class DispositionScheduleImpl implements DispositionSchedule,
{
return value.booleanValue();
}
return null;
return false;
}
});
}

View File

@@ -48,6 +48,7 @@ public class RecordCategoryChild extends RMNode
public RecordCategoryChild()
{
//Default constructor
}
public Boolean getIsRecordCategory()

View File

@@ -39,6 +39,7 @@ public class TargetContainer
public TargetContainer()
{
//Default constructor
}
public String getTargetParentId()

View File

@@ -67,6 +67,7 @@ public class Transfer
public Transfer()
{
//Default constructor
}
@JsonProperty ("id")

View File

@@ -45,6 +45,7 @@ public class TransferChild extends RMNode
public TransferChild()
{
//Default constructor
}
public Boolean getIsClosed()

View File

@@ -60,6 +60,7 @@ public class TransferContainer
public TransferContainer()
{
//Default constructor
}
@JsonProperty ("id")

View File

@@ -72,7 +72,7 @@ public enum SortDirection
if (sortDirection == null)
{
throw new AlfrescoRuntimeException("Sort direction '" + sortDirection +"' unknown.");
throw new AlfrescoRuntimeException("Sort direction unknown.");
}
return sortDirection;