Bug 475879 - Update usage of JFaceResources.format to varargs


Change-Id: I484c4f0b703c4088d7d66d8ac0a5e78cce079d7c
Signed-off-by: Jan-Ove Weichel <janove.weichel@vogella.com>
diff --git a/bundles/org.eclipse.jface/src/org/eclipse/jface/action/ActionContributionItem.java b/bundles/org.eclipse.jface/src/org/eclipse/jface/action/ActionContributionItem.java
index 52c7019..ace0e2f 100644
--- a/bundles/org.eclipse.jface/src/org/eclipse/jface/action/ActionContributionItem.java
+++ b/bundles/org.eclipse.jface/src/org/eclipse/jface/action/ActionContributionItem.java
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ *     Jan-Ove Weichel <janove.weichel@vogella.com> - Bug 475879
  *******************************************************************************/
 package org.eclipse.jface.action;
 
@@ -780,7 +781,7 @@
 								&& acceleratorText.length() != 0) {
 							toolTip = JFaceResources.format(
 									"Toolbar_Tooltip_Accelerator", //$NON-NLS-1$
-									new Object[] { toolTip, acceleratorText });
+									toolTip, acceleratorText);
 						}
 					}
 
diff --git a/bundles/org.eclipse.jface/src/org/eclipse/jface/action/StatusLine.java b/bundles/org.eclipse.jface/src/org/eclipse/jface/action/StatusLine.java
index 7606d4e..c65a87b 100644
--- a/bundles/org.eclipse.jface/src/org/eclipse/jface/action/StatusLine.java
+++ b/bundles/org.eclipse.jface/src/org/eclipse/jface/action/StatusLine.java
@@ -8,6 +8,7 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Lars Vogel <Lars.Vogel@vogella.com> - Bug 440270
+ *     Jan-Ove Weichel <janove.weichel@vogella.com> - Bug 475879
  *******************************************************************************/
 
 package org.eclipse.jface.action;
@@ -650,8 +651,7 @@
 		if (fTaskName == null || fTaskName.length() == 0) {
 			text = newName;
 		} else {
-			text = JFaceResources.format(
-					"Set_SubTask", new Object[] { fTaskName, newName });//$NON-NLS-1$
+			text = JFaceResources.format("Set_SubTask", fTaskName, newName);//$NON-NLS-1$
 		}
 		setMessage(text);
 	}
diff --git a/bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/ErrorDialog.java b/bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/ErrorDialog.java
index 59b07e0..1830b7d 100644
--- a/bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/ErrorDialog.java
+++ b/bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/ErrorDialog.java
@@ -11,6 +11,7 @@
  * 			be activated and used by other components.
  *      Krzysztof Daniel <krzysztof.daniel@gmail.com> Bug 96373 - [ErrorHandling]
  *          ErrorDialog details area becomes huge with multi-line strings
+ *      Jan-Ove Weichel <janove.weichel@vogella.com> - Bug 475879
  *******************************************************************************/
 package org.eclipse.jface.dialogs;
 
@@ -144,9 +145,7 @@
 				.getString("Problem_Occurred") : //$NON-NLS-1$
 				dialogTitle;
 		this.message = message == null ? status.getMessage()
-				: JFaceResources
-						.format(
-								"Reason", new Object[] { message, status.getMessage() }); //$NON-NLS-1$
+				: JFaceResources.format("Reason", message, status.getMessage()); //$NON-NLS-1$
 		this.status = status;
 		this.displayMask = displayMask;
 	}
diff --git a/bundles/org.eclipse.jface/src/org/eclipse/jface/preference/IntegerFieldEditor.java b/bundles/org.eclipse.jface/src/org/eclipse/jface/preference/IntegerFieldEditor.java
index 1b2796e..4e6a137 100644
--- a/bundles/org.eclipse.jface/src/org/eclipse/jface/preference/IntegerFieldEditor.java
+++ b/bundles/org.eclipse.jface/src/org/eclipse/jface/preference/IntegerFieldEditor.java
@@ -9,6 +9,7 @@
  *     IBM Corporation - initial API and implementation
  *     <sgandon@nds.com> - Fix for bug 109389 - IntegerFieldEditor
  *     does not fire property change all the time
+ *     Jan-Ove Weichel <janove.weichel@vogella.com> - Bug 475879
  *******************************************************************************/
 package org.eclipse.jface.preference;
 
@@ -70,9 +71,8 @@
     public void setValidRange(int min, int max) {
         minValidValue = min;
         maxValidValue = max;
-        setErrorMessage(JFaceResources.format(
-        		"IntegerFieldEditor.errorMessageRange", //$NON-NLS-1$
-        		new Object[] { new Integer(min), new Integer(max) }));
+		setErrorMessage(JFaceResources.format("IntegerFieldEditor.errorMessageRange", //$NON-NLS-1$
+				new Integer(min), new Integer(max)));
     }
 
     @Override
diff --git a/bundles/org.eclipse.jface/src/org/eclipse/jface/preference/PreferenceDialog.java b/bundles/org.eclipse.jface/src/org/eclipse/jface/preference/PreferenceDialog.java
index dd2ad03..04e2170 100644
--- a/bundles/org.eclipse.jface/src/org/eclipse/jface/preference/PreferenceDialog.java
+++ b/bundles/org.eclipse.jface/src/org/eclipse/jface/preference/PreferenceDialog.java
@@ -10,6 +10,7 @@
  *     Teddy Walker <teddy.walker@googlemail.com>
  *     	- Bug 188056 [Preferences] PreferencePages have to less indent in PreferenceDialog
  *     Stefan Xenos <sxenos@google.com> - Bug 466793
+ *     Jan-Ove Weichel <janove.weichel@vogella.com> - Bug 475879
  *******************************************************************************/
 package org.eclipse.jface.preference;
 
@@ -813,8 +814,8 @@
 					try {
 						((IPersistentPreferenceStore) store).save();
 					} catch (IOException e) {
-						String message =JFaceResources.format(
-                                "PreferenceDialog.saveErrorMessage", new Object[] { page.getTitle(), e.getMessage() }); //$NON-NLS-1$
+						String message = JFaceResources.format("PreferenceDialog.saveErrorMessage", page.getTitle(), //$NON-NLS-1$
+								e.getMessage());
 			            Policy.getStatusHandler().show(
 			                    new Status(IStatus.ERROR, Policy.JFACE, message, e),
 			                    JFaceResources.getString("PreferenceDialog.saveErrorTitle")); //$NON-NLS-1$
diff --git a/bundles/org.eclipse.jface/src/org/eclipse/jface/util/SafeRunnableDialog.java b/bundles/org.eclipse.jface/src/org/eclipse/jface/util/SafeRunnableDialog.java
index c11f37a..86a3511 100644
--- a/bundles/org.eclipse.jface/src/org/eclipse/jface/util/SafeRunnableDialog.java
+++ b/bundles/org.eclipse.jface/src/org/eclipse/jface/util/SafeRunnableDialog.java
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ *     Jan-Ove Weichel <janove.weichel@vogella.com> - Bug 475879
  *******************************************************************************/
 package org.eclipse.jface.util;
 
@@ -69,9 +70,8 @@
 					.getException().toString() : status.getException()
 					.getMessage();
 		}
-		this.message = JFaceResources.format(
-				"SafeRunnableDialog_reason", new Object[] { //$NON-NLS-1$
-				status.getMessage(), reason });
+		this.message = JFaceResources.format("SafeRunnableDialog_reason", //$NON-NLS-1$
+				status.getMessage(), reason);
 	}
 
 	/**
diff --git a/bundles/org.eclipse.jface/src/org/eclipse/jface/wizard/ProgressMonitorPart.java b/bundles/org.eclipse.jface/src/org/eclipse/jface/wizard/ProgressMonitorPart.java
index 8c0ea1e..79567e0 100644
--- a/bundles/org.eclipse.jface/src/org/eclipse/jface/wizard/ProgressMonitorPart.java
+++ b/bundles/org.eclipse.jface/src/org/eclipse/jface/wizard/ProgressMonitorPart.java
@@ -9,6 +9,7 @@
  *     IBM Corporation - initial API and implementation
  *     Eugene Ostroukhov <eugeneo@symbian.org> -  Bug 287887 [Wizards] [api] Cancel button has two distinct roles
  *     Lars Vogel <Lars.Vogel@vogella.com> - Bug 440270
+ *     Jan-Ove Weichel <janove.weichel@vogella.com> - Bug 475879
  *******************************************************************************/
 package org.eclipse.jface.wizard;
 
@@ -353,8 +354,7 @@
 
 		if (hasTask) {
 			if (hasSubtask)
-				return escapeMetaCharacters(JFaceResources.format(
-    					"Set_SubTask", new Object[] { fTaskName, fSubTaskName }));//$NON-NLS-1$
+				return escapeMetaCharacters(JFaceResources.format("Set_SubTask", fTaskName, fSubTaskName));//$NON-NLS-1$
    			return escapeMetaCharacters(fTaskName);
 
     	} else if (hasSubtask) {
diff --git a/bundles/org.eclipse.jface/src/org/eclipse/jface/wizard/WizardDialog.java b/bundles/org.eclipse.jface/src/org/eclipse/jface/wizard/WizardDialog.java
index 2751279..9fd866d 100644
--- a/bundles/org.eclipse.jface/src/org/eclipse/jface/wizard/WizardDialog.java
+++ b/bundles/org.eclipse.jface/src/org/eclipse/jface/wizard/WizardDialog.java
@@ -10,6 +10,7 @@
  *     Chris Gross (schtoo@schtoo.com) - patch for bug 16179
  *     Eugene Ostroukhov <eugeneo@symbian.org> - Bug 287887 [Wizards] [api] Cancel button has two distinct roles
  *     Paul Adams <padams@ittvis.com> - Bug 202534 - [Dialogs] SWT error in Wizard dialog when help is displayed and "Finish" is pressed
+ *     Jan-Ove Weichel <janove.weichel@vogella.com> - Bug 475879
  *******************************************************************************/
 package org.eclipse.jface.wizard;
 
@@ -1201,9 +1202,9 @@
 			page.createControl(pageContainer);
 			// the page is responsible for ensuring the created control is
 			// accessible via getControl.
-			Assert.isNotNull(page.getControl(), JFaceResources.format(
-					JFaceResources.getString("WizardDialog.missingSetControl"), //$NON-NLS-1$
-					new Object[] { page.getName() }));
+			Assert.isNotNull(page.getControl(),
+					JFaceResources.format(JFaceResources.getString("WizardDialog.missingSetControl"), //$NON-NLS-1$
+							page.getName()));
 			// ensure the dialog is large enough for this page
 			updateSize(page);
 		}