You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by rf...@apache.org on 2008/03/11 20:34:46 UTC
svn commit: r636074 -
/lenya/trunk/src/modules/sitetree/java/src/org/apache/lenya/cms/site/tree2/TreeNodeImpl.java
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() {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org