Author: andreas
Date: Thu Jan 31 13:32:38 2008
New Revision: 617244
URL: http://svn.apache.org/viewvc?rev=617244&view=rev
Log:
Add assertions to AreaImpl.contains(), return false if uuid or area are empty strings.
Modified:
lenya/trunk/src/impl/java/org/apache/lenya/cms/publication/AreaImpl.java
Modified: lenya/trunk/src/impl/java/org/apache/lenya/cms/publication/AreaImpl.java
URL: http://svn.apache.org/viewvc/lenya/trunk/src/impl/java/org/apache/lenya/cms/publication/AreaImpl.java?rev=617244&r1=617243&r2=617244&view=diff
==============================================================================
--- lenya/trunk/src/impl/java/org/apache/lenya/cms/publication/AreaImpl.java (original)
+++ lenya/trunk/src/impl/java/org/apache/lenya/cms/publication/AreaImpl.java Thu Jan 31 13:32:38 2008
@@ -30,6 +30,7 @@
import org.apache.lenya.cms.site.SiteManager;
import org.apache.lenya.cms.site.SiteNode;
import org.apache.lenya.cms.site.SiteStructure;
+import org.apache.lenya.util.Assert;
/**
* Area implementation.
@@ -56,6 +57,11 @@
}
public boolean contains(String uuid, String language) {
+ Assert.notNull("uuid", uuid);
+ Assert.notNull("language", language);
+ if (uuid.equals("") || language.equals("")) {
+ return false;
+ }
// check site structure first (performance)
if (getSite().containsByUuid(uuid, language)) {
return true;
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.