Bug 306336 - [nls tooling] externalize String method with varargs
Summary: [nls tooling] externalize String method with varargs
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.5.1   Edit
Hardware: All All
: P5 enhancement with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 322892 413805 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-03-18 05:55 EDT by Sven Krause CLA
Modified: 2013-07-29 06:08 EDT (History)
3 users (show)

See Also:


Attachments
screenshot (5.35 KB, image/gif)
2010-03-18 06:19 EDT, Sven Krause CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sven Krause CLA 2010-03-18 05:55:17 EDT
I would like to see an additional getString method generated from the string externalization support, when choosing the resource bundle variant.

The new method should support the varargs, when java 5 compiler compliance is active:

import javax.text.MessageFormat;

public static String getString(String key, Object... args) {
	if (args.length > 0) {
		return MessageFormat.format(getString(key), args);
	} else {
		return getString(key);
	}
}


The chang is requested with in the org.eclipse.jdt.internal.corext.refactoring.nls.AccessorClassCreator#createGetStringMethod(String) method.
Comment 1 Dani Megert CLA 2010-03-18 06:03:09 EDT
If we decided to support this, then we also have to adjust the other parts of the tooling (hyperlinking, hovering, finding broken externalized strings).
Comment 2 Sven Krause CLA 2010-03-18 06:05:58 EDT
Why not starting step by step? It's just conveniens and that makes user happy.
Comment 3 Dani Megert CLA 2010-03-18 06:12:46 EDT
Because we want to offer consistent tooling.
Comment 4 Sven Krause CLA 2010-03-18 06:19:19 EDT
Created attachment 162386 [details]
screenshot

Wow! It's already supported.
Comment 5 Dani Megert CLA 2010-03-18 06:22:45 EDT
Good ;-) It might already work but the different tools just have to be checked and updated if needed.
Comment 6 Dani Megert CLA 2010-08-17 09:05:32 EDT
*** Bug 322892 has been marked as a duplicate of this bug. ***
Comment 7 Dani Megert CLA 2013-07-29 06:08:51 EDT
*** Bug 413805 has been marked as a duplicate of this bug. ***