svn commit: r571137 - /lenya/trunk/src/java/org/apache/lenya/cms/publication/DocumentLocator.java
[email protected] Thu, 30 Aug 2007 12:38:04 -0000
Newsgroups
gmane.comp.cms.lenya.cvs
Message-ID
<[email protected] >
Author: andreas
Date: Thu Aug 30 05:38:03 2007
New Revision: 571137
URL: http://svn.apache.org/viewvc?rev=571137&view=rev
Log:
Avoid returning null-value DocumentLocator objects
Modified:
lenya/trunk/src/java/org/apache/lenya/cms/publication/DocumentLocator.java
Modified: lenya/trunk/src/java/org/apache/lenya/cms/publication/DocumentLocator.java
URL: http://svn.apache.org/viewvc/lenya/trunk/src/java/org/apache/lenya/cms/publication/DocumentLocator.java?rev=571137&r1=571136&r2=571137&view=diff
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/publication/DocumentLocator.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/publication/DocumentLocator.java Thu Aug 30 05:38:03 2007
@@ -38,10 +38,8 @@
*/
public static DocumentLocator getLocator(String pubId, String area, String path, String language) {
String key = DocumentLocator.getKey(pubId, area, path, language);
- DocumentLocator locator = null;
- if (locators.containsKey(key)) {
- locator = (DocumentLocator) locators.get(key);
- } else {
+ DocumentLocator locator = (DocumentLocator) locators.get(key);
+ if (locator == null) {
locator = new DocumentLocator(pubId, area, path, language);
locators.put(key, locator);
}