On 2010-12-19 16:25, Lukas Theussl wrote: > > > Dennis Lundberg wrote: >> On 2010-12-19 10:52, [email protected] wrote: >>> Author: ltheussl >>> Date: Sun Dec 19 09:52:24 2010 >>> New Revision: 1050782 >>> >>> URL: http://svn.apache.org/viewvc?rev=1050782&view=rev >>> Log: >>> remove pointless if >>> >>> Modified: >>> >>> maven/shared/trunk/maven-doxia-tools/src/main/java/org/apache/maven/doxia/tools/DefaultSiteTool.java >>> >>> >>> Modified: >>> maven/shared/trunk/maven-doxia-tools/src/main/java/org/apache/maven/doxia/tools/DefaultSiteTool.java >>> >>> URL: >>> http://svn.apache.org/viewvc/maven/shared/trunk/maven-doxia-tools/src/main/java/org/apache/maven/doxia/tools/DefaultSiteTool.java?rev=1050782&r1=1050781&r2=1050782&view=diff >>> >>> ============================================================================== >>> >>> --- >>> maven/shared/trunk/maven-doxia-tools/src/main/java/org/apache/maven/doxia/tools/DefaultSiteTool.java >>> (original) >>> +++ >>> maven/shared/trunk/maven-doxia-tools/src/main/java/org/apache/maven/doxia/tools/DefaultSiteTool.java >>> Sun Dec 19 09:52:24 2010 >>> @@ -1312,15 +1312,12 @@ public class DefaultSiteTool >>> */ >>> private void populateModulesMenuItemsFromModels( MavenProject >>> project, List<Model> models, Menu menu ) >>> { >>> - if ( models != null&& models.size()> 1 ) >> >> I'm not sure why it does what it does, but when you remove the above >> line you alter the behavior. Note the "models.size()> 1" part - it is >> not "models.size()> 0". > > I'm aware of that. This commit should have been part of r1049019 where I > removed a line "if ( projects.size() == 1 )", which means that the first > module in the list was always populated from the model, and the rest > from the reactor projects (a logic I don't understand). Since now all > modules are populated from the model, I have to include that first in > the loop below.
No problem then. I just wanted to make sure it was intentional. > I have checked that it works for the cases I'm working on, I will try to > add some test cases though (there aren't any yet), if you find something > broken, just yell at me! > > -Lukas > > > [1] http://svn.apache.org/viewvc?view=revision&revision=1049019 > >> >>> + for ( Model model : models ) >>> { >>> - for ( Model model : models ) >>> - { >>> - String reactorUrl = model.getUrl(); >>> - String name = model.getName(); >>> + String reactorUrl = model.getUrl(); >>> + String name = model.getName(); >>> >>> - appendMenuItem( project, menu, name, reactorUrl, >>> model.getArtifactId() ); >>> - } >>> + appendMenuItem( project, menu, name, reactorUrl, >>> model.getArtifactId() ); >>> } >>> } >>> >>> >>> >>> >> >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > -- Dennis Lundberg --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
