CCM NG: Ensure that fields of type LocalizedString are never null.
git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@4875 8810af33-2d31-482b-a856-94f89814c4df
parent
613c2d6dd2
commit
4e14799253
|
|
@ -95,6 +95,7 @@ public class BinaryAsset extends Asset implements Serializable {
|
|||
}
|
||||
|
||||
public void setDescription(final LocalizedString description) {
|
||||
Objects.requireNonNull(description);
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@ import com.arsdigita.cms.ui.assets.forms.BookmarkForm;
|
|||
import org.librecms.contentsection.Asset;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.net.URL;
|
||||
import java.util.Objects;
|
||||
|
||||
import javax.persistence.AssociationOverride;
|
||||
|
|
@ -85,6 +84,7 @@ public class Bookmark extends Asset implements Serializable {
|
|||
}
|
||||
|
||||
public void setDescription(final LocalizedString description) {
|
||||
Objects.requireNonNull(description);
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -116,6 +116,7 @@ public class LegalMetadata extends Asset implements Serializable {
|
|||
}
|
||||
|
||||
public void setRights(final LocalizedString rights) {
|
||||
Objects.requireNonNull(rights);
|
||||
this.rights = rights;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -75,6 +75,7 @@ public class SideNote extends Asset implements Serializable {
|
|||
}
|
||||
|
||||
public void setText(final LocalizedString text) {
|
||||
Objects.requireNonNull(text);
|
||||
this.text = text;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -387,6 +387,7 @@ public class Asset extends CcmObject {
|
|||
}
|
||||
|
||||
public void setTitle(final LocalizedString title) {
|
||||
Objects.requireNonNull(title);
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -192,6 +192,7 @@ public class AttachmentList implements Comparable<AttachmentList>,
|
|||
}
|
||||
|
||||
public void setTitle(final LocalizedString title) {
|
||||
Objects.requireNonNull(title);
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -119,6 +119,12 @@ public class ContentType extends CcmObject implements Serializable {
|
|||
@JoinColumn(name = "DEFAULT_WORKFLOW")
|
||||
private WorkflowTemplate defaultWorkflow;
|
||||
|
||||
public ContentType() {
|
||||
super();
|
||||
label = new LocalizedString();
|
||||
description = new LocalizedString();
|
||||
}
|
||||
|
||||
public String getContentItemClass() {
|
||||
return contentItemClass;
|
||||
}
|
||||
|
|
@ -140,6 +146,7 @@ public class ContentType extends CcmObject implements Serializable {
|
|||
}
|
||||
|
||||
public void setLabel(final LocalizedString label) {
|
||||
Objects.requireNonNull(label);
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
|
|
@ -148,6 +155,7 @@ public class ContentType extends CcmObject implements Serializable {
|
|||
}
|
||||
|
||||
public void setDescription(final LocalizedString description) {
|
||||
Objects.requireNonNull(description);
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -93,6 +93,7 @@ public class Article extends ContentItem implements Serializable {
|
|||
}
|
||||
|
||||
public void setText(final LocalizedString text) {
|
||||
Objects.requireNonNull(text);
|
||||
this.text = text;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -169,11 +169,21 @@ public class Event extends ContentItem implements Serializable {
|
|||
))
|
||||
private LocalizedString cost;
|
||||
|
||||
public Event() {
|
||||
text = new LocalizedString();
|
||||
eventDate = new LocalizedString();
|
||||
location = new LocalizedString();
|
||||
mainContributor = new LocalizedString();
|
||||
eventType = new LocalizedString();
|
||||
cost = new LocalizedString();
|
||||
}
|
||||
|
||||
public LocalizedString getText() {
|
||||
return text;
|
||||
}
|
||||
|
||||
public void setText(final LocalizedString text) {
|
||||
Objects.requireNonNull(text);
|
||||
this.text = text;
|
||||
}
|
||||
|
||||
|
|
@ -214,6 +224,7 @@ public class Event extends ContentItem implements Serializable {
|
|||
}
|
||||
|
||||
public void setEventDate(final LocalizedString eventDate) {
|
||||
Objects.requireNonNull(eventDate);
|
||||
this.eventDate = eventDate;
|
||||
}
|
||||
|
||||
|
|
@ -222,6 +233,7 @@ public class Event extends ContentItem implements Serializable {
|
|||
}
|
||||
|
||||
public void setLocation(final LocalizedString location) {
|
||||
Objects.requireNonNull(location);
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
|
|
@ -230,6 +242,7 @@ public class Event extends ContentItem implements Serializable {
|
|||
}
|
||||
|
||||
public void setMainContributor(final LocalizedString mainContributor) {
|
||||
Objects.requireNonNull(mainContributor);
|
||||
this.mainContributor = mainContributor;
|
||||
}
|
||||
|
||||
|
|
@ -238,6 +251,7 @@ public class Event extends ContentItem implements Serializable {
|
|||
}
|
||||
|
||||
public void setEventType(final LocalizedString eventType) {
|
||||
Objects.requireNonNull(eventType);
|
||||
this.eventType = eventType;
|
||||
}
|
||||
|
||||
|
|
@ -254,6 +268,7 @@ public class Event extends ContentItem implements Serializable {
|
|||
}
|
||||
|
||||
public void setCost(final LocalizedString cost) {
|
||||
Objects.requireNonNull(cost);
|
||||
this.cost = cost;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -94,6 +94,8 @@ public class MultiPartArticle extends ContentItem implements Serializable {
|
|||
private List<MultiPartArticleSection> sections;
|
||||
|
||||
public MultiPartArticle() {
|
||||
super();
|
||||
summary = new LocalizedString();
|
||||
this.sections = new ArrayList<>();
|
||||
}
|
||||
|
||||
|
|
@ -102,6 +104,7 @@ public class MultiPartArticle extends ContentItem implements Serializable {
|
|||
}
|
||||
|
||||
public void setSummary(final LocalizedString summary) {
|
||||
Objects.requireNonNull(summary);
|
||||
this.summary = summary;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -93,6 +93,12 @@ public class MultiPartArticleSection implements Serializable {
|
|||
))
|
||||
private LocalizedString text;
|
||||
|
||||
public MultiPartArticleSection() {
|
||||
super();
|
||||
title = new LocalizedString();
|
||||
text = new LocalizedString();
|
||||
}
|
||||
|
||||
public long getSectionId() {
|
||||
return sectionId;
|
||||
}
|
||||
|
|
@ -106,6 +112,7 @@ public class MultiPartArticleSection implements Serializable {
|
|||
}
|
||||
|
||||
public void setTitle(final LocalizedString title) {
|
||||
Objects.requireNonNull(title);
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
|
|
@ -130,6 +137,7 @@ public class MultiPartArticleSection implements Serializable {
|
|||
}
|
||||
|
||||
public void setText(final LocalizedString text) {
|
||||
Objects.requireNonNull(text);
|
||||
this.text = text;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -106,11 +106,17 @@ public class News extends ContentItem implements Serializable {
|
|||
@Column(name = "HOMEPAGE")
|
||||
private boolean homepage;
|
||||
|
||||
public News() {
|
||||
super();
|
||||
text = new LocalizedString();
|
||||
}
|
||||
|
||||
public LocalizedString getText() {
|
||||
return text;
|
||||
}
|
||||
|
||||
public void setText(final LocalizedString text) {
|
||||
Objects.requireNonNull(text);
|
||||
this.text = text;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -101,6 +101,7 @@ public class LifecycleDefinition implements Serializable {
|
|||
}
|
||||
|
||||
public void setLabel(final LocalizedString label) {
|
||||
Objects.requireNonNull(label);
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
|
|
@ -109,6 +110,7 @@ public class LifecycleDefinition implements Serializable {
|
|||
}
|
||||
|
||||
public void setDescription(final LocalizedString description) {
|
||||
Objects.requireNonNull(description);
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -98,6 +98,7 @@ public class PhaseDefinition implements Serializable {
|
|||
}
|
||||
|
||||
public void setLabel(final LocalizedString label) {
|
||||
Objects.requireNonNull(label);
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
|
|
@ -106,6 +107,7 @@ public class PhaseDefinition implements Serializable {
|
|||
}
|
||||
|
||||
public void setDescription(final LocalizedString description) {
|
||||
Objects.requireNonNull(description);
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -288,6 +288,7 @@ public class Category extends CcmObject implements Serializable, Portable {
|
|||
}
|
||||
|
||||
public void setTitle(final LocalizedString title) {
|
||||
Objects.requireNonNull(title);
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
|
|
@ -296,6 +297,7 @@ public class Category extends CcmObject implements Serializable, Portable {
|
|||
}
|
||||
|
||||
public void setDescription(final LocalizedString description) {
|
||||
Objects.requireNonNull(description);
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -229,6 +229,7 @@ public class Domain extends CcmObject implements Serializable {
|
|||
}
|
||||
|
||||
public void setTitle(final LocalizedString title) {
|
||||
Objects.requireNonNull(title);
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
|
|
@ -237,6 +238,7 @@ public class Domain extends CcmObject implements Serializable {
|
|||
}
|
||||
|
||||
public void setDescription(final LocalizedString description) {
|
||||
Objects.requireNonNull(description);
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -65,6 +65,7 @@ public class LocalizedStringSetting
|
|||
|
||||
@Override
|
||||
public void setValue(final LocalizedString value) {
|
||||
Objects.requireNonNull(value);
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -115,13 +115,12 @@ public class Resource extends CcmObject implements Serializable {
|
|||
childs = new ArrayList<>();
|
||||
}
|
||||
|
||||
// @Column(name = "resource_type")
|
||||
// private String resourceType;
|
||||
public LocalizedString getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(final LocalizedString title) {
|
||||
Objects.requireNonNull(title);
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
|
|
@ -130,6 +129,7 @@ public class Resource extends CcmObject implements Serializable {
|
|||
}
|
||||
|
||||
public void setDescription(final LocalizedString description) {
|
||||
Objects.requireNonNull(description);
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -114,6 +114,7 @@ public class ResourceType implements Serializable {
|
|||
}
|
||||
|
||||
public void setDescription(final LocalizedString description) {
|
||||
Objects.requireNonNull(description);
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -65,6 +65,12 @@ public class PersistentDataQuery extends CcmObject implements Serializable {
|
|||
@JoinColumn(name = "DATA_QUERY_ID")}))
|
||||
private LocalizedString description;
|
||||
|
||||
public PersistentDataQuery() {
|
||||
super();
|
||||
name = new LocalizedString();
|
||||
description = new LocalizedString();
|
||||
}
|
||||
|
||||
public String getQueryId() {
|
||||
return queryId;
|
||||
}
|
||||
|
|
@ -78,6 +84,7 @@ public class PersistentDataQuery extends CcmObject implements Serializable {
|
|||
}
|
||||
|
||||
public void setName(final LocalizedString name) {
|
||||
Objects.requireNonNull(name);
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
|
|
@ -86,6 +93,7 @@ public class PersistentDataQuery extends CcmObject implements Serializable {
|
|||
}
|
||||
|
||||
public void setDescription(final LocalizedString description) {
|
||||
Objects.requireNonNull(description);
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -73,11 +73,18 @@ public class ProcessListener extends CcmObject implements Serializable {
|
|||
@Column(name = "PROCESS_LISTENER_ORDER")
|
||||
private long order;
|
||||
|
||||
public ProcessListener() {
|
||||
super();
|
||||
name = new LocalizedString();
|
||||
description = new LocalizedString();
|
||||
}
|
||||
|
||||
public LocalizedString getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(final LocalizedString name) {
|
||||
Objects.requireNonNull(name);
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
|
|
@ -86,6 +93,7 @@ public class ProcessListener extends CcmObject implements Serializable {
|
|||
}
|
||||
|
||||
public void setDescription(final LocalizedString description) {
|
||||
Objects.requireNonNull(description);
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -247,6 +247,7 @@ public class PageModel implements Serializable {
|
|||
}
|
||||
|
||||
protected void setTitle(final LocalizedString title) {
|
||||
Objects.requireNonNull(title);
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
|
|
@ -255,6 +256,7 @@ public class PageModel implements Serializable {
|
|||
}
|
||||
|
||||
protected void setDescription(final LocalizedString description) {
|
||||
Objects.requireNonNull(description);
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -286,14 +286,15 @@ public class Role implements Serializable, Portable {
|
|||
assignedTasks.remove(taskAssignment);
|
||||
}
|
||||
|
||||
public void setDescription(final LocalizedString description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public LocalizedString getDescription() {
|
||||
return this.description;
|
||||
}
|
||||
|
||||
public void setDescription(final LocalizedString description) {
|
||||
Objects.requireNonNull(description);
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 7;
|
||||
|
|
|
|||
|
|
@ -230,6 +230,7 @@ public class Task implements Identifiable, Serializable {
|
|||
}
|
||||
|
||||
public void setLabel(final LocalizedString label) {
|
||||
Objects.requireNonNull(label);
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
|
|
@ -238,6 +239,7 @@ public class Task implements Identifiable, Serializable {
|
|||
}
|
||||
|
||||
public void setDescription(final LocalizedString description) {
|
||||
Objects.requireNonNull(description);
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ public class Workflow implements Identifiable, Serializable, Portable {
|
|||
schema = DB_SCHEMA,
|
||||
joinColumns = {
|
||||
@JoinColumn(name = "WORKFLOW_ID")}))
|
||||
private LocalizedString name;
|
||||
private LocalizedString name = new LocalizedString();
|
||||
|
||||
/**
|
||||
* Description of the workflow.
|
||||
|
|
@ -125,7 +125,7 @@ public class Workflow implements Identifiable, Serializable, Portable {
|
|||
joinColumns = {
|
||||
@JoinColumn(name = "WORKFLOW_ID")
|
||||
}))
|
||||
private LocalizedString description;
|
||||
private LocalizedString description = new LocalizedString();
|
||||
|
||||
/**
|
||||
* The current state of the workflow.
|
||||
|
|
@ -201,6 +201,7 @@ public class Workflow implements Identifiable, Serializable, Portable {
|
|||
}
|
||||
|
||||
public void setName(final LocalizedString name) {
|
||||
Objects.requireNonNull(name);
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
|
|
@ -209,6 +210,7 @@ public class Workflow implements Identifiable, Serializable, Portable {
|
|||
}
|
||||
|
||||
public void setDescription(final LocalizedString description) {
|
||||
Objects.requireNonNull(description);
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue