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

Bug 355778

Summary: The code generator should mark string constants with the $NON-NLS comment
Product: z_Archived Reporter: Marcelo Paternostro <marcelo.paternostro>
Component: SapphireAssignee: Konstantin Komissarchik <konstantin>
Status: CLOSED FIXED QA Contact:
Severity: minor    
Priority: P3 CC: konstantin
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

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.