CCM NG: Fixed several warnings from PMD (most of them false warnings)
git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@3460 8810af33-2d31-482b-a856-94f89814c4dfpull/2/head
parent
a79c67974d
commit
1745c25dcc
|
|
@ -154,6 +154,8 @@ public class Categorization implements Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
//No chance to make this method less complex, therefore suppress warning
|
||||||
|
@SuppressWarnings("PMD.NPathComplexity")
|
||||||
public boolean equals(final Object obj) {
|
public boolean equals(final Object obj) {
|
||||||
if (obj == null) {
|
if (obj == null) {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,6 @@ import java.util.Objects;
|
||||||
import javax.persistence.AssociationOverride;
|
import javax.persistence.AssociationOverride;
|
||||||
import javax.persistence.Column;
|
import javax.persistence.Column;
|
||||||
import javax.persistence.Convert;
|
import javax.persistence.Convert;
|
||||||
import javax.persistence.Converter;
|
|
||||||
import javax.persistence.Embedded;
|
import javax.persistence.Embedded;
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
import javax.persistence.JoinColumn;
|
import javax.persistence.JoinColumn;
|
||||||
|
|
@ -46,6 +45,7 @@ import javax.persistence.Table;
|
||||||
import javax.persistence.Temporal;
|
import javax.persistence.Temporal;
|
||||||
import javax.persistence.TemporalType;
|
import javax.persistence.TemporalType;
|
||||||
import javax.validation.constraints.Pattern;
|
import javax.validation.constraints.Pattern;
|
||||||
|
import org.omg.CORBA.DomainManager;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A domain is collection of categories designed a specific purpose. This entity
|
* A domain is collection of categories designed a specific purpose. This entity
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,44 @@
|
||||||
|
/*
|
||||||
|
* To change this license header, choose License Headers in Project Properties.
|
||||||
|
* To change this template file, choose Tools | Templates
|
||||||
|
* and open the template in the editor.
|
||||||
|
*/
|
||||||
|
package org.libreccm.core;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import javax.inject.Inject;
|
||||||
|
import javax.persistence.EntityManager;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
*/
|
||||||
|
public abstract class AbstractEntityRepository<K, E> {
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private transient EntityManager entityManager;
|
||||||
|
|
||||||
|
protected EntityManager getEntityManager() {
|
||||||
|
return entityManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract Class<E> getEntityClass();
|
||||||
|
|
||||||
|
public abstract boolean isNew(final E entity) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void save(final E entity) {
|
||||||
|
if (isNew(entity)) {
|
||||||
|
entityManager.persist(entity);
|
||||||
|
} else {
|
||||||
|
entityManager.merge(entity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<E> findById(final K entityId) {
|
||||||
|
return entityManager.find(getEntityClass(), entityId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract List<E> findAll();
|
||||||
|
}
|
||||||
|
|
@ -37,6 +37,8 @@ import javax.persistence.Inheritance;
|
||||||
import javax.persistence.InheritanceType;
|
import javax.persistence.InheritanceType;
|
||||||
import javax.persistence.OneToMany;
|
import javax.persistence.OneToMany;
|
||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
||||||
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Root class of all entities in LibreCCM which need categorisation and
|
* Root class of all entities in LibreCCM which need categorisation and
|
||||||
|
|
@ -58,6 +60,11 @@ import javax.persistence.Table;
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "ccm_objects")
|
@Table(name = "ccm_objects")
|
||||||
@Inheritance(strategy = InheritanceType.JOINED)
|
@Inheritance(strategy = InheritanceType.JOINED)
|
||||||
|
@XmlRootElement(name = "ccm-object", namespace = "http://core.libreccm.org")
|
||||||
|
//False warning (?). Because this class has been migrated from the old PDL style
|
||||||
|
//persistence system we can't yet refactor it to make PMD happy. Also I think
|
||||||
|
//this is a false warning.
|
||||||
|
@SuppressWarnings("PMD.TooManyMethods")
|
||||||
public class CcmObject implements Serializable {
|
public class CcmObject implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 201504261329L;
|
private static final long serialVersionUID = 201504261329L;
|
||||||
|
|
@ -70,6 +77,7 @@ public class CcmObject implements Serializable {
|
||||||
@Id
|
@Id
|
||||||
@Column(name = "object_id")
|
@Column(name = "object_id")
|
||||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||||
|
@XmlElement(name = "object-id")
|
||||||
private long objectId;
|
private long objectId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,14 @@ import javax.persistence.Embeddable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An embeddable entity for storing email addresses.
|
* An embeddable entity for storing email addresses.
|
||||||
|
*
|
||||||
|
* In contrast to its predecessor {@code com.arsdigita.kernel.EmailAddress}
|
||||||
|
* this class does not provide verification methods. Verification is done using
|
||||||
|
* the <em>Bean Validiation API</em> (Hibernate Validator is used as
|
||||||
|
* implementation).
|
||||||
|
*
|
||||||
|
* Because this class is an embeddable JPA entity it can be used in other
|
||||||
|
* entities to store eMail addresses.
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
|
|
@ -40,7 +48,7 @@ public class EmailAddress implements Serializable {
|
||||||
@Column(name = "email_address", length = 512, nullable = false)
|
@Column(name = "email_address", length = 512, nullable = false)
|
||||||
@NotBlank
|
@NotBlank
|
||||||
@Email
|
@Email
|
||||||
private String eMailAddress;
|
private String address;
|
||||||
|
|
||||||
@Column(name = "bouncing")
|
@Column(name = "bouncing")
|
||||||
private boolean bouncing;
|
private boolean bouncing;
|
||||||
|
|
@ -48,12 +56,12 @@ public class EmailAddress implements Serializable {
|
||||||
@Column(name = "verified")
|
@Column(name = "verified")
|
||||||
private boolean verified;
|
private boolean verified;
|
||||||
|
|
||||||
public String getEmailAddress() {
|
public String getAddress() {
|
||||||
return eMailAddress;
|
return address;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setEmailAddress(final String eMailAddress) {
|
public void setAddress(final String eMailAddress) {
|
||||||
this.eMailAddress = eMailAddress;
|
this.address = eMailAddress;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isBouncing() {
|
public boolean isBouncing() {
|
||||||
|
|
@ -75,7 +83,7 @@ public class EmailAddress implements Serializable {
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
int hash = 5;
|
int hash = 5;
|
||||||
hash = 79 * hash + Objects.hashCode(eMailAddress);
|
hash = 79 * hash + Objects.hashCode(address);
|
||||||
hash = 79 * hash + (bouncing ? 1 : 0);
|
hash = 79 * hash + (bouncing ? 1 : 0);
|
||||||
hash = 79 * hash + (verified ? 1 : 0);
|
hash = 79 * hash + (verified ? 1 : 0);
|
||||||
return hash;
|
return hash;
|
||||||
|
|
@ -94,7 +102,7 @@ public class EmailAddress implements Serializable {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Objects.equals(eMailAddress, other.getEmailAddress())) {
|
if (!Objects.equals(address, other.getAddress())) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (bouncing != other.isBouncing()) {
|
if (bouncing != other.isBouncing()) {
|
||||||
|
|
@ -114,7 +122,7 @@ public class EmailAddress implements Serializable {
|
||||||
+ "bouncing = %b, "
|
+ "bouncing = %b, "
|
||||||
+ "verified = %b }",
|
+ "verified = %b }",
|
||||||
super.toString(),
|
super.toString(),
|
||||||
eMailAddress,
|
address,
|
||||||
bouncing,
|
bouncing,
|
||||||
verified);
|
verified);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,8 @@ import javax.persistence.ManyToOne;
|
||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* An association class for the association between a group and it members.
|
||||||
|
*
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,8 @@ public class Party extends CcmObject implements Serializable {
|
||||||
private List<EmailAddress> emailAddresses;
|
private List<EmailAddress> emailAddresses;
|
||||||
|
|
||||||
@OneToMany(mappedBy = "grantee")
|
@OneToMany(mappedBy = "grantee")
|
||||||
|
//Can't shorten this variable name without reducing descriptiveness
|
||||||
|
@SuppressWarnings("PMD.LongVariable")
|
||||||
private List<Permission> grantedPermissions;
|
private List<Permission> grantedPermissions;
|
||||||
|
|
||||||
public Party() {
|
public Party() {
|
||||||
|
|
@ -84,6 +86,8 @@ public class Party extends CcmObject implements Serializable {
|
||||||
return Collections.unmodifiableList(grantedPermissions);
|
return Collections.unmodifiableList(grantedPermissions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Can't shorten this variable name without reducing descriptiveness
|
||||||
|
@SuppressWarnings("PMD.LongVariable")
|
||||||
protected void setGrantedPermissions(
|
protected void setGrantedPermissions(
|
||||||
final List<Permission> grantedPermissions) {
|
final List<Permission> grantedPermissions) {
|
||||||
this.grantedPermissions = grantedPermissions;
|
this.grantedPermissions = grantedPermissions;
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,10 @@ import javax.persistence.TemporalType;
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "permissions")
|
@Table(name = "permissions")
|
||||||
|
//Can't reduce complexity yet
|
||||||
|
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
||||||
|
"PMD.StdCyclomaticComplexity",
|
||||||
|
"PMD.ModifiedCyclomaticComplexity"})
|
||||||
public class Permission implements Serializable {
|
public class Permission implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = -2368935232499907547L;
|
private static final long serialVersionUID = -2368935232499907547L;
|
||||||
|
|
@ -136,7 +140,7 @@ public class Permission implements Serializable {
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
int hash = 3;
|
int hash = 3;
|
||||||
hash
|
hash
|
||||||
= 31 * hash + (int) (permissionId ^ (permissionId >>> 32));
|
= 31 * hash + (int) (permissionId ^ (permissionId >>> 32));
|
||||||
hash = 31 * hash + Objects.hashCode(grantee);
|
hash = 31 * hash + Objects.hashCode(grantee);
|
||||||
hash = 31 * hash + Objects.hashCode(grantedPrivilege);
|
hash = 31 * hash + Objects.hashCode(grantedPrivilege);
|
||||||
hash = 31 * hash + Objects.hashCode(object);
|
hash = 31 * hash + Objects.hashCode(object);
|
||||||
|
|
@ -147,6 +151,11 @@ public class Permission implements Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
//Can't reduce complexity yet
|
||||||
|
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
||||||
|
"PMD.StdCyclomaticComplexity",
|
||||||
|
"PMD.ModifiedCyclomaticComplexity",
|
||||||
|
"PMD.NPathComplexity"})
|
||||||
public boolean equals(final Object obj) {
|
public boolean equals(final Object obj) {
|
||||||
if (obj == null) {
|
if (obj == null) {
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -188,14 +197,14 @@ public class Permission implements Serializable {
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return String.format("%s{ "
|
return String.format("%s{ "
|
||||||
+ "permissionId = %d, "
|
+ "permissionId = %d, "
|
||||||
+ "grantee = %s, "
|
+ "grantee = %s, "
|
||||||
+ "grantedPrivilege = %s, "
|
+ "grantedPrivilege = %s, "
|
||||||
+ "object = %s, "
|
+ "object = %s, "
|
||||||
+ "creationUser = %s,"
|
+ "creationUser = %s,"
|
||||||
+ "creationDate = %tF %<tT, "
|
+ "creationDate = %tF %<tT, "
|
||||||
+ "creationIp = %s"
|
+ "creationIp = %s"
|
||||||
+ " }",
|
+ " }",
|
||||||
super.toString(),
|
super.toString(),
|
||||||
permissionId,
|
permissionId,
|
||||||
Objects.toString(grantee),
|
Objects.toString(grantee),
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,7 @@ public class PersonName implements Serializable {
|
||||||
return middleName;
|
return middleName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setMiddleName(String middleName) {
|
public void setMiddleName(final String middleName) {
|
||||||
this.middleName = middleName;
|
this.middleName = middleName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,8 @@ public class Privilege implements Serializable {
|
||||||
private long privilegeId;
|
private long privilegeId;
|
||||||
|
|
||||||
@Column(name = "privilege", length = 255, nullable = false)
|
@Column(name = "privilege", length = 255, nullable = false)
|
||||||
|
//Field is named like this in the old PDL class, don't want to change it now
|
||||||
|
@SuppressWarnings("PMD.AvoidFieldNameMatchingTypeName")
|
||||||
private String privilege;
|
private String privilege;
|
||||||
|
|
||||||
public long getPrivilegeId() {
|
public long getPrivilegeId() {
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,7 @@ import org.hibernate.validator.constraints.NotBlank;
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "roles")
|
@Table(name = "roles")
|
||||||
|
@SuppressWarnings("PMD.ShortClassName") //Role is perfectly fine name.
|
||||||
public class Role implements Serializable {
|
public class Role implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 3314358449751376350L;
|
private static final long serialVersionUID = 3314358449751376350L;
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,12 @@ import javax.persistence.OneToMany;
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "users")
|
@Table(name = "users")
|
||||||
|
//Supressing a few warnings from PMD because they misleading here.
|
||||||
|
//User is perfectly fine class name, and the complexity is not to high...
|
||||||
|
@SuppressWarnings({"PMD.ShortClassName",
|
||||||
|
"PMD.CyclomaticComplexity",
|
||||||
|
"PMD.StdCyclomaticComplexity",
|
||||||
|
"PMD.ModifiedCyclomaticComplexity"})
|
||||||
public class User extends Party implements Serializable {
|
public class User extends Party implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 892038270064849732L;
|
private static final long serialVersionUID = 892038270064849732L;
|
||||||
|
|
@ -184,6 +190,11 @@ public class User extends Party implements Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
//Can't reduce complexity yet
|
||||||
|
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
||||||
|
"PMD.StdCyclomaticComplexity",
|
||||||
|
"PMD.ModifiedCyclomaticComplexity",
|
||||||
|
"PMD.NPathComplexity"})
|
||||||
public boolean equals(final Object obj) {
|
public boolean equals(final Object obj) {
|
||||||
if (!super.equals(obj)) {
|
if (!super.equals(obj)) {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,10 @@ import javax.persistence.Table;
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "formbuilder_components")
|
@Table(name = "formbuilder_components")
|
||||||
|
//Can't reduce complexity yet
|
||||||
|
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
||||||
|
"PMD.StdCyclomaticComplexity",
|
||||||
|
"PMD.ModifiedCyclomaticComplexity"})
|
||||||
public class Component extends CcmObject implements Serializable {
|
public class Component extends CcmObject implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1787173100367982069L;
|
private static final long serialVersionUID = 1787173100367982069L;
|
||||||
|
|
@ -158,6 +162,11 @@ public class Component extends CcmObject implements Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
//Can't reduce complexity yet
|
||||||
|
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
||||||
|
"PMD.StdCyclomaticComplexity",
|
||||||
|
"PMD.ModifiedCyclomaticComplexity",
|
||||||
|
"PMD.NPathComplexity"})
|
||||||
public boolean equals(final Object obj) {
|
public boolean equals(final Object obj) {
|
||||||
if (obj == null) {
|
if (obj == null) {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@ public class Listener extends CcmObject implements Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object obj) {
|
public boolean equals(final Object obj) {
|
||||||
if (obj == null) {
|
if (obj == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@ public class ObjectType extends CcmObject implements Serializable {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
final ObjectType other = (ObjectType) obj;
|
final ObjectType other = (ObjectType) obj;
|
||||||
if (!canEqual(this)) {
|
if (!other.canEqual(this)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -122,6 +122,8 @@ public class ProcessListener extends CcmObject implements Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
//We can't reduce the complexity now
|
||||||
|
@SuppressWarnings("PMD.NPathComplexity")
|
||||||
public boolean equals(final Object obj) {
|
public boolean equals(final Object obj) {
|
||||||
if (obj == null) {
|
if (obj == null) {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -118,6 +118,8 @@ public class Widget extends Component implements Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
//Can't reduce complexity yet
|
||||||
|
@SuppressWarnings("PMD.NPathComplexity")
|
||||||
public boolean equals(final Object obj) {
|
public boolean equals(final Object obj) {
|
||||||
if (obj == null) {
|
if (obj == null) {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -117,7 +117,7 @@ public class Attachment implements Serializable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setData(byte[] data) {
|
public void setData(final byte[] data) {
|
||||||
if (data == null) {
|
if (data == null) {
|
||||||
this.data = null;
|
this.data = null;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -129,7 +129,7 @@ public class Attachment implements Serializable {
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
int hash = 5;
|
int hash = 5;
|
||||||
hash
|
hash
|
||||||
= 67 * hash + (int) (attachmentId ^ (attachmentId >>> 32));
|
= 67 * hash + (int) (attachmentId ^ (attachmentId >>> 32));
|
||||||
hash = 67 * hash + Objects.hashCode(message);
|
hash = 67 * hash + Objects.hashCode(message);
|
||||||
hash = 67 * hash + Objects.hashCode(mimeType);
|
hash = 67 * hash + Objects.hashCode(mimeType);
|
||||||
hash = 67 * hash + Objects.hashCode(title);
|
hash = 67 * hash + Objects.hashCode(title);
|
||||||
|
|
@ -139,6 +139,8 @@ public class Attachment implements Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
//Can't reduce complexity yet
|
||||||
|
@SuppressWarnings("PMD.NPathComplexity")
|
||||||
public boolean equals(final Object obj) {
|
public boolean equals(final Object obj) {
|
||||||
if (obj == null) {
|
if (obj == null) {
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -178,11 +180,11 @@ public class Attachment implements Serializable {
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return String.format("%s{ "
|
return String.format("%s{ "
|
||||||
+ "attachmentId = %d, "
|
+ "attachmentId = %d, "
|
||||||
+ "message = %s, "
|
+ "message = %s, "
|
||||||
+ "mimeType = \"%s\", "
|
+ "mimeType = \"%s\", "
|
||||||
+ "title = \"%s\""
|
+ "title = \"%s\""
|
||||||
+ " }",
|
+ " }",
|
||||||
super.toString(),
|
super.toString(),
|
||||||
attachmentId,
|
attachmentId,
|
||||||
Objects.toString(message),
|
Objects.toString(message),
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,10 @@ import javax.persistence.TemporalType;
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "messages")
|
@Table(name = "messages")
|
||||||
|
//Can't reduce complexity yet
|
||||||
|
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
||||||
|
"PMD.StdCyclomaticComplexity",
|
||||||
|
"PMD.ModifiedCyclomaticComplexity"})
|
||||||
public class Message extends CcmObject implements Serializable {
|
public class Message extends CcmObject implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = -9143137794418932025L;
|
private static final long serialVersionUID = -9143137794418932025L;
|
||||||
|
|
@ -189,15 +193,20 @@ public class Message extends CcmObject implements Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
//Can't reduce complexity yet
|
||||||
|
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
||||||
|
"PMD.StdCyclomaticComplexity",
|
||||||
|
"PMD.ModifiedCyclomaticComplexity",
|
||||||
|
"PMD.NPathComplexity"})
|
||||||
public boolean equals(final Object obj) {
|
public boolean equals(final Object obj) {
|
||||||
if (obj == null) {
|
if (obj == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!super.equals(obj)) {
|
if (!super.equals(obj)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(obj instanceof Message)) {
|
if (!(obj instanceof Message)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
@ -238,10 +247,10 @@ public class Message extends CcmObject implements Serializable {
|
||||||
@Override
|
@Override
|
||||||
public String toString(final String data) {
|
public String toString(final String data) {
|
||||||
return super.toString(String.format(", sender = %s, "
|
return super.toString(String.format(", sender = %s, "
|
||||||
+ "subject = \"%s\", "
|
+ "subject = \"%s\", "
|
||||||
+ "bodyMimeType = \"%s\", "
|
+ "bodyMimeType = \"%s\", "
|
||||||
+ "sent = %tF %<tT, "
|
+ "sent = %tF %<tT, "
|
||||||
+ "inReplyTo = %s%s",
|
+ "inReplyTo = %s%s",
|
||||||
Objects.toString(sender),
|
Objects.toString(sender),
|
||||||
subject,
|
subject,
|
||||||
Objects.toString(bodyMimeType),
|
Objects.toString(bodyMimeType),
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,10 @@ import javax.persistence.TemporalType;
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "digests")
|
@Table(name = "digests")
|
||||||
|
//Can't reduce complexity yet
|
||||||
|
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
||||||
|
"PMD.StdCyclomaticComplexity",
|
||||||
|
"PMD.ModifiedCyclomaticComplexity"})
|
||||||
public class Digest extends CcmObject implements Serializable {
|
public class Digest extends CcmObject implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = -3526066971290670390L;
|
private static final long serialVersionUID = -3526066971290670390L;
|
||||||
|
|
@ -152,15 +156,20 @@ public class Digest extends CcmObject implements Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
//Can't reduce complexity yet
|
||||||
|
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
||||||
|
"PMD.StdCyclomaticComplexity",
|
||||||
|
"PMD.ModifiedCyclomaticComplexity",
|
||||||
|
"PMD.NPathComplexity"})
|
||||||
public boolean equals(final Object obj) {
|
public boolean equals(final Object obj) {
|
||||||
if (obj == null) {
|
if (obj == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!super.equals(obj)) {
|
if (!super.equals(obj)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(obj instanceof Digest)) {
|
if (!(obj instanceof Digest)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
@ -199,9 +208,9 @@ public class Digest extends CcmObject implements Serializable {
|
||||||
@Override
|
@Override
|
||||||
public String toString(final String data) {
|
public String toString(final String data) {
|
||||||
return super.toString(String.format(", fromParty = %s, "
|
return super.toString(String.format(", fromParty = %s, "
|
||||||
+ "subject = \"%s\", "
|
+ "subject = \"%s\", "
|
||||||
+ "frequency = %d,"
|
+ "frequency = %d,"
|
||||||
+ "nextRun = %tF %<tT%s",
|
+ "nextRun = %tF %<tT%s",
|
||||||
Objects.toString(fromParty),
|
Objects.toString(fromParty),
|
||||||
subject,
|
subject,
|
||||||
frequency,
|
frequency,
|
||||||
|
|
|
||||||
|
|
@ -68,6 +68,12 @@ import javax.persistence.TemporalType;
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "notifications")
|
@Table(name = "notifications")
|
||||||
|
//Can't reduce complexity yet. Not sure what to do about the God class warning.
|
||||||
|
//Maybe we have to put some of the properties into an extra class.
|
||||||
|
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
||||||
|
"PMD.StdCyclomaticComplexity",
|
||||||
|
"PMD.ModifiedCyclomaticComplexity",
|
||||||
|
"PMD.GodClass"})
|
||||||
public class Notification extends CcmObject implements Serializable {
|
public class Notification extends CcmObject implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = -6052859580690813506L;
|
private static final long serialVersionUID = -6052859580690813506L;
|
||||||
|
|
@ -244,6 +250,11 @@ public class Notification extends CcmObject implements Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
//Can't reduce complexity yet
|
||||||
|
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
||||||
|
"PMD.StdCyclomaticComplexity",
|
||||||
|
"PMD.ModifiedCyclomaticComplexity",
|
||||||
|
"PMD.NPathComplexity"})
|
||||||
public boolean equals(final Object obj) {
|
public boolean equals(final Object obj) {
|
||||||
if (obj == null) {
|
if (obj == null) {
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -308,14 +319,14 @@ public class Notification extends CcmObject implements Serializable {
|
||||||
@Override
|
@Override
|
||||||
public String toString(final String data) {
|
public String toString(final String data) {
|
||||||
return super.toString(String.format(", receiver = %s, "
|
return super.toString(String.format(", receiver = %s, "
|
||||||
+ "digest = %s, "
|
+ "digest = %s, "
|
||||||
+ "message = %s, "
|
+ "message = %s, "
|
||||||
+ "expandGroup = %b, "
|
+ "expandGroup = %b, "
|
||||||
+ "requestDate = %tF %<tT, "
|
+ "requestDate = %tF %<tT, "
|
||||||
+ "fulfillDate = %tF %<tT, "
|
+ "fulfillDate = %tF %<tT, "
|
||||||
+ "status = \"%s\", "
|
+ "status = \"%s\", "
|
||||||
+ "expunge = %b, "
|
+ "expunge = %b, "
|
||||||
+ "expungeMessage = %b%s",
|
+ "expungeMessage = %b%s",
|
||||||
Objects.toString(receiver),
|
Objects.toString(receiver),
|
||||||
Objects.toString(digest),
|
Objects.toString(digest),
|
||||||
Objects.toString(message),
|
Objects.toString(message),
|
||||||
|
|
|
||||||
|
|
@ -34,17 +34,21 @@ import javax.persistence.OneToOne;
|
||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a notification that has been transferred to the outbound
|
* Represents a notification that has been transferred to the outbound message
|
||||||
* message queue. During processing, this class is used to retrieve information
|
* queue. During processing, this class is used to retrieve information
|
||||||
* necessary to convert the notification into an outbound email message.
|
* necessary to convert the notification into an outbound email message.
|
||||||
*
|
*
|
||||||
* (Documentation taken from the [@code com.arsdigita.notifiction.QueueItem}
|
* (Documentation taken from the [@code com.arsdigita.notifiction.QueueItem}
|
||||||
* class.
|
* class.
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "queue_items")
|
@Table(name = "queue_items")
|
||||||
|
//Can't reduce complexity yet
|
||||||
|
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
||||||
|
"PMD.StdCyclomaticComplexity",
|
||||||
|
"PMD.ModifiedCyclomaticComplexity"})
|
||||||
public class QueueItem implements Serializable {
|
public class QueueItem implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 396330385592074013L;
|
private static final long serialVersionUID = 396330385592074013L;
|
||||||
|
|
@ -156,6 +160,11 @@ public class QueueItem implements Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
//Can't reduce complexity yet
|
||||||
|
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
||||||
|
"PMD.StdCyclomaticComplexity",
|
||||||
|
"PMD.ModifiedCyclomaticComplexity",
|
||||||
|
"PMD.NPathComplexity"})
|
||||||
public boolean equals(final Object obj) {
|
public boolean equals(final Object obj) {
|
||||||
if (obj == null) {
|
if (obj == null) {
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -167,7 +176,7 @@ public class QueueItem implements Serializable {
|
||||||
if (!other.canEqual(this)) {
|
if (!other.canEqual(this)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.queueItemId != other.getQueueItemId()) {
|
if (this.queueItemId != other.getQueueItemId()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
@ -199,13 +208,13 @@ public class QueueItem implements Serializable {
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return String.format("%s{ "
|
return String.format("%s{ "
|
||||||
+ "queueItemId = %d, "
|
+ "queueItemId = %d, "
|
||||||
+ "receiver = %s, "
|
+ "receiver = %s, "
|
||||||
+ "retryCount = %d, "
|
+ "retryCount = %d, "
|
||||||
+ "successful = %b, "
|
+ "successful = %b, "
|
||||||
+ "receiverAddress = \"%s\", "
|
+ "receiverAddress = \"%s\", "
|
||||||
+ "message = %s"
|
+ "message = %s"
|
||||||
+ " }",
|
+ " }",
|
||||||
super.toString(),
|
super.toString(),
|
||||||
queueItemId,
|
queueItemId,
|
||||||
Objects.toString(receiver),
|
Objects.toString(receiver),
|
||||||
|
|
|
||||||
|
|
@ -57,12 +57,12 @@ public class Initalizer implements Serializable {
|
||||||
private Initalizer requiredBy;
|
private Initalizer requiredBy;
|
||||||
|
|
||||||
@OneToMany(mappedBy = "requiredBy")
|
@OneToMany(mappedBy = "requiredBy")
|
||||||
private List<Initalizer> requiredInitializers;
|
private List<Initalizer> requires;
|
||||||
|
|
||||||
public Initalizer() {
|
public Initalizer() {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
requiredInitializers = new ArrayList<>();
|
requires = new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getInitializerId() {
|
public long getInitializerId() {
|
||||||
|
|
@ -89,25 +89,25 @@ public class Initalizer implements Serializable {
|
||||||
this.requiredBy = requiredBy;
|
this.requiredBy = requiredBy;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Initalizer> getRequiredInitializers() {
|
public List<Initalizer> getRequires() {
|
||||||
if (requiredInitializers == null) {
|
if (requires == null) {
|
||||||
return null;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
return Collections.unmodifiableList(requiredInitializers);
|
return Collections.unmodifiableList(requires);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setRequiredInitializers(
|
protected void setRequires(
|
||||||
final List<Initalizer> requiredInitializers) {
|
final List<Initalizer> requires) {
|
||||||
this.requiredInitializers = requiredInitializers;
|
this.requires = requires;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void addRequiredInitalizer(final Initalizer initalizer) {
|
protected void addRequiredInitalizer(final Initalizer initalizer) {
|
||||||
requiredInitializers.add(initalizer);
|
requires.add(initalizer);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void removeRequiredInitalizer(final Initalizer initalizer) {
|
protected void removeRequiredInitalizer(final Initalizer initalizer) {
|
||||||
requiredInitializers.remove(initalizer);
|
requires.remove(initalizer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -117,7 +117,7 @@ public class Initalizer implements Serializable {
|
||||||
= 37 * hash + (int) (initializerId ^ (initializerId >>> 32));
|
= 37 * hash + (int) (initializerId ^ (initializerId >>> 32));
|
||||||
hash = 37 * hash + Objects.hashCode(className);
|
hash = 37 * hash + Objects.hashCode(className);
|
||||||
hash = 37 * hash + Objects.hashCode(requiredBy);
|
hash = 37 * hash + Objects.hashCode(requiredBy);
|
||||||
hash = 37 * hash + Objects.hashCode(requiredInitializers);
|
hash = 37 * hash + Objects.hashCode(requires);
|
||||||
return hash;
|
return hash;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -143,8 +143,8 @@ public class Initalizer implements Serializable {
|
||||||
if (!Objects.equals(requiredBy, other.getRequiredBy())) {
|
if (!Objects.equals(requiredBy, other.getRequiredBy())) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return Objects.equals(requiredInitializers,
|
return Objects.equals(requires,
|
||||||
other.getRequiredInitializers());
|
other.getRequires());
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canEqual(final Object obj) {
|
public boolean canEqual(final Object obj) {
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,12 @@ import javax.persistence.TemporalType;
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "lucene_documents")
|
@Table(name = "lucene_documents")
|
||||||
|
//Can't reduce complexity yet. Not sure what to do about the God class warning.
|
||||||
|
//Maybe we have to put some of the properties into an extra class.
|
||||||
|
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
||||||
|
"PMD.StdCyclomaticComplexity",
|
||||||
|
"PMD.ModifiedCyclomaticComplexity",
|
||||||
|
"PMD.GodClass"})
|
||||||
public class Document implements Serializable {
|
public class Document implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 3363154040440909619L;
|
private static final long serialVersionUID = 3363154040440909619L;
|
||||||
|
|
@ -269,6 +275,11 @@ public class Document implements Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
//Can't reduce complexity yet
|
||||||
|
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
||||||
|
"PMD.StdCyclomaticComplexity",
|
||||||
|
"PMD.ModifiedCyclomaticComplexity",
|
||||||
|
"PMD.NPathComplexity"})
|
||||||
public boolean equals(final Object obj) {
|
public boolean equals(final Object obj) {
|
||||||
if (obj == null) {
|
if (obj == null) {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@ import javax.persistence.UniqueConstraint;
|
||||||
@Table(name = "hosts",
|
@Table(name = "hosts",
|
||||||
uniqueConstraints = {
|
uniqueConstraints = {
|
||||||
@UniqueConstraint(columnNames = {"server_name", "server_port"})})
|
@UniqueConstraint(columnNames = {"server_name", "server_port"})})
|
||||||
|
@SuppressWarnings("PMD.ShortClassName") //Host is perfectly fine as class name...
|
||||||
public class Host implements Serializable {
|
public class Host implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 8727376444061847375L;
|
private static final long serialVersionUID = 8727376444061847375L;
|
||||||
|
|
@ -113,10 +114,10 @@ public class Host implements Serializable {
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return String.format("%s{ "
|
return String.format("%s{ "
|
||||||
+ "hostId = %d, "
|
+ "hostId = %d, "
|
||||||
+ "serverName = \"%s\", "
|
+ "serverName = \"%s\", "
|
||||||
+ "serverPort =\"%s\""
|
+ "serverPort =\"%s\""
|
||||||
+ " }",
|
+ " }",
|
||||||
super.toString(),
|
super.toString(),
|
||||||
hostId,
|
hostId,
|
||||||
serverName,
|
serverName,
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,13 @@ import javax.persistence.Table;
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "workflow_tasks")
|
@Table(name = "workflow_tasks")
|
||||||
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
|
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
|
||||||
|
//Can't reduce complexity yet, Task is a fine name
|
||||||
|
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
||||||
|
"PMD.StdCyclomaticComplexity",
|
||||||
|
"PMD.ModifiedCyclomaticComplexity",
|
||||||
|
"PMD.ShortClassName",
|
||||||
|
"PMD.TooManyMethods",
|
||||||
|
"PMD.AvoidDuplicateLiterals"})
|
||||||
public class Task implements Serializable {
|
public class Task implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 8161343036908150426L;
|
private static final long serialVersionUID = 8161343036908150426L;
|
||||||
|
|
@ -61,18 +68,18 @@ public class Task implements Serializable {
|
||||||
|
|
||||||
@Embedded
|
@Embedded
|
||||||
@AssociationOverride(
|
@AssociationOverride(
|
||||||
name = "values",
|
name = "values",
|
||||||
joinTable = @JoinTable(name = "workflow_task_labels",
|
joinTable = @JoinTable(name = "workflow_task_labels",
|
||||||
joinColumns = {
|
joinColumns = {
|
||||||
@JoinColumn(name = "task_id")}))
|
@JoinColumn(name = "task_id")}))
|
||||||
private LocalizedString label;
|
private LocalizedString label;
|
||||||
|
|
||||||
@Embedded
|
@Embedded
|
||||||
@AssociationOverride(
|
@AssociationOverride(
|
||||||
name = "values",
|
name = "values",
|
||||||
joinTable = @JoinTable(name = "workflow_tasks_descriptions",
|
joinTable = @JoinTable(name = "workflow_tasks_descriptions",
|
||||||
joinColumns = {
|
joinColumns = {
|
||||||
@JoinColumn(name = "task_id")}))
|
@JoinColumn(name = "task_id")}))
|
||||||
private LocalizedString description;
|
private LocalizedString description;
|
||||||
|
|
||||||
@Column(name = "active")
|
@Column(name = "active")
|
||||||
|
|
@ -238,6 +245,11 @@ public class Task implements Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
//Can't reduce complexity yet
|
||||||
|
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
||||||
|
"PMD.StdCyclomaticComplexity",
|
||||||
|
"PMD.ModifiedCyclomaticComplexity",
|
||||||
|
"PMD.NPathComplexity"})
|
||||||
public boolean equals(final Object obj) {
|
public boolean equals(final Object obj) {
|
||||||
if (obj == null) {
|
if (obj == null) {
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -288,14 +300,14 @@ public class Task implements Serializable {
|
||||||
|
|
||||||
public String toString(final String data) {
|
public String toString(final String data) {
|
||||||
return String.format("%s{ "
|
return String.format("%s{ "
|
||||||
+ "taskId = %d, "
|
+ "taskId = %d, "
|
||||||
+ "label = %s, "
|
+ "label = %s, "
|
||||||
+ "active = %b, "
|
+ "active = %b, "
|
||||||
+ "taskState = \"%s\", "
|
+ "taskState = \"%s\", "
|
||||||
+ "workflow = %s, "
|
+ "workflow = %s, "
|
||||||
+ "dependentTasks = %s, "
|
+ "dependentTasks = %s, "
|
||||||
+ "dependsOn = %s%s"
|
+ "dependsOn = %s%s"
|
||||||
+ " }",
|
+ " }",
|
||||||
super.toString(),
|
super.toString(),
|
||||||
taskId,
|
taskId,
|
||||||
Objects.toString(label),
|
Objects.toString(label),
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,10 @@ import javax.persistence.TemporalType;
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "workflow_user_tasks")
|
@Table(name = "workflow_user_tasks")
|
||||||
|
//Can't reduce complexity yet
|
||||||
|
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
||||||
|
"PMD.StdCyclomaticComplexity",
|
||||||
|
"PMD.ModifiedCyclomaticComplexity"})
|
||||||
public class UserTask extends Task implements Serializable {
|
public class UserTask extends Task implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 4188064584389893019L;
|
private static final long serialVersionUID = 4188064584389893019L;
|
||||||
|
|
@ -68,6 +72,7 @@ public class UserTask extends Task implements Serializable {
|
||||||
|
|
||||||
@OneToOne
|
@OneToOne
|
||||||
@JoinColumn(name = "notification_sender")
|
@JoinColumn(name = "notification_sender")
|
||||||
|
@SuppressWarnings("PMD.LongVariable") //Shorter name would not be descriptive
|
||||||
private User notificationSender;
|
private User notificationSender;
|
||||||
|
|
||||||
@OneToMany
|
@OneToMany
|
||||||
|
|
@ -152,6 +157,7 @@ public class UserTask extends Task implements Serializable {
|
||||||
return notificationSender;
|
return notificationSender;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("PMD.LongVariable")
|
||||||
public void setNotificationSender(final User notificationSender) {
|
public void setNotificationSender(final User notificationSender) {
|
||||||
this.notificationSender = notificationSender;
|
this.notificationSender = notificationSender;
|
||||||
}
|
}
|
||||||
|
|
@ -204,7 +210,7 @@ public class UserTask extends Task implements Serializable {
|
||||||
hash = 37 * hash + Objects.hashCode(startDate);
|
hash = 37 * hash + Objects.hashCode(startDate);
|
||||||
hash = 37 * hash + Objects.hashCode(dueDate);
|
hash = 37 * hash + Objects.hashCode(dueDate);
|
||||||
hash
|
hash
|
||||||
= 37 * hash + (int) (durationMinutes ^ (durationMinutes >>> 32));
|
= 37 * hash + (int) (durationMinutes ^ (durationMinutes >>> 32));
|
||||||
hash = 37 * hash + Objects.hashCode(notificationSender);
|
hash = 37 * hash + Objects.hashCode(notificationSender);
|
||||||
hash = 37 * hash + Objects.hashCode(assignedUsers);
|
hash = 37 * hash + Objects.hashCode(assignedUsers);
|
||||||
hash = 37 * hash + Objects.hashCode(assignedGroups);
|
hash = 37 * hash + Objects.hashCode(assignedGroups);
|
||||||
|
|
@ -212,6 +218,11 @@ public class UserTask extends Task implements Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
//Can't reduce complexity yet
|
||||||
|
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
||||||
|
"PMD.StdCyclomaticComplexity",
|
||||||
|
"PMD.ModifiedCyclomaticComplexity",
|
||||||
|
"PMD.NPathComplexity"})
|
||||||
public boolean equals(final Object obj) {
|
public boolean equals(final Object obj) {
|
||||||
if (obj == null) {
|
if (obj == null) {
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -257,15 +268,15 @@ public class UserTask extends Task implements Serializable {
|
||||||
public boolean canEqual(final Object obj) {
|
public boolean canEqual(final Object obj) {
|
||||||
return obj instanceof UserTask;
|
return obj instanceof UserTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString(final String data) {
|
public String toString(final String data) {
|
||||||
return super.toString(String.format(", locked = %b, "
|
return super.toString(String.format(", locked = %b, "
|
||||||
+ "lockingUser = %s, "
|
+ "lockingUser = %s, "
|
||||||
+ "startDate = %tF %<tT,"
|
+ "startDate = %tF %<tT,"
|
||||||
+ "dueDate = %tF %<tT, "
|
+ "dueDate = %tF %<tT, "
|
||||||
+ "durationMinutes = %d, "
|
+ "durationMinutes = %d, "
|
||||||
+ "notificationSender = %s%s",
|
+ "notificationSender = %s%s",
|
||||||
locked,
|
locked,
|
||||||
Objects.toString(lockingUser),
|
Objects.toString(lockingUser),
|
||||||
startDate,
|
startDate,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue