Author: andreas
Date: Sat Jan 3 08:33:52 2009
New Revision: 731018
URL: http://svn.apache.org/viewvc?rev=731018&view=rev
Log:
Adding assertion that identity of workflowable must not be null.
Modified:
lenya/trunk/src/java/org/apache/lenya/cms/workflow/DocumentWorkflowable.java
Modified: lenya/trunk/src/java/org/apache/lenya/cms/workflow/DocumentWorkflowable.java
URL: http://svn.apache.org/viewvc/lenya/trunk/src/java/org/apache/lenya/cms/workflow/DocumentWorkflowable.java?rev=731018&r1=731017&r2=731018&view=diff
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/workflow/DocumentWorkflowable.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/workflow/DocumentWorkflowable.java Sat Jan 3 08:33:52 2009
@@ -39,6 +39,7 @@
import org.apache.lenya.cms.publication.Document;
import org.apache.lenya.cms.publication.ResourceType;
import org.apache.lenya.cms.repository.Session;
+import org.apache.lenya.util.Assert;
import org.apache.lenya.workflow.Version;
import org.apache.lenya.workflow.Workflow;
import org.apache.lenya.workflow.Workflowable;
@@ -59,6 +60,9 @@
*/
public DocumentWorkflowable(ServiceManager manager, Session session, Document document,
Logger logger) {
+ if (session.getIdentity() == null) {
+ throw new IllegalArgumentException("The session must have an identity.");
+ }
this.document = document;
this.session = session;
this.manager = manager;
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.