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

Bug 216587

Summary: [nls tooling] Externalize Strings generates non-compilable code when nothing to externalize.
Product: [Eclipse Project] JDT Reporter: Sergey Fukanchik <fukanchik>
Component: TextAssignee: JDT-Text-Inbox <jdt-text-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: minor    
Priority: P5 CC: caniszczyk, deepakazad
Version: 3.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Sergey Fukanchik CLA 2008-01-25 09:38:25 EST
Build ID: Build id: M20070212-1330

Steps To Reproduce:
Let's start with a new package which we need to localize. I.e. it doesn't contain Messages.java and messages.plugin yet. And we need another package also (say parent of this one - to keep localized messages in one place). Parent should not contain Messages.java and messages.plugin too.

Now add class in new package, and create single string constant in it.

Next - open externatialization wizard for this source.

Set all strings in this dialog to `Ignore' (!). This means there is no need to ever create Messages.java for wizard (and it will not).

Configure accessor class and property file location to *another* package (say `foo'), so that wizard will have to *import* it in our new class.

Now press Next in wizard, and expand "Changes to be performed" - no notion of importing non-existent Messages.

Press "Finish". At this moment to our string appended //$NON-NLS-1$ and to class is added import of non-existent Messages from package foo:

 import foo.Messages;

which makes source non-compilable.


More information:
I.e. when i wish Externalize Strings to ignore all strings in given source AND i set location for Accessor class to another package where Accessor class isn't exist yet, wizard created import for that non-existent accessor. And this makes source non-compilable.

It shouldn't import that accessor.
Comment 1 Chris Aniszczyk CLA 2008-01-25 12:06:08 EST
moving to JDT UI
Comment 2 Dani Megert CLA 2008-01-28 04:57:12 EST
Why do you change the defaults if you're going to ignore the strings anyways?
Comment 3 Sergey Fukanchik CLA 2008-01-28 05:46:30 EST
First time it was accidentally.
Comment 4 Deepak Azad CLA 2010-09-01 11:52:52 EDT

*** This bug has been marked as a duplicate of bug 202566 ***