You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by an...@apache.org on 2007/11/16 10:18:42 UTC
svn commit: r595603 -
/lenya/trunk/src/impl/java/org/apache/lenya/cms/publication/DocumentFactoryImpl.java
Author: andreas
Date: Fri Nov 16 01:18:42 2007
New Revision: 595603
URL: http://svn.apache.org/viewvc?rev=595603&view=rev
Log:
Added some not-null assertions to DocumentFactoryImpl
Modified:
lenya/trunk/src/impl/java/org/apache/lenya/cms/publication/DocumentFactoryImpl.java
Modified: lenya/trunk/src/impl/java/org/apache/lenya/cms/publication/DocumentFactoryImpl.java
URL: http://svn.apache.org/viewvc/lenya/trunk/src/impl/java/org/apache/lenya/cms/publication/DocumentFactoryImpl.java?rev=595603&r1=595602&r2=595603&view=diff
==============================================================================
--- lenya/trunk/src/impl/java/org/apache/lenya/cms/publication/DocumentFactoryImpl.java (original)
+++ lenya/trunk/src/impl/java/org/apache/lenya/cms/publication/DocumentFactoryImpl.java Fri Nov 16 01:18:42 2007
@@ -29,6 +29,7 @@
import org.apache.lenya.cms.repository.RepositoryItem;
import org.apache.lenya.cms.repository.Session;
import org.apache.lenya.cms.site.SiteStructure;
+import org.apache.lenya.util.Assert;
/**
* A DocumentIdentityMap avoids the multiple instanciation of a document object.
@@ -178,7 +179,7 @@
* @throws DocumentBuildException if an error occurs.
*/
public boolean isDocument(String webappUrl) throws DocumentBuildException {
-
+ Assert.notNull("webapp URL", webappUrl);
PublicationManager pubMgr = getPubManager();
try {
URLInformation info = new URLInformation(webappUrl);
@@ -205,6 +206,10 @@
* @return A key.
*/
public String getKey(Publication publication, String area, String uuid, String language, int revision) {
+ Assert.notNull("publication", publication);
+ Assert.notNull("area", area);
+ Assert.notNull("uuid", uuid);
+ Assert.notNull("language", language);
return publication.getId() + ":" + area + ":" + uuid + ":" + language + ":" + revision;
}
@@ -214,6 +219,7 @@
* @return A key.
*/
public String getKey(String webappUrl) {
+ Assert.notNull("webapp URL", webappUrl);
try {
if (!isDocument(webappUrl)) {
throw new RuntimeException("No document for URL [" + webappUrl + "] found.");
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org