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.");
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.