Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 216575 - [Trace Project] Remove duplicate/unused messages
Summary: [Trace Project] Remove duplicate/unused messages
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: TPTP (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Ritwik Lodhiya CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 212039 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-01-25 07:54 EST by Paul Slauenwhite CLA
Modified: 2016-05-05 11:06 EDT (History)
4 users (show)

See Also:
ewchan: review-


Attachments
Patch to remove all unused Strings (152.43 KB, patch)
2008-01-30 09:43 EST, Ritwik Lodhiya CLA
no flags Details | Diff
Removed Strings Log (37.05 KB, text/plain)
2008-01-30 09:45 EST, Ritwik Lodhiya CLA
no flags Details
patch (18.12 KB, patch)
2008-03-03 11:53 EST, Eugene Chan CLA
no flags Details | Diff
Updated Patch (27.64 KB, patch)
2008-03-03 13:09 EST, Ritwik Lodhiya CLA
no flags Details | Diff
Patch #2 (22.10 KB, patch)
2008-03-05 13:41 EST, Ritwik Lodhiya CLA
no flags Details | Diff
Patch #3 (22.10 KB, patch)
2008-03-11 14:17 EDT, Ritwik Lodhiya CLA
no flags Details | Diff
Patch #3.1 (19.30 KB, patch)
2008-03-11 15:37 EDT, Ritwik Lodhiya CLA
no flags Details | Diff
updated patch (19.30 KB, patch)
2008-03-11 16:13 EDT, Eugene Chan CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Slauenwhite CLA 2008-01-25 07:54:12 EST
[Trace Project] Remove duplicate/unused messages

In preparation for 4.5 translation, remove unused messages from resource bundles to reduce translation costs.

Note: This defect should be completed before the first 4.5 translation drop.

To find the duplicate/unused messages in resource bundles located in the source tree(s) of a plug-in: 

<right click the plug-in> >> Source >> File broken externalize strings.

The unused messages in plugin.properties resource bundle for all of the Trace Project plug-ins: 

Note: The plugin.properties resource bundle should only contain messages for the this plug-in's MANIFEST.MF and plugin.xml files.  If the plugin.properties resource bundle contains messages used in the source tree(s) of a plug-in, those messages need to me moved to a resource bundle located in the source tree of a plug-in using the Eclipse 3.1 message bundle format (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=127273#c0). 

org.eclipse.hyades.trace.views:
  59
  7
  5
  60

org.eclipse.tptp.trace.api.doc.isv:
  plugin.provider

org.eclipse.tptp.trace.arm.ui:
  ARM_ANALYSIS_DESC

org.eclipse.tptp.trace.doc.isv:
  14
  13
  29
  30

org.eclipse.tptp.trace.examples.isv:
  28
  27
  26
  25
  20
  9
  8
  19
  7
  18
  6
  17
  5
  16
  15
  47
  46
  45
  1
  12
  44
  11
  43
  10
  42
  41
  40
  39
  38
  37
  36
  35
  34
  33
  32
  31

org.eclipse.tptp.trace.jvmti.client:
  JVMTI_ANALYSIS_TYPE_TOOLTIP_THRD_STATES
  JVMTI_ANALYSIS_TYPE_VIEW_THRD_STATES
  JVMTI_ANALYSIS_TYPE_TOOLTIP_CALL_STACK
  JVMTI_ANALYSIS_TYPE_VIEW_HEAP
Comment 1 Ritwik Lodhiya CLA 2008-01-30 09:43:50 EST
Created attachment 88270 [details]
Patch to remove all unused Strings
Comment 2 Ritwik Lodhiya CLA 2008-01-30 09:45:24 EST
Created attachment 88271 [details]
Removed Strings Log

This log keeps record of all the removed strings.
Comment 3 Eugene Chan CLA 2008-03-03 11:14:06 EST
(In reply to comment #1)
> Created an attachment (id=88270) [details]
> Patch to remove all unused Strings 
> 

Ritwik, the patch does not apply to the latest CVS HEAD code. Some files does not exist anymore. Would you please synchronize with the lastest CVS code and make sure your patch is up-to-dated? Thanks.
Comment 4 Eugene Chan CLA 2008-03-03 11:53:10 EST
Created attachment 91391 [details]
patch

Ritwik, I use your patch named 216576patch_trace.txt in bug 216576 as a base and created a more updated patch. It does not include any non-messages related changes (eg .project file) in it. 

However, I see the following problem in your patch:

FILE : /org.eclipse.tptp.trace.arm/src-arm-core/org/eclipse/tptp/trace/arm/internal/ArmMessages.properties
Following strings are used in the code but removed in your patch.
InputParameter_NotNull_ERROR_=IWAT0508E Input parameter {0} cannot be null.
InputParameter_NoBlanks_ERROR_=IWAT0509E The {0} cannot contain trailing blank characters.
InputParameter_IndexOutOfBounds_ERROR_=IWAT0510E The {0} array has been accessed with an illegal index.
InputParameter_LengthNotMatch_ERROR_=IWAT0511E The {0} is restricted to a maximum length of {1} characters and must not be zero-length.
InputParameter_ArmProperty_Reserved_ERROR_=IWAT0512E According to the OpenGroup ARM Specification, an ArmProperty may not be prefixed with 'ARM:'.  This is reserved for the ARM specification.
InputParameter_ArmIdentityProperties_LenghtNotMatch_ERROR_=IWAT0513E The length of the values must match the length of the provided names in order to associate the two data sets.
InputParameter_ArmIdentityProperties_IndexNotInRange_ERROR_=IWAT0514E Index not in range of size of array {0} object.
InputParameter_TPTPArmCorrelator_TypeNotMatch_Current_ERROR_=IWAT0515E The current correlator must be an instance of TPTPArmCorrelator.  Instance of {0} was found.
InputParameter_TPTPArmCorrelator_TypeNotMatch_Parent_ERROR_=IWAT0516E The parent correlator must be an instance of TPTPArmCorrelator.  Instance of {0} was found.


FILE: /org.eclipse.tptp.trace.memory.ui/src/org/eclipse/tptp/trace/memory/internal/views/Messages.java
compile failure in the removal of strings
Comment 5 Ritwik Lodhiya CLA 2008-03-03 13:09:02 EST
Created attachment 91401 [details]
Updated Patch

I have redone the patch. I think this one should work better than the previous one.
Comment 6 Eugene Chan CLA 2008-03-03 13:34:26 EST
(In reply to comment #5)
> Created an attachment (id=91401) [details]
> Updated Patch
> 
> I have redone the patch. I think this one should work better than the previous
> one. 
> 

Ritwik.
You have removed the following strings under file
FILE :
/org.eclipse.tptp.trace.arm/src-arm-core/org/eclipse/tptp/trace/arm/internal/ArmMessages.properties

which is used in the Java code. Do a search within workspace and you should see how they are used:

eg. InputParameter_NotNull_ERROR_ is used in 
org.eclipse.tptp.trace.arm.internal.transaction.ArmApplicationDefinitionImpl.validateName(String)

InputParameter_NotNull_ERROR_=IWAT0508E Input parameter {0} cannot be null.
InputParameter_NoBlanks_ERROR_=IWAT0509E The {0} cannot contain trailing blank characters.
InputParameter_IndexOutOfBounds_ERROR_=IWAT0510E The {0} array has been accessed with an illegal index.
InputParameter_LengthNotMatch_ERROR_=IWAT0511E The {0} is restricted to a maximum length of {1} characters and must not be zero-length.
InputParameter_ArmProperty_Reserved_ERROR_=IWAT0512E According to the OpenGroup ARM Specification, an ArmProperty may not be prefixed with 'ARM:'.  This is reserved for the ARM specification.
InputParameter_ArmIdentityProperties_LenghtNotMatch_ERROR_=IWAT0513E The length of the values must match the length of the provided names in order to associate the two data sets.
InputParameter_ArmIdentityProperties_IndexNotInRange_ERROR_=IWAT0514E Index not in range of size of array {0} object.
InputParameter_TPTPArmCorrelator_TypeNotMatch_Current_ERROR_=IWAT0515E The current correlator must be an instance of TPTPArmCorrelator.  Instance of {0} was found.
InputParameter_TPTPArmCorrelator_TypeNotMatch_Parent_ERROR_=IWAT0516E The parent correlator must be an instance of TPTPArmCorrelator.  Instance of {0} was found.

and same compilation errors in 
org.eclipse.tptp.trace.memory.internal.views.Messages
Comment 7 Eugene Chan CLA 2008-03-03 13:35:56 EST
Also the messages under org.eclipse.tptp.trace.report.birt.ui.internal.Messages.java that are removed in your patch are actually used by the template (please read the comment in the file for detail).
Comment 8 Ritwik Lodhiya CLA 2008-03-05 13:41:31 EST
Created attachment 91682 [details]
Patch #2

I believe this patch should do the cleanup better than the previous ones. I had checked all strings before deleting them to ensure nothing got deleted that was being used. =)
Comment 9 Eugene Chan CLA 2008-03-10 17:30:32 EDT
Ritwik,

1. In org.eclipse.tptp.trace.jvmti.internal.client.views.UIMessages.java
_Not_Started
is removed, but its corresponding entry in
org.eclipse.tptp.trace.jvmti.client/src/org/eclipse/tptp/trace/jvmti/internal/client/views/messages.properties
is not removed.

2. Similar problem happens in 
/org.eclipse.hyades.trace.views/src/org/eclipse/hyades/trace/views/internal/messages.properties
and
org.eclipse.hyades.trace.views.internal.TraceUIMessages.java


3. In /org.eclipse.tptp.trace.arm/src-arm-core/org/eclipse/tptp/trace/arm/internal/ArmMessages.properties
ARM_ERROR_MESSAGE_-6=IWAT0517E The current application instance has halted.  The application had ended.
ARM_ERROR_MESSAGE_-7=IWAT0518E ArrayIndexOutOfBoundsException indicates that an array has been accessed with an illegal index. The index is either negative or greater than or equal to the size of the array. 
ARM_ERROR_MESSAGE_-8=IWAT0519E Attempting to start a subtransaction where the parent correlator is null.
ARM_ERROR_MESSAGE_-9=IWAT0520E The client is not yet monitoring the data collection agent.  Cannot start the transaction.
ARM_ERROR_MESSAGE_-10=IWAT0521E IllegalArgumentException indicates that a method has been passed an illegal or inappropriate argument.
ARM_ERROR_MESSAGE_-11=IWAT0522E UnknownHostException indicates that the IP address of a host could not be determined.
ARM_ERROR_MESSAGE_-12=IWAT0523E NullPointerException indicates the application attempted to use null where an object is required.
ARM_ERROR_MESSAGE_-13=IWAT0524E QueueClosedException indicates that a queue has been closed. Unable to add the new ARM transaction to the Tranasaction Manager.
ARM_ERROR_MESSAGE_-14=IWAT0525E Unable to use reflection to determine the ARM Interface and ARM Method that observed an error.
are build on runtime, please read the comment in the file for detail. They should be kept.
Comment 10 Ritwik Lodhiya CLA 2008-03-11 14:17:21 EDT
Created attachment 92213 [details]
Patch #3

Hope this works :)
Comment 11 Ritwik Lodhiya CLA 2008-03-11 15:37:29 EDT
Created attachment 92217 [details]
Patch #3.1

Please disregard the previous patch, I accidently uploaded the wrong patch :(
Comment 12 Eugene Chan CLA 2008-03-11 16:13:58 EDT
Created attachment 92226 [details]
updated patch

attached patch is committed to HEAD.
Comment 13 Eugene Chan CLA 2008-03-11 16:14:44 EDT
bug fixed.
Comment 14 jkubasta CLA 2008-03-14 10:00:19 EDT
*** Bug 212039 has been marked as a duplicate of this bug. ***
Comment 15 Paul Slauenwhite CLA 2008-06-10 11:55:55 EDT
Verified in CVS (HEAD).  Closing.