svn commit: r636074 - /lenya/trunk/src/modules/sitetree/java/src/org/apache/lenya/cms/site/tree2/TreeNodeImpl.java

[email protected]
Newsgroups gmane.comp.cms.lenya.cvs
Message-ID <[email protected]>
Author: rfrovarp
Date: Tue Mar 11 12:34:42 2008
New Revision: 636074

URL: http://svn.apache.org/viewvc?rev=636074&view=rev
Log:
Cache path results. A step in fixing performance problems in 44577.

Modified:
    lenya/trunk/src/modules/sitetree/java/src/org/apache/lenya/cms/site/tree2/TreeNodeImpl.java

Modified: lenya/trunk/src/modules/sitetree/java/src/org/apache/lenya/cms/site/tree2/TreeNodeImpl.java
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/sitetree/java/src/org/apache/lenya/cms/site/tree2/TreeNodeImpl.java?rev=636074&r1=636073&r2=636074&view=diff
==============================================================================
--- lenya/trunk/src/modules/sitetree/java/src/org/apache/lenya/cms/site/tree2/TreeNodeImpl.java (original)
+++ lenya/trunk/src/modules/sitetree/java/src/org/apache/lenya/cms/site/tree2/TreeNodeImpl.java Tue Mar 11 12:34:42 2008
@@ -43,6 +43,7 @@
 
     private TreeNode parent;
     private String name;
+    private String path;
 
     /**
      * A top level node.
@@ -133,8 +134,13 @@
         return (SiteNode) this.parent;
     }
 
-    public String getPath() {
-        return this.parent.getPath() + "/" + getName();
+    public String getPath() { 
+        if(path != null) {
+            return path;
+        }
+        String getPath = this.parent.getPath() + "/" + getName();
+        path = getPath;
+        return path;
     }
 
     public SiteStructure getStructure() {
@@ -165,6 +171,7 @@
 
     protected void changed() {
         getTree().changed();
+        this.path = null;
     }
 
     public SiteTreeNode[] getPrecedingSiblings() {
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.