Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 314476 - [NLS] ConsoleLog: NLS unused message entries in log while running JEE automated smoke
Summary: [NLS] ConsoleLog: NLS unused message entries in log while running JEE automat...
Status: RESOLVED FIXED
Alias: None
Product: WTP Java EE Tools
Classification: WebTools
Component: jst.j2ee (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2 RC3   Edit
Assignee: Hari Shankar CLA
QA Contact: Chuck Bridgham CLA
URL:
Whiteboard: PMC_approved
Keywords:
Depends on:
Blocks: 314883
  Show dependency tree
 
Reported: 2010-05-26 10:51 EDT by Hari Shankar CLA
Modified: 2010-05-28 10:32 EDT (History)
4 users (show)

See Also:
david_williams: pmc_approved+
hshanka: pmc_approved? (raghunathan.srinivasan)
hshanka: pmc_approved? (naci.dai)
deboer: pmc_approved+
hshanka: pmc_approved? (neil.hauge)
hshanka: pmc_approved? (kaloyan)
cbridgha: review+


Attachments
patch (1.11 KB, patch)
2010-05-26 10:51 EDT, Hari Shankar CLA
ccc: iplog+
Details | Diff
updated patch (3.61 KB, patch)
2010-05-27 16:06 EDT, Hari Shankar CLA
ccc: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Hari Shankar CLA 2010-05-26 10:51:02 EDT
Build Identifier: 32

Following msgs are seen in the log:
!ENTRY org.eclipse.osgi 2 1 2010-05-21 13:22:34.557
!MESSAGE NLS unused message: CustomWebProjectReferenceWizardFragment.0 in: org.eclipse.jst.servlet.ui.internal.messages

!ENTRY org.eclipse.osgi 2 1 2010-05-21 13:22:34.573
!MESSAGE NLS unused message: CustomWebProjectReferenceWizardFragment.1 in: org.eclipse.jst.servlet.ui.internal.messages

!ENTRY org.eclipse.osgi 2 1 2010-05-21 13:22:34.573
!MESSAGE NLS unused message: WebProjectReferenceDescription in: org.eclipse.jst.servlet.ui.internal.messages

Reproducible: Always
Comment 1 Hari Shankar CLA 2010-05-26 10:51:31 EDT
Created attachment 170008 [details]
patch

This patch removes the unused nl strings.
Comment 2 Chuck Bridgham CLA 2010-05-26 13:51:20 EDT
approve
Comment 3 Jason Sholl CLA 2010-05-26 13:54:00 EDT
Simple fix to clean up the .propertes file so eclipse doesn't log unused strings.  No Risk.  Reviewed by Chuck.
Comment 4 Jason Sholl CLA 2010-05-26 17:35:52 EDT
code checked into head for wtp 3.2 rc3
Comment 5 Hari Shankar CLA 2010-05-27 16:05:49 EDT
This fix needs to be modified because these strings are actually being used , even though the NLS unused message is logged. These strings were being used in CustomWebProjectReferenceWizardFragment using the Messages.getString() approach instead of the standard approach of using a message bundle, which was the reason why we were getting the 'NLS Unused message' in the logs.

The correct fix involves,

1. Modifying the string keys to change the .0 and .1 to _0 and _1 since the '.'s don't work in the bundle class
2. Introducing these strings in the bundle class (org.eclipse.jst.servlet.ui.internal.Messages.java)
3. Modifying CustomWebProjectReferenceWizardFragment to remove the Messages.getString() calls, and add access the strings as 'Messages.<key>'

Before applying this patch (with the deleted strings added back to messages.properties), I see the following:


!ENTRY org.eclipse.osgi 2 1 2010-05-27 15:37:28.515
!MESSAGE NLS unused message: CustomWebProjectReferenceWizardFragment_0 in: org.eclipse.jst.servlet.ui.internal.messages

!ENTRY org.eclipse.osgi 2 1 2010-05-27 15:37:28.515
!MESSAGE NLS unused message: CustomWebProjectReferenceWizardFragment_1 in: org.eclipse.jst.servlet.ui.internal.messages

!ENTRY org.eclipse.osgi 2 1 2010-05-27 15:37:28.515
!MESSAGE NLS unused message: WebProjectReferenceDescription in: org.eclipse.jst.servlet.ui.internal.messages


With the patch, the above messages are gone, and the strings show up fine in the UI. 
New patch is attached for review.
Comment 6 Hari Shankar CLA 2010-05-27 16:06:24 EDT
Created attachment 170259 [details]
updated patch
Comment 7 Carl Anderson CLA 2010-05-27 16:07:54 EDT
Clearing out the flags, setting the review for Chuck.
Comment 8 Chuck Bridgham CLA 2010-05-27 16:09:59 EDT
approve
Comment 9 Hari Shankar CLA 2010-05-27 16:19:00 EDT
    * Explain why you believe this is a stop-ship defect. Or, if it is a "hotbug" (requested by an adopter) please document it as such. 
I had removed the 3 strings in the previous patch, based on the NLS unused messages - thinking these were not being used. It turned out that these strings are actually being used, even though the NLS unused message is logged. 

These strings were being used in CustomWebProjectReferenceWizardFragment using the Messages.getString() approach instead of the standard approach of using a message bundle, which was the reason why we were getting the 'NLS Unused message' in the logs.
Without this updated patch, we see a NLS string missing messages in the Add Project Reference (with Web Library Option) deployment assembly page of the Web Project, since the UI is no longer able to find the string values.

    * Is there a work-around? If so, why do you believe the work-around is insufficient? 
No known workarounds.

    * How has the fix been tested? Is there a test case attached to the bugzilla record? Has a JUnit Test been added? 
Yes this fix has been tested. Without this patch, with the strings added, I still see the following in the log:

!ENTRY org.eclipse.osgi 2 1 2010-05-27 15:37:28.515
!MESSAGE NLS unused message: CustomWebProjectReferenceWizardFragment_0 in:
org.eclipse.jst.servlet.ui.internal.messages

!ENTRY org.eclipse.osgi 2 1 2010-05-27 15:37:28.515
!MESSAGE NLS unused message: CustomWebProjectReferenceWizardFragment_1 in:
org.eclipse.jst.servlet.ui.internal.messages

!ENTRY org.eclipse.osgi 2 1 2010-05-27 15:37:28.515
!MESSAGE NLS unused message: WebProjectReferenceDescription in:
org.eclipse.jst.servlet.ui.internal.messages


With the patch, these messages are gone, and the strings also show up properly on the UI.

    * Give a brief technical overview. Who has reviewed this fix? 
Chuck Bridgham has reviewed this patch.
    * What is the risk associated with this fix? 
There are no risks associated with the updated patch.
Comment 10 Carl Anderson CLA 2010-05-27 16:38:29 EDT
Committed updated patch to HEAD for WTP 3.2 RC3