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
|
||||
//No chance to make this method less complex, therefore suppress warning
|
||||
@SuppressWarnings("PMD.NPathComplexity")
|
||||
public boolean equals(final Object obj) {
|
||||
if (obj == null) {
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@ import java.util.Objects;
|
|||
import javax.persistence.AssociationOverride;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Convert;
|
||||
import javax.persistence.Converter;
|
||||
import javax.persistence.Embedded;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.JoinColumn;
|
||||
|
|
@ -46,6 +45,7 @@ import javax.persistence.Table;
|
|||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
import javax.validation.constraints.Pattern;
|
||||
import org.omg.CORBA.DomainManager;
|
||||
|
||||
/**
|
||||
* 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.OneToMany;
|
||||
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
|
||||
|
|
@ -58,6 +60,11 @@ import javax.persistence.Table;
|
|||
@Entity
|
||||
@Table(name = "ccm_objects")
|
||||
@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 {
|
||||
|
||||
private static final long serialVersionUID = 201504261329L;
|
||||
|
|
@ -70,6 +77,7 @@ public class CcmObject implements Serializable {
|
|||
@Id
|
||||
@Column(name = "object_id")
|
||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||
@XmlElement(name = "object-id")
|
||||
private long objectId;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -30,6 +30,14 @@ import javax.persistence.Embeddable;
|
|||
/**
|
||||
* 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>
|
||||
*/
|
||||
@Embeddable
|
||||
|
|
@ -40,7 +48,7 @@ public class EmailAddress implements Serializable {
|
|||
@Column(name = "email_address", length = 512, nullable = false)
|
||||
@NotBlank
|
||||
@Email
|
||||
private String eMailAddress;
|
||||
private String address;
|
||||
|
||||
@Column(name = "bouncing")
|
||||
private boolean bouncing;
|
||||
|
|
@ -48,12 +56,12 @@ public class EmailAddress implements Serializable {
|
|||
@Column(name = "verified")
|
||||
private boolean verified;
|
||||
|
||||
public String getEmailAddress() {
|
||||
return eMailAddress;
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
public void setEmailAddress(final String eMailAddress) {
|
||||
this.eMailAddress = eMailAddress;
|
||||
public void setAddress(final String eMailAddress) {
|
||||
this.address = eMailAddress;
|
||||
}
|
||||
|
||||
public boolean isBouncing() {
|
||||
|
|
@ -75,7 +83,7 @@ public class EmailAddress implements Serializable {
|
|||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 5;
|
||||
hash = 79 * hash + Objects.hashCode(eMailAddress);
|
||||
hash = 79 * hash + Objects.hashCode(address);
|
||||
hash = 79 * hash + (bouncing ? 1 : 0);
|
||||
hash = 79 * hash + (verified ? 1 : 0);
|
||||
return hash;
|
||||
|
|
@ -94,7 +102,7 @@ public class EmailAddress implements Serializable {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (!Objects.equals(eMailAddress, other.getEmailAddress())) {
|
||||
if (!Objects.equals(address, other.getAddress())) {
|
||||
return false;
|
||||
}
|
||||
if (bouncing != other.isBouncing()) {
|
||||
|
|
@ -114,7 +122,7 @@ public class EmailAddress implements Serializable {
|
|||
+ "bouncing = %b, "
|
||||
+ "verified = %b }",
|
||||
super.toString(),
|
||||
eMailAddress,
|
||||
address,
|
||||
bouncing,
|
||||
verified);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ import javax.persistence.ManyToOne;
|
|||
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>
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -52,6 +52,8 @@ public class Party extends CcmObject implements Serializable {
|
|||
private List<EmailAddress> emailAddresses;
|
||||
|
||||
@OneToMany(mappedBy = "grantee")
|
||||
//Can't shorten this variable name without reducing descriptiveness
|
||||
@SuppressWarnings("PMD.LongVariable")
|
||||
private List<Permission> grantedPermissions;
|
||||
|
||||
public Party() {
|
||||
|
|
@ -84,6 +86,8 @@ public class Party extends CcmObject implements Serializable {
|
|||
return Collections.unmodifiableList(grantedPermissions);
|
||||
}
|
||||
|
||||
//Can't shorten this variable name without reducing descriptiveness
|
||||
@SuppressWarnings("PMD.LongVariable")
|
||||
protected void setGrantedPermissions(
|
||||
final List<Permission> grantedPermissions) {
|
||||
this.grantedPermissions = grantedPermissions;
|
||||
|
|
|
|||
|
|
@ -40,6 +40,10 @@ import javax.persistence.TemporalType;
|
|||
*/
|
||||
@Entity
|
||||
@Table(name = "permissions")
|
||||
//Can't reduce complexity yet
|
||||
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
||||
"PMD.StdCyclomaticComplexity",
|
||||
"PMD.ModifiedCyclomaticComplexity"})
|
||||
public class Permission implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -2368935232499907547L;
|
||||
|
|
@ -147,6 +151,11 @@ public class Permission implements Serializable {
|
|||
}
|
||||
|
||||
@Override
|
||||
//Can't reduce complexity yet
|
||||
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
||||
"PMD.StdCyclomaticComplexity",
|
||||
"PMD.ModifiedCyclomaticComplexity",
|
||||
"PMD.NPathComplexity"})
|
||||
public boolean equals(final Object obj) {
|
||||
if (obj == null) {
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ public class PersonName implements Serializable {
|
|||
return middleName;
|
||||
}
|
||||
|
||||
public void setMiddleName(String middleName) {
|
||||
public void setMiddleName(final String middleName) {
|
||||
this.middleName = middleName;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -44,6 +44,8 @@ public class Privilege implements Serializable {
|
|||
private long privilegeId;
|
||||
|
||||
@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;
|
||||
|
||||
public long getPrivilegeId() {
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ import org.hibernate.validator.constraints.NotBlank;
|
|||
*/
|
||||
@Entity
|
||||
@Table(name = "roles")
|
||||
@SuppressWarnings("PMD.ShortClassName") //Role is perfectly fine name.
|
||||
public class Role implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 3314358449751376350L;
|
||||
|
|
|
|||
|
|
@ -44,6 +44,12 @@ import javax.persistence.OneToMany;
|
|||
*/
|
||||
@Entity
|
||||
@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 {
|
||||
|
||||
private static final long serialVersionUID = 892038270064849732L;
|
||||
|
|
@ -184,6 +190,11 @@ public class User extends Party implements Serializable {
|
|||
}
|
||||
|
||||
@Override
|
||||
//Can't reduce complexity yet
|
||||
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
||||
"PMD.StdCyclomaticComplexity",
|
||||
"PMD.ModifiedCyclomaticComplexity",
|
||||
"PMD.NPathComplexity"})
|
||||
public boolean equals(final Object obj) {
|
||||
if (!super.equals(obj)) {
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -42,6 +42,10 @@ import javax.persistence.Table;
|
|||
*/
|
||||
@Entity
|
||||
@Table(name = "formbuilder_components")
|
||||
//Can't reduce complexity yet
|
||||
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
||||
"PMD.StdCyclomaticComplexity",
|
||||
"PMD.ModifiedCyclomaticComplexity"})
|
||||
public class Component extends CcmObject implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1787173100367982069L;
|
||||
|
|
@ -158,6 +162,11 @@ public class Component extends CcmObject implements Serializable {
|
|||
}
|
||||
|
||||
@Override
|
||||
//Can't reduce complexity yet
|
||||
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
||||
"PMD.StdCyclomaticComplexity",
|
||||
"PMD.ModifiedCyclomaticComplexity",
|
||||
"PMD.NPathComplexity"})
|
||||
public boolean equals(final Object obj) {
|
||||
if (obj == null) {
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ public class Listener extends CcmObject implements Serializable {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
public boolean equals(final Object obj) {
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ public class ObjectType extends CcmObject implements Serializable {
|
|||
return false;
|
||||
}
|
||||
final ObjectType other = (ObjectType) obj;
|
||||
if (!canEqual(this)) {
|
||||
if (!other.canEqual(this)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -122,6 +122,8 @@ public class ProcessListener extends CcmObject implements Serializable {
|
|||
}
|
||||
|
||||
@Override
|
||||
//We can't reduce the complexity now
|
||||
@SuppressWarnings("PMD.NPathComplexity")
|
||||
public boolean equals(final Object obj) {
|
||||
if (obj == null) {
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -118,6 +118,8 @@ public class Widget extends Component implements Serializable {
|
|||
}
|
||||
|
||||
@Override
|
||||
//Can't reduce complexity yet
|
||||
@SuppressWarnings("PMD.NPathComplexity")
|
||||
public boolean equals(final Object obj) {
|
||||
if (obj == null) {
|
||||
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) {
|
||||
this.data = null;
|
||||
} else {
|
||||
|
|
@ -139,6 +139,8 @@ public class Attachment implements Serializable {
|
|||
}
|
||||
|
||||
@Override
|
||||
//Can't reduce complexity yet
|
||||
@SuppressWarnings("PMD.NPathComplexity")
|
||||
public boolean equals(final Object obj) {
|
||||
if (obj == null) {
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -46,6 +46,10 @@ import javax.persistence.TemporalType;
|
|||
*/
|
||||
@Entity
|
||||
@Table(name = "messages")
|
||||
//Can't reduce complexity yet
|
||||
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
||||
"PMD.StdCyclomaticComplexity",
|
||||
"PMD.ModifiedCyclomaticComplexity"})
|
||||
public class Message extends CcmObject implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -9143137794418932025L;
|
||||
|
|
@ -189,6 +193,11 @@ public class Message extends CcmObject implements Serializable {
|
|||
}
|
||||
|
||||
@Override
|
||||
//Can't reduce complexity yet
|
||||
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
||||
"PMD.StdCyclomaticComplexity",
|
||||
"PMD.ModifiedCyclomaticComplexity",
|
||||
"PMD.NPathComplexity"})
|
||||
public boolean equals(final Object obj) {
|
||||
if (obj == null) {
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -47,6 +47,10 @@ import javax.persistence.TemporalType;
|
|||
*/
|
||||
@Entity
|
||||
@Table(name = "digests")
|
||||
//Can't reduce complexity yet
|
||||
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
||||
"PMD.StdCyclomaticComplexity",
|
||||
"PMD.ModifiedCyclomaticComplexity"})
|
||||
public class Digest extends CcmObject implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -3526066971290670390L;
|
||||
|
|
@ -152,6 +156,11 @@ public class Digest extends CcmObject implements Serializable {
|
|||
}
|
||||
|
||||
@Override
|
||||
//Can't reduce complexity yet
|
||||
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
||||
"PMD.StdCyclomaticComplexity",
|
||||
"PMD.ModifiedCyclomaticComplexity",
|
||||
"PMD.NPathComplexity"})
|
||||
public boolean equals(final Object obj) {
|
||||
if (obj == null) {
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -68,6 +68,12 @@ import javax.persistence.TemporalType;
|
|||
*/
|
||||
@Entity
|
||||
@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 {
|
||||
|
||||
private static final long serialVersionUID = -6052859580690813506L;
|
||||
|
|
@ -244,6 +250,11 @@ public class Notification extends CcmObject implements Serializable {
|
|||
}
|
||||
|
||||
@Override
|
||||
//Can't reduce complexity yet
|
||||
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
||||
"PMD.StdCyclomaticComplexity",
|
||||
"PMD.ModifiedCyclomaticComplexity",
|
||||
"PMD.NPathComplexity"})
|
||||
public boolean equals(final Object obj) {
|
||||
if (obj == null) {
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -34,8 +34,8 @@ import javax.persistence.OneToOne;
|
|||
import javax.persistence.Table;
|
||||
|
||||
/**
|
||||
* Represents a notification that has been transferred to the outbound
|
||||
* message queue. During processing, this class is used to retrieve information
|
||||
* Represents a notification that has been transferred to the outbound message
|
||||
* queue. During processing, this class is used to retrieve information
|
||||
* necessary to convert the notification into an outbound email message.
|
||||
*
|
||||
* (Documentation taken from the [@code com.arsdigita.notifiction.QueueItem}
|
||||
|
|
@ -45,6 +45,10 @@ import javax.persistence.Table;
|
|||
*/
|
||||
@Entity
|
||||
@Table(name = "queue_items")
|
||||
//Can't reduce complexity yet
|
||||
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
||||
"PMD.StdCyclomaticComplexity",
|
||||
"PMD.ModifiedCyclomaticComplexity"})
|
||||
public class QueueItem implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 396330385592074013L;
|
||||
|
|
@ -156,6 +160,11 @@ public class QueueItem implements Serializable {
|
|||
}
|
||||
|
||||
@Override
|
||||
//Can't reduce complexity yet
|
||||
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
||||
"PMD.StdCyclomaticComplexity",
|
||||
"PMD.ModifiedCyclomaticComplexity",
|
||||
"PMD.NPathComplexity"})
|
||||
public boolean equals(final Object obj) {
|
||||
if (obj == null) {
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -57,12 +57,12 @@ public class Initalizer implements Serializable {
|
|||
private Initalizer requiredBy;
|
||||
|
||||
@OneToMany(mappedBy = "requiredBy")
|
||||
private List<Initalizer> requiredInitializers;
|
||||
private List<Initalizer> requires;
|
||||
|
||||
public Initalizer() {
|
||||
super();
|
||||
|
||||
requiredInitializers = new ArrayList<>();
|
||||
requires = new ArrayList<>();
|
||||
}
|
||||
|
||||
public long getInitializerId() {
|
||||
|
|
@ -89,25 +89,25 @@ public class Initalizer implements Serializable {
|
|||
this.requiredBy = requiredBy;
|
||||
}
|
||||
|
||||
public List<Initalizer> getRequiredInitializers() {
|
||||
if (requiredInitializers == null) {
|
||||
public List<Initalizer> getRequires() {
|
||||
if (requires == null) {
|
||||
return null;
|
||||
} else {
|
||||
return Collections.unmodifiableList(requiredInitializers);
|
||||
return Collections.unmodifiableList(requires);
|
||||
}
|
||||
}
|
||||
|
||||
protected void setRequiredInitializers(
|
||||
final List<Initalizer> requiredInitializers) {
|
||||
this.requiredInitializers = requiredInitializers;
|
||||
protected void setRequires(
|
||||
final List<Initalizer> requires) {
|
||||
this.requires = requires;
|
||||
}
|
||||
|
||||
protected void addRequiredInitalizer(final Initalizer initalizer) {
|
||||
requiredInitializers.add(initalizer);
|
||||
requires.add(initalizer);
|
||||
}
|
||||
|
||||
protected void removeRequiredInitalizer(final Initalizer initalizer) {
|
||||
requiredInitializers.remove(initalizer);
|
||||
requires.remove(initalizer);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -117,7 +117,7 @@ public class Initalizer implements Serializable {
|
|||
= 37 * hash + (int) (initializerId ^ (initializerId >>> 32));
|
||||
hash = 37 * hash + Objects.hashCode(className);
|
||||
hash = 37 * hash + Objects.hashCode(requiredBy);
|
||||
hash = 37 * hash + Objects.hashCode(requiredInitializers);
|
||||
hash = 37 * hash + Objects.hashCode(requires);
|
||||
return hash;
|
||||
}
|
||||
|
||||
|
|
@ -143,8 +143,8 @@ public class Initalizer implements Serializable {
|
|||
if (!Objects.equals(requiredBy, other.getRequiredBy())) {
|
||||
return false;
|
||||
}
|
||||
return Objects.equals(requiredInitializers,
|
||||
other.getRequiredInitializers());
|
||||
return Objects.equals(requires,
|
||||
other.getRequires());
|
||||
}
|
||||
|
||||
public boolean canEqual(final Object obj) {
|
||||
|
|
|
|||
|
|
@ -42,6 +42,12 @@ import javax.persistence.TemporalType;
|
|||
*/
|
||||
@Entity
|
||||
@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 {
|
||||
|
||||
private static final long serialVersionUID = 3363154040440909619L;
|
||||
|
|
@ -269,6 +275,11 @@ public class Document implements Serializable {
|
|||
}
|
||||
|
||||
@Override
|
||||
//Can't reduce complexity yet
|
||||
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
||||
"PMD.StdCyclomaticComplexity",
|
||||
"PMD.ModifiedCyclomaticComplexity",
|
||||
"PMD.NPathComplexity"})
|
||||
public boolean equals(final Object obj) {
|
||||
if (obj == null) {
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ import javax.persistence.UniqueConstraint;
|
|||
@Table(name = "hosts",
|
||||
uniqueConstraints = {
|
||||
@UniqueConstraint(columnNames = {"server_name", "server_port"})})
|
||||
@SuppressWarnings("PMD.ShortClassName") //Host is perfectly fine as class name...
|
||||
public class Host implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 8727376444061847375L;
|
||||
|
|
|
|||
|
|
@ -50,6 +50,13 @@ import javax.persistence.Table;
|
|||
@Entity
|
||||
@Table(name = "workflow_tasks")
|
||||
@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 {
|
||||
|
||||
private static final long serialVersionUID = 8161343036908150426L;
|
||||
|
|
@ -238,6 +245,11 @@ public class Task implements Serializable {
|
|||
}
|
||||
|
||||
@Override
|
||||
//Can't reduce complexity yet
|
||||
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
||||
"PMD.StdCyclomaticComplexity",
|
||||
"PMD.ModifiedCyclomaticComplexity",
|
||||
"PMD.NPathComplexity"})
|
||||
public boolean equals(final Object obj) {
|
||||
if (obj == null) {
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -44,6 +44,10 @@ import javax.persistence.TemporalType;
|
|||
*/
|
||||
@Entity
|
||||
@Table(name = "workflow_user_tasks")
|
||||
//Can't reduce complexity yet
|
||||
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
||||
"PMD.StdCyclomaticComplexity",
|
||||
"PMD.ModifiedCyclomaticComplexity"})
|
||||
public class UserTask extends Task implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 4188064584389893019L;
|
||||
|
|
@ -68,6 +72,7 @@ public class UserTask extends Task implements Serializable {
|
|||
|
||||
@OneToOne
|
||||
@JoinColumn(name = "notification_sender")
|
||||
@SuppressWarnings("PMD.LongVariable") //Shorter name would not be descriptive
|
||||
private User notificationSender;
|
||||
|
||||
@OneToMany
|
||||
|
|
@ -152,6 +157,7 @@ public class UserTask extends Task implements Serializable {
|
|||
return notificationSender;
|
||||
}
|
||||
|
||||
@SuppressWarnings("PMD.LongVariable")
|
||||
public void setNotificationSender(final User notificationSender) {
|
||||
this.notificationSender = notificationSender;
|
||||
}
|
||||
|
|
@ -212,6 +218,11 @@ public class UserTask extends Task implements Serializable {
|
|||
}
|
||||
|
||||
@Override
|
||||
//Can't reduce complexity yet
|
||||
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
||||
"PMD.StdCyclomaticComplexity",
|
||||
"PMD.ModifiedCyclomaticComplexity",
|
||||
"PMD.NPathComplexity"})
|
||||
public boolean equals(final Object obj) {
|
||||
if (obj == null) {
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Reference in New Issue