Skip to content

Commit 207b0ac

Browse files
Resolved the NLS.bind() issues
1 parent 63169b8 commit 207b0ac

File tree

50 files changed

+150
-148
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+150
-148
lines changed

org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/InstalledJREsBlock.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ public String getColumnText(Object element, int columnIndex) {
253253
switch(columnIndex) {
254254
case 0:
255255
if (JavaRuntime.isContributedVMInstall(vm.getId())) {
256-
return NLS.bind(JREMessages.InstalledJREsBlock_19, new String[]{vm.getName()});
256+
return NLS.bind(JREMessages.InstalledJREsBlock_19, vm.getName());
257257
}
258258
if(fVMList.getChecked(element)) {
259259
return NLS.bind(JREMessages.InstalledJREsBlock_7, vm.getName());
@@ -926,7 +926,7 @@ public void run(IProgressMonitor monitor) {
926926

927927
if (locations.isEmpty()) {
928928
String messagePath = path.replace("&", "&&"); // @see bug 29855 //$NON-NLS-1$//$NON-NLS-2$
929-
MessageDialog.openInformation(getShell(), JREMessages.InstalledJREsBlock_12, NLS.bind(JREMessages.InstalledJREsBlock_13, new String[]{messagePath})); //
929+
MessageDialog.openInformation(getShell(), JREMessages.InstalledJREsBlock_12, NLS.bind(JREMessages.InstalledJREsBlock_13, messagePath)); //
930930
} else {
931931
Iterator<IVMInstallType> iter2 = types.iterator();
932932
for(File location: locations) {
@@ -1054,8 +1054,8 @@ protected void search(File directory, List<File> found, List<IVMInstallType> typ
10541054
return;
10551055
}
10561056
File file = name == null ? directory : new File(directory, name);
1057-
monitor.subTask(NLS.bind(JREMessages.InstalledJREsBlock_14, new String[] { Integer.toString(found.size()),
1058-
file.toPath().normalize().toAbsolutePath().toString().replace("&", "&&") })); // @see bug 29855 //$NON-NLS-1$ //$NON-NLS-2$
1057+
monitor.subTask(NLS.bind(JREMessages.InstalledJREsBlock_14, Integer.toString(found.size()),
1058+
file.toPath().normalize().toAbsolutePath().toString().replace("&", "&&") )); // @see bug 29855 //$NON-NLS-1$ //$NON-NLS-2$
10591059
IVMInstallType[] vmTypes = JavaRuntime.getVMInstallTypes();
10601060
if (file.isDirectory()) {
10611061
if (ignore.add(file)) {

org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/JREsComboBlock.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -473,9 +473,9 @@ protected void fillWithWorkspaceProfiles() {
473473
IPath path = JavaRuntime.newJREContainerPath(env);
474474
IVMInstall install = JavaRuntime.getVMInstall(path);
475475
if (install != null) {
476-
names[i] = NLS.bind(JREMessages.JREsComboBlock_15, new String[]{env.getId(), install.getName()});
476+
names[i] = NLS.bind(JREMessages.JREsComboBlock_15, env.getId(), install.getName());
477477
} else {
478-
names[i] = NLS.bind(JREMessages.JREsComboBlock_16, new String[]{env.getId()});
478+
names[i] = NLS.bind(JREMessages.JREsComboBlock_16, env.getId());
479479
}
480480
i++;
481481
}
@@ -603,12 +603,12 @@ public void setPath(IPath containerPath) {
603603
if (environment == null) {
604604
fErrorPath = containerPath;
605605
selectEnvironment(environment);
606-
setError(NLS.bind(JREMessages.JREsComboBlock_6, new String[]{envId}));
606+
setError(NLS.bind(JREMessages.JREsComboBlock_6, envId));
607607
} else {
608608
selectEnvironment(environment);
609609
IVMInstall[] installs = environment.getCompatibleVMs();
610610
if (installs.length == 0) {
611-
setError(NLS.bind(JREMessages.JREsComboBlock_7, new String[]{environment.getId()}));
611+
setError(NLS.bind(JREMessages.JREsComboBlock_7, environment.getId()));
612612
}
613613
}
614614
} else {
@@ -622,13 +622,13 @@ public void setPath(IPath containerPath) {
622622
} else {
623623
IVMInstallType installType = JavaRuntime.getVMInstallType(installTypeId);
624624
if (installType == null) {
625-
setError(NLS.bind(JREMessages.JREsComboBlock_9, new String[]{installTypeId}));
625+
setError(NLS.bind(JREMessages.JREsComboBlock_9, installTypeId));
626626
} else {
627627
String installName = JavaRuntime.getVMInstallName(containerPath);
628628
if (installName == null) {
629-
setError(NLS.bind(JREMessages.JREsComboBlock_10, new String[]{installType.getName()}));
629+
setError(NLS.bind(JREMessages.JREsComboBlock_10, installType.getName()));
630630
} else {
631-
setError(NLS.bind(JREMessages.JREsComboBlock_11, new String[]{installName, installType.getName()}));
631+
setError(NLS.bind(JREMessages.JREsComboBlock_11, installName, installType.getName()));
632632
}
633633
}
634634
}

org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/JREsEnvironmentLabelProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public void dispose() {
6969
public String getText(Object element) {
7070
String label = super.getText(element);
7171
if (isStrictlyCompatible(element)) {
72-
label = NLS.bind(JREMessages.JREsEnvironmentLabelProvider_0, new String[]{label, JREMessages.JREsEnvironmentLabelProvider_1});
72+
label = NLS.bind(JREMessages.JREsEnvironmentLabelProvider_0, label, JREMessages.JREsEnvironmentLabelProvider_1);
7373
}
7474
return label;
7575
}

org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/JREsPreferencePage.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ public boolean isValid() {
193193
private void validateComplianceAndJRE(IVMInstall vmInstall) {
194194
String compliance = getCurrentCompilerCompliance();
195195
if (!supportsCurrentCompliance(vmInstall, compliance)) {
196-
setMessage(NLS.bind(JREMessages.JREsPreferencePage_0, new String[] {compliance}), IMessageProvider.WARNING);
196+
setMessage(NLS.bind(JREMessages.JREsPreferencePage_0, compliance), IMessageProvider.WARNING);
197197
fCompliance.setVisible(true);
198198
}
199199
else {
@@ -210,7 +210,7 @@ private void validateComplianceAndJRE(IVMInstall vmInstall) {
210210
}
211211
}
212212
if (vmver != null && vmver.length() != 0 && JavaCore.compareJavaVersions(vmver, latest) > 0) {
213-
setMessage(NLS.bind(JREMessages.JREsPreferencePage_9, new String[] { compliance }), IMessageProvider.WARNING);
213+
setMessage(NLS.bind(JREMessages.JREsPreferencePage_9, compliance), IMessageProvider.WARNING);
214214
fCompliance.setVisible(true);
215215
} else {
216216
setMessage(null);

org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/StandardVMCommandTab.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public void createControl(Composite parent) {
7575
gd = new GridData(GridData.BEGINNING);
7676
gd.horizontalSpan = 2;
7777
fDefaultButton.setLayoutData(gd);
78-
fDefaultButton.setText(NLS.bind(JREMessages.AbstractJavaCommandTab_2, new String[]{getDefaultCommand()}));
78+
fDefaultButton.setText(NLS.bind(JREMessages.AbstractJavaCommandTab_2, getDefaultCommand()));
7979

8080
fDefaultButton.addSelectionListener(new SelectionAdapter() {
8181
@Override

org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/AppletLaunchConfigurationUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public static IType getMainType(String mainTypeName, IJavaProject javaProject) t
8282
} catch (JavaModelException jme) {
8383
}
8484
if (mainType == null) {
85-
abort(NLS.bind(LauncherMessages.appletlauncher_utils_error_main_type_does_not_exist, new String[] {mainTypeName, javaProject.getElementName()}), null, IJavaLaunchConfigurationConstants.ERR_UNSPECIFIED_MAIN_TYPE);
85+
abort(NLS.bind(LauncherMessages.appletlauncher_utils_error_main_type_does_not_exist, mainTypeName, javaProject.getElementName()), null, IJavaLaunchConfigurationConstants.ERR_UNSPECIFIED_MAIN_TYPE);
8686
}
8787
return mainType;
8888
}

org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/RuntimeClasspathEntryLabelProvider.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,10 @@ public String getText(Object element) {
140140
case IRuntimeClasspathEntry.ARCHIVE:
141141
IPath path = entry.getPath();
142142
if (path == null) {
143-
return NLS.bind(LauncherMessages.RuntimeClasspathEntryLabelProvider_Invalid_path, new String[]{"null"}); //$NON-NLS-1$
143+
return NLS.bind(LauncherMessages.RuntimeClasspathEntryLabelProvider_Invalid_path, "null"); //$NON-NLS-1$
144144
}
145145
if (!path.isAbsolute() || !path.isValidPath(path.toString())) {
146-
return NLS.bind(LauncherMessages.RuntimeClasspathEntryLabelProvider_Invalid_path, new String[]{path.toOSString()});
146+
return NLS.bind(LauncherMessages.RuntimeClasspathEntryLabelProvider_Invalid_path, path.toOSString());
147147
}
148148
String[] segments = path.segments();
149149
StringBuilder displayPath = new StringBuilder();

org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/SelectSystemLibraryQuickFix.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public void run(IProgressMonitor monitor) throws InvocationTargetException {
109109
*/
110110
@Override
111111
public String getLabel() {
112-
return NLS.bind(LauncherMessages.JREContainerResolution_Select_a_system_library_to_use_when_building__0__2, new String[]{fProject.getElementName()});
112+
return NLS.bind(LauncherMessages.JREContainerResolution_Select_a_system_library_to_use_when_building__0__2, fProject.getElementName());
113113
}
114114

115115
}

org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/propertypages/JavaBreakpointPage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ protected Control createContents(Composite parent) {
201201
@Override
202202
public void shellActivated(ShellEvent e) {
203203
Shell shell = (Shell)e.getSource();
204-
shell.setText(NLS.bind(PropertyPageMessages.JavaBreakpointPage_10, new String[]{getName(getBreakpoint())}));
204+
shell.setText(NLS.bind(PropertyPageMessages.JavaBreakpointPage_10, getName(getBreakpoint())));
205205
shell.removeShellListener(this);
206206
}
207207
@Override

org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/ScrapbookLauncher.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ public static ILaunchConfiguration getLaunchConfigurationTemplate(IFile file) th
386386
*/
387387
public static ILaunchConfiguration createLaunchConfigurationTemplate(IFile page) throws CoreException {
388388
ILaunchConfigurationType lcType = getLaunchManager().getLaunchConfigurationType(IJavaLaunchConfigurationConstants.ID_JAVA_APPLICATION);
389-
String name = NLS.bind(SnippetMessages.getString("ScrapbookLauncher.17"), new String[]{page.getName()}); //$NON-NLS-1$
389+
String name = NLS.bind(SnippetMessages.getString("ScrapbookLauncher.17"), page.getName()); //$NON-NLS-1$
390390
ILaunchConfigurationWorkingCopy wc = lcType.newInstance(null, name);
391391
wc.setAttribute(IDebugUIConstants.ATTR_PRIVATE, true);
392392
wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, "org.eclipse.jdt.internal.debug.ui.snippeteditor.ScrapbookMain"); //$NON-NLS-1$

0 commit comments

Comments
 (0)