Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 355778 - The code generator should mark string constants with the $NON-NLS comment
Summary: The code generator should mark string constants with the $NON-NLS comment
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Sapphire (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: Konstantin Komissarchik CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-24 20:12 EDT by Marcelo Paternostro CLA
Modified: 2021-11-19 09:22 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marcelo Paternostro CLA 2011-08-24 20:12:58 EDT
One of the JDT compiler preferences allows a developer to flag the use of hard-coded strings without the //$NON-NLS comment as a warning or even an error. Particularly in the last case, the code that Sapphire currently generates will be flagged with problems.

As an example, the following generated snippet

    public void setValue( String value )
    {
        synchronized( root() )
        {
            if( value != null && value.equals( "" ) )
            {
                value = null;
            }


could be

    public void setValue( String value )
    {
        synchronized( root() )
        {
            if( value != null && value.equals( "" ) ) //$NON-NLS-1$
            {
                value = null;
            }
Comment 1 Konstantin Komissarchik CLA 2011-08-24 22:28:48 EDT
I am surprised that JDT doesn't ignore derived files for validation such as this, but this is easy enough to fix on our end...
Comment 2 Konstantin Komissarchik CLA 2011-08-25 18:07:51 EDT
Fixed in 0.3.1 and 0.4 streams. Please verify.
Comment 3 Marcelo Paternostro CLA 2011-08-26 14:12:31 EDT
Problem fixed. Thnaks!

* And I agree that JDT should filter out derived resources.
Comment 4 Konstantin Komissarchik CLA 2011-08-27 21:49:17 EDT
Closing.