From 61b7fe600d90d9c51e3a4cc6e3c9a6f7f2f296a1 Mon Sep 17 00:00:00 2001 From: Vincent Siveton Date: Thu, 20 Oct 2005 11:29:20 +0000 Subject: [PATCH] MNG-1216: Move code part to sort projectInfos and projectReports with the default locale setted git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@326890 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/maven/plugins/site/SiteMojo.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/maven-plugins/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/SiteMojo.java b/maven-plugins/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/SiteMojo.java index 0188a322c7..7be5dc5780 100644 --- a/maven-plugins/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/SiteMojo.java +++ b/maven-plugins/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/SiteMojo.java @@ -221,8 +221,6 @@ public class SiteMojo List reports = filterReports( this.reports ); Map categories = categorizeReports( reports ); - - Comparator reportComparator = new ReportComparator(); List projectInfos = (List) categories.get( MavenReport.CATEGORY_PROJECT_INFORMATION ); List projectReports = (List) categories.get( MavenReport.CATEGORY_PROJECT_REPORTS ); @@ -236,9 +234,6 @@ public class SiteMojo projectReports = Collections.EMPTY_LIST; } - Collections.sort( projectInfos, reportComparator ); - Collections.sort( projectReports, reportComparator ); - try { List localesList = initLocalesList(); @@ -251,6 +246,12 @@ public class SiteMojo Locale defaultLocale = (Locale) localesList.get( 0 ); Locale.setDefault( defaultLocale ); + // Sort projectInfos and projectReports with the default locale setted + // TODO Beautify the output by sorting with each current locale + Comparator reportComparator = new ReportComparator(); + Collections.sort( projectInfos, reportComparator ); + Collections.sort( projectReports, reportComparator ); + for ( Iterator iterator = localesList.iterator(); iterator.hasNext(); ) { Locale locale = (Locale) iterator.next(); @@ -411,7 +412,7 @@ public class SiteMojo filteredReports.add( report ); } } - // the canGenerateReport() has been added just before the 2.0 release and will cause all the reporting + // the canGenerateReport() has been added just before the 2.0 release and will cause all the reporting // plugins with an earlier version to fail (most of the codehaus mojo now fails) // be nice with them, output a warning and don't let them break anything catch ( AbstractMethodError e )