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-94f89814c4df
pull/2/head
jensp 2015-06-05 06:35:58 +00:00
parent a79c67974d
commit 1745c25dcc
27 changed files with 278 additions and 100 deletions

View File

@ -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;

View File

@ -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

View File

@ -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();
}

View File

@ -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;
/** /**

View File

@ -30,6 +30,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>
*/ */
@Embeddable @Embeddable
@ -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);
} }

View File

@ -29,6 +29,7 @@ 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>
*/ */

View File

@ -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;

View File

@ -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;
@ -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;

View File

@ -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;
} }

View File

@ -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() {

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;
} }

View File

@ -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;
} }

View File

@ -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;

View File

@ -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;

View File

@ -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 {
@ -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;

View File

@ -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,6 +193,11 @@ 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;

View File

@ -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,6 +156,11 @@ 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;

View File

@ -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;

View File

@ -34,8 +34,8 @@ 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}
@ -45,6 +45,10 @@ import javax.persistence.Table;
*/ */
@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;

View File

@ -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) {

View File

@ -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;

View File

@ -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;

View File

@ -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;
@ -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;

View File

@ -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;
} }
@ -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;