You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by vs...@apache.org on 2009/08/09 14:03:47 UTC

svn commit: r802527 - /maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/PdfMojo.java

Author: vsiveton
Date: Sun Aug  9 12:03:47 2009
New Revision: 802527

URL: http://svn.apache.org/viewvc?rev=802527&view=rev
Log:
o using getDefaultLocale()

Modified:
    maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/PdfMojo.java

Modified: maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/PdfMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/PdfMojo.java?rev=802527&r1=802526&r2=802527&view=diff
==============================================================================
--- maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/PdfMojo.java (original)
+++ maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/PdfMojo.java Sun Aug  9 12:03:47 2009
@@ -196,6 +196,18 @@
     private boolean aggregate;
 
     /**
+     * The current version of this plugin.
+     *
+     * @parameter default-value="${plugin.version}"
+     * @readonly
+     */
+    private String pluginVersion;
+
+    // ----------------------------------------------------------------------
+    // Instance fields
+    // ----------------------------------------------------------------------
+
+    /**
      * Document Renderer.
      */
     private DocumentRenderer docRenderer;
@@ -210,14 +222,6 @@
      */
     private DecorationModel defaultDecorationModel;
 
-    /**
-     * The current version of this plugin.
-     *
-     * @parameter default-value="${plugin.version}"
-     * @readonly
-     */
-    private String pluginVersion;
-
     // ----------------------------------------------------------------------
     // Public methods
     // ----------------------------------------------------------------------
@@ -285,9 +289,7 @@
     {
         final List localesList = siteTool.getAvailableLocales( locales );
 
-        // Default is first in the list
-        this.defaultLocale = (Locale) localesList.get( 0 );
-        Locale.setDefault( defaultLocale );
+        Locale.setDefault( getDefaultLocale() );
 
         for ( final Iterator iterator = localesList.iterator(); iterator.hasNext(); )
         {
@@ -296,7 +298,7 @@
             final File workingDir = getWorkingDirectory( locale );
 
             File siteDirectoryFile = siteDirectory;
-            if ( !locale.getLanguage().equals( defaultLocale.getLanguage() ) )
+            if ( !locale.getLanguage().equals( getDefaultLocale().getLanguage() ) )
             {
                 siteDirectoryFile = new File( siteDirectory, locale.getLanguage() );
             }
@@ -357,8 +359,8 @@
 
         model.getMeta().setGenerator( getDefaultGenerator() );
         model.getMeta().setLanguage( locale.getLanguage() );
-        model.getCover().setCoverType( i18n.getString( "pdf-plugin", defaultLocale, "toc.type" ) );
-        model.getToc().setName( i18n.getString( "pdf-plugin", defaultLocale, "toc.title" ) );
+        model.getCover().setCoverType( i18n.getString( "pdf-plugin", getDefaultLocale(), "toc.type" ) );
+        model.getToc().setName( i18n.getString( "pdf-plugin", getDefaultLocale(), "toc.title" ) );
 
         debugLogGeneratedModel( model );
 
@@ -412,7 +414,7 @@
      */
     private File getWorkingDirectory( Locale locale )
     {
-        if ( locale.getLanguage().equals( defaultLocale.getLanguage() ) )
+        if ( locale.getLanguage().equals( getDefaultLocale().getLanguage() ) )
         {
             return workingDirectory;
         }