#2 Program crashes when unsupported locale is set

closed
nobody
None
5
2012-10-05
2012-03-30
Anonymous
No

If any but supported locale is set, program crashes with MissingResourceException. This seems to be caused by getBundle() call witch fails to find Bundle file for system locale and no fallback being used.

Exception in thread "AWT-EventQueue-0" java.util.MissingResourceException: Can't find bundle for base name Bundle, locale pl_PL
at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1499)
at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1322)
at java.util.ResourceBundle.getBundle(ResourceBundle.java:724)
at GUI.<init>(GUI.java:37)
at GUI$15.run(GUI.java:616)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:705)
at java.awt.EventQueue.access$000(EventQueue.java:101)
at java.awt.EventQueue$3.run(EventQueue.java:666)
at java.awt.EventQueue$3.run(EventQueue.java:664)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:675)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

I'm providing patch wich solves this by adding try...catch block wich loads english bundle if normal getBundle() fails.

Discussion

  • kom
    kom
    2012-10-05

    Sorry for my delayed answer. Your patch was useful. The bug should have been fixed. Thanks!

     
  • kom
    kom
    2012-10-05

    • status: open --> closed