[ http://jira.codehaus.org/browse/MNG-1216?page=comments#action_48693 ] 

fabrizio giustina commented on MNG-1216:
----------------------------------------

having a bundle without a specific locale is the standard way to set a default 
for a resource bundle in java.

>From java.util.ResourceBundle javadocs:

getBundle uses the base name, the specified locale, and the default locale 
(obtained from Locale.getDefault) to generate a sequence of candidate bundle 
names. If the specified locale's language, country, and variant are all empty 
strings, then the base name is the only candidate bundle name. Otherwise, the 
following sequence is generated from the attribute values of the specified 
locale (language1, country1, and variant1) and of the default locale 
(language2, country2, and variant2):
    * baseName + "_" + language1 + "_" + country1 + "_" + variant1
    * baseName + "_" + language1 + "_" + country1
    * baseName + "_" + language1
    * baseName + "_" + language2 + "_" + country2 + "_" + variant2
    * baseName + "_" + language2 + "_" + country2
    * baseName + "_" + language2
    * baseName
 
 --

> From my point of view, it is the contract of the site plugin to find the best 
> bundle. 

IMHO, since the plugin uses a java ResourceBundle, it is the contract of  
ResourceBundle  to find the best bundle. I can't see any reason why the plugin 
should duplicate this logic.
Thoughts?






> CimReport.getBundle throws exception when locale doesn't have bundle
> --------------------------------------------------------------------
>
>          Key: MNG-1216
>          URL: http://jira.codehaus.org/browse/MNG-1216
>      Project: Maven 2
>         Type: Bug
>   Components: maven-project-info-reports-plugin
>     Versions: 2.0 (RC)
>     Reporter: Carlos Sanchez
>     Assignee: fabrizio giustina
>      Fix For: 2.0
>  Attachments: diff.txt
>
>
> This may happen for each locale different then fr and en.
> [INFO] [site:site]
> [INFO] 
> ----------------------------------------------------------------------------
> [ERROR] FATAL ERROR
> [INFO] 
> ----------------------------------------------------------------------------
> [INFO] Can't find bundle for base name project-info-report, locale es_ES
> [INFO] 
> ----------------------------------------------------------------------------
> [INFO] Trace
> java.util.MissingResourceException: Can't find bundle for base name 
> project-info-report, locale es_ES
>         at 
> java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:837)
>         at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:806)
>         at java.util.ResourceBundle.getBundle(ResourceBundle.java:700)
>         at 
> org.apache.maven.report.projectinfo.CimReport.getBundle(CimReport.java:260)
>         at 
> org.apache.maven.report.projectinfo.CimReport.getName(CimReport.java:80)
>         at 
> org.apache.maven.plugins.site.ReportComparator.compare(ReportComparator.java:40)
>         at java.util.Arrays.mergeSort(Arrays.java:1284)
>         at java.util.Arrays.mergeSort(Arrays.java:1295)
>         at java.util.Arrays.sort(Arrays.java:1223)
>         at java.util.Collections.sort(Collections.java:159)
>         at org.apache.maven.plugins.site.SiteMojo.execute(SiteMojo.java:239)
>         at 
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:399)
>         at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:519)
>         at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:469)
>         at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:448)
>         at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:301)
>         at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:268)
>         at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:137)
>         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:316)
>         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:113)
>         at org.apache.maven.cli.MavenCli.main(MavenCli.java:249)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>         at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>         at 
> org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>         at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> [INFO] 
> ----------------------------------------------------------------------------
> [INFO] Total time: 16 seconds
> [INFO] Finished at: Sat Oct 15 14:52:35 PDT 2005
> [INFO] Final Memory: 6M/11M
> [INFO] 
> ----------------------------------------------------------------------------

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to