JDK-4874079 : Allow fast applet download when using PropertyResourceBundles and Jar indexing
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.util:i18n
  • Affected Version: 1.4.1
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_2000
  • CPU: x86
  • Submitted: 2003-06-04
  • Updated: 2004-09-15
  • Resolved: 2004-09-15
Related Reports
Duplicate :  
Relates :  
Description

Name: gm110360			Date: 06/04/2003


A DESCRIPTION OF THE REQUEST :
The content of a Jar file can be subdivided into several Jar files using the Jar indexing mechanism. An advantage of this method is to diminuish the perceived download time for Java applets. If the applet use text (.properties) resource bundles, the ResourceBundle.getBundle() method first attempts to load a .class file, before searching for .properties files. That is, all the Jar files mentionned in the jar indexing will be downloaded to search for such class file (independently of their location in the directory tree).
This annihilates the first goal of the indexing that is to download only a small portion of the classes to minimize the perceived response time for the user.

I propose to overwrite the getBundle() methods for the subclass
PropertyResourceBundle in order to skip the first attempt to find a .class file.

JUSTIFICATION :
So far, the only choices I have left is to avoid the problem, is to use ListResourceBundle.
For this I would not want to write a dedicated ClassLoader.

The problem is not platform-specific nor JDK version specific.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Provide a way to skip the useless attempts in certain conditions.
ACTUAL -
getBundle iterates over the candidate bundle names to find the first one for which it can instantiate an actual resource bundle. For each candidate bundle name, it attempts to create a resource bundle:

First, it attempts to load a class using the candidate bundle name.

Otherwise, getBundle attempts to locate a property resource file.

CUSTOMER SUBMITTED WORKAROUND :
None.
(Review ID: 186985) 
======================================================================

Comments
EVALUATION Name: nl37777 Date: 06/04/2003 Similar problem as 4812194, but a different proposed solution. ====================================================================== Closing this RFE as a duplicate of 4303146. ###@###.### 2004-09-15
15-09-2004