maven-doxia-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ltheu...@apache.org
Subject svn commit: r1092010 - /maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/main/java/org/apache/maven/doxia/site/decoration/inheritance/DefaultDecorationModelInheritanceAssembler.java
Date Thu, 14 Apr 2011 05:43:45 GMT
Author: ltheussl
Date: Thu Apr 14 05:43:45 2011
New Revision: 1092010

URL: http://svn.apache.org/viewvc?rev=1092010&view=rev
Log:
don't modify loop variables

Modified:
    maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/main/java/org/apache/maven/doxia/site/decoration/inheritance/DefaultDecorationModelInheritanceAssembler.java

Modified: maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/main/java/org/apache/maven/doxia/site/decoration/inheritance/DefaultDecorationModelInheritanceAssembler.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/main/java/org/apache/maven/doxia/site/decoration/inheritance/DefaultDecorationModelInheritanceAssembler.java?rev=1092010&r1=1092009&r2=1092010&view=diff
==============================================================================
--- maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/main/java/org/apache/maven/doxia/site/decoration/inheritance/DefaultDecorationModelInheritanceAssembler.java
(original)
+++ maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/main/java/org/apache/maven/doxia/site/decoration/inheritance/DefaultDecorationModelInheritanceAssembler.java
Thu Apr 14 05:43:45 2011
@@ -231,20 +231,22 @@ public class DefaultDecorationModelInher
         int topCounter = 0;
         for ( Menu menu : parentMenus )
         {
-            menu = menu.clone();
-
             if ( "top".equals( menu.getInherit() ) )
             {
-                menus.add( topCounter, menu );
-                topCounter++;
+                final Menu clone = menu.clone();
 
-                rebaseMenuPaths( menu.getItems(), urlContainer );
+                rebaseMenuPaths( clone.getItems(), urlContainer );
+
+                menus.add( topCounter, clone );
+                topCounter++;
             }
             else if ( "bottom".equals( menu.getInherit() ) )
             {
-                menus.add( menu );
+                final Menu clone = menu.clone();
 
-                rebaseMenuPaths( menu.getItems(), urlContainer );
+                rebaseMenuPaths( clone.getItems(), urlContainer );
+
+                menus.add( clone );
             }
         }
 
@@ -298,13 +300,13 @@ public class DefaultDecorationModelInher
 
         for ( LinkItem item : parentList )
         {
-            item = item.clone();
-
-            rebaseLinkItemPaths( item, urlContainer );
-
             if ( !items.contains( item ) )
             {
-                items.add( item );
+                final LinkItem clone = item.clone();
+
+                rebaseLinkItemPaths( clone, urlContainer );
+
+                items.add( clone );
             }
         }
 
@@ -326,14 +328,14 @@ public class DefaultDecorationModelInher
 
         for ( Logo logo : parentList )
         {
-            logo = logo.clone();
-
             if ( !logos.contains( logo ) )
             {
-                logos.add( logo );
-            }
+                final Logo clone = logo.clone();
 
-            rebaseLogoPaths( logo, urlContainer );
+                rebaseLogoPaths( clone, urlContainer );
+
+                logos.add( clone );
+            }
         }
 
         for ( Logo logo : childList )



Mime
View raw message