Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 127273 - Convert plugins to Eclipse 3.1 message bundle format
Summary: Convert plugins to Eclipse 3.1 message bundle format
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: TPTP (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Valentina Popescu CLA
QA Contact:
URL:
Whiteboard: closed460
Keywords:
Depends on: 127277 127278 127280 127281
Blocks:
  Show dependency tree
 
Reported: 2006-02-10 10:52 EST by Valentina Popescu CLA
Modified: 2016-05-05 10:58 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Valentina Popescu CLA 2006-02-10 10:52:15 EST
Standard Java ResourceBundles have quite inefficient space characteristics. Since a running Eclipse tends to have many externalized messages, the eclipse team has implemented a new message bundle to be used starting with Eclipse 3.1.

For more information go to http://dev.eclipse.org/viewcvs/index.cgi/platform-core-home/documents/3.1/message_bundles.html?rev=1.9

Note that Eclipse provides an automated tool that generates the new message bundle from the existing one. The steps are defined in the above page link, under the Tools Conversion section.

These are the steps for moving to the new bundle ( the conversion tool would cover steps 1-3 ):

1.Identify the strings in plugin.properties that are not used in the plugin.xml file

2. Create one or more message.properties files per plugin, to store these strings

3. For each message.properties file, you should define a peer Message java class that will be used to retrieve the string

4. Optionally- but a great improvement if this is done- update the string key to a short string
Example:

Old key:
LOG_COMPONENT_IDENTIFICATION_INVALID_LOCATION_TYPE_EXC_ = IWAT0212E The component identification with component named [{0}] has an invalid location type: [{1}] 
New key:
_1 = IWAT0212E The component identification with component named [{0}] has an invalid location type: [{1}]

Code sample:

package org.eclipse.hyades.logging.adapter.ui.internal.util;
import org.eclipse.osgi.util.NLS;

public final class AdapterUIMessages extends NLS {

 private static final String BUNDLE_NAME = "org.eclipse.hyades.logging.adapter.ui.internal.util.messages";//$NON-NLS-1$

 private UIMessages() {
  // Do not instantiate
 }

 public static String _1;
 public static String _2;

 static {
  NLS.initializeMessages(BUNDLE_NAME, UIMessages.class);
 }
}

messages.properties:
_1   = &Timezone GMT offset:
_2   = &Log file creation date for file {0}:


Old code:
public class MyClass {
   public void myMethod() {
      String message;
      ...
Comment 1 Valentina Popescu CLA 2006-02-10 11:10:49 EST
This is the main feature that groups together all defects opened on this subject

Separate defects have been opened for every TPTP project; this defect will be closed when all these four defects will be closed
Comment 2 Valentina Popescu CLA 2006-03-29 10:00:16 EST
closed as fixed
Comment 3 Paul Slauenwhite CLA 2009-06-30 13:42:11 EDT
As of TPTP 4.6.0, TPTP is in maintenance mode and focusing on improving quality by resolving relevant enhancements/defects and increasing test coverage through test creation, automation, Build Verification Tests (BVTs), and expanded run-time execution. As part of the TPTP Bugzilla housecleaning process (see http://wiki.eclipse.org/Bugzilla_Housecleaning_Processes), this enhancement/defect is verified/closed by the Project Lead since this enhancement/defect has been resolved and unverified for more than 1 year and considered to be fixed. If this enhancement/defect is still unresolved and reproducible in the latest TPTP release (http://www.eclipse.org/tptp/home/downloads/), please re-open.
Comment 4 Paul Slauenwhite CLA 2009-06-30 13:49:25 EDT
As of TPTP 4.6.0, TPTP is in maintenance mode and focusing on improving quality by resolving relevant enhancements/defects and increasing test coverage through test creation, automation, Build Verification Tests (BVTs), and expanded run-time execution. As part of the TPTP Bugzilla housecleaning process (see http://wiki.eclipse.org/Bugzilla_Housecleaning_Processes), this enhancement/defect is verified/closed by the Project Lead since this enhancement/defect has been resolved and unverified for more than 1 year and considered to be fixed. If this enhancement/defect is still unresolved and reproducible in the latest TPTP release (http://www.eclipse.org/tptp/home/downloads/), please re-open.