Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 127281

Summary: Convert plugins to Eclipse 3.1 message bundle format
Product: z_Archived Reporter: Valentina Popescu <popescu>
Component: TPTP.monitoringAssignee: Dave Smith <smith>
Status: CLOSED FIXED QA Contact:
Severity: major    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: closed460
Bug Depends on: 131731    
Bug Blocks: 127273    

Description Valentina Popescu CLA 2006-02-10 11:08:19 EST
This defect is opened to deal with all Monitoring plugins; please open point defects if required for the Monitoring project plugin owners

The defect that groups together all defects on this subject is 127273

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 Dave Smith CLA 2006-02-15 17:25:43 EST
Plugins packaged in RAC and as standalone entities (eg. GLA) probably cannot be converted.  So this will likely only affect UI plugins which may already have been converted.  Will investigate this further in iteration 2.
Comment 2 Dave Smith CLA 2006-03-29 09:55:50 EST
131731 was the only point defect that required fixing.  The GLA plugins cannot be converted to use message bundles because they are packaged as standalone run-time components that do no have access to the Eclipse plugins.

Since 131731 has been fixed I will close this top level bugzilla.
Comment 3 Paul Slauenwhite CLA 2009-06-30 12:20:49 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.