svn commit: r571137 - /lenya/trunk/src/java/org/apache/lenya/cms/publication/DocumentLocator.java

[email protected]
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);
         }
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.