Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/perf
diff options
context:
space:
mode:
authorAlexander Kurtakov2017-05-18 10:15:21 +0000
committerAlexander Kurtakov2017-05-18 11:55:19 +0000
commit7cf4a497c86e0216748e457bbd8975e548905d72 (patch)
treed49e8e2966160a1068db895ecf7f2d32c5beba3c /perf
parent38b372aafb8a31562de8a46cb933cd09b55c9927 (diff)
downloadorg.eclipse.linuxtools-7cf4a497c86e0216748e457bbd8975e548905d72.tar.gz
org.eclipse.linuxtools-7cf4a497c86e0216748e457bbd8975e548905d72.tar.xz
org.eclipse.linuxtools-7cf4a497c86e0216748e457bbd8975e548905d72.zip
Use varargs MessageFormat.format method.
Removes a bunch of casts and arrays definitions. Change-Id: I3839aa2ed1c8df6ae4923597cff8b0d44d5c0742 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com> Reviewed-on: https://git.eclipse.org/r/97421 Tested-by: Hudson CI
Diffstat (limited to 'perf')
-rw-r--r--perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/handlers/AbstractSaveDataHandler.java6
-rw-r--r--perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/launch/PerfLaunchConfigDelegate.java7
-rw-r--r--perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/ui/ReportComparisonView.java6
-rw-r--r--perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/ui/StatComparisonView.java6
4 files changed, 12 insertions, 13 deletions
diff --git a/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/handlers/AbstractSaveDataHandler.java b/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/handlers/AbstractSaveDataHandler.java
index 82d0a26ca7..71f04bf72d 100644
--- a/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/handlers/AbstractSaveDataHandler.java
+++ b/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/handlers/AbstractSaveDataHandler.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2013 Red Hat, Inc.
+ * Copyright (c) 2013, 2017 Red Hat, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -107,7 +107,7 @@ public abstract class AbstractSaveDataHandler extends BaseDataManipulator implem
if (fileStore.fetchInfo().exists()) {
String msg = MessageFormat.format(
Messages.PerfSaveSession_file_exists_msg,
- new Object[] { fileStore.getName() });
+ fileStore.getName());
return MessageDialog.openQuestion(Display.getCurrent()
.getActiveShell(),
Messages.PerfSaveSession_file_exists_title, msg);
@@ -120,7 +120,7 @@ public abstract class AbstractSaveDataHandler extends BaseDataManipulator implem
* @param filename
*/
public void openErroDialog(final String title, String pattern, String arg) {
- final String errorMsg = MessageFormat.format(pattern, new Object[] { arg });
+ final String errorMsg = MessageFormat.format(pattern, arg);
if (Display.getCurrent() != null) {
MessageDialog.openError(Display.getCurrent().getActiveShell(), title, errorMsg);
} else {
diff --git a/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/launch/PerfLaunchConfigDelegate.java b/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/launch/PerfLaunchConfigDelegate.java
index 446f86f8c8..2ec91d1f51 100644
--- a/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/launch/PerfLaunchConfigDelegate.java
+++ b/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/launch/PerfLaunchConfigDelegate.java
@@ -1,6 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2008, 2009 Red Hat, Inc. and others
- * (C) Copyright IBM Corp. 2010
+ * Copyright (c) 2004, 2017 Red Hat, Inc. and others
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -266,8 +265,8 @@ public class PerfLaunchConfigDelegate extends AbstractCLaunchDelegate {
} catch (URISyntaxException e) {
MessageDialog.openError(Display.getCurrent().getActiveShell(), Messages.MsgProxyError, Messages.MsgProxyError);
}
- Object[] titleArgs = new Object[]{binURI.getPath(), args.toString(), String.valueOf(runCount)};
- String title = renderProcessLabel(MessageFormat.format(Messages.PerfLaunchConfigDelegate_stat_title, titleArgs));
+ String title = renderProcessLabel(MessageFormat.format(Messages.PerfLaunchConfigDelegate_stat_title,
+ binURI.getPath(), args.toString(), String.valueOf(runCount)));
List<String> configEvents = config.getAttribute(PerfPlugin.ATTR_SelectedEvents,
PerfPlugin.ATTR_SelectedEvents_default);
diff --git a/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/ui/ReportComparisonView.java b/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/ui/ReportComparisonView.java
index 2ad50b1d17..229d94cc10 100644
--- a/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/ui/ReportComparisonView.java
+++ b/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/ui/ReportComparisonView.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2013 Red Hat Inc.
+ * Copyright (c) 2013, 2017 Red Hat Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -204,8 +204,8 @@ public class ReportComparisonView extends Viewer {
newDatum = generateTempFile(rStream);
}
- String title = MessageFormat.format(Messages.ContentDescription_0,
- new Object[] { oldDatum.toFile().getName(), newDatum.toFile().getName() });
+ String title = MessageFormat.format(Messages.ContentDescription_0, oldDatum.toFile().getName(),
+ newDatum.toFile().getName());
// create comparison data and run comparison.
ReportComparisonData diffData;
diff --git a/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/ui/StatComparisonView.java b/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/ui/StatComparisonView.java
index bbb7942838..38fb1317d7 100644
--- a/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/ui/StatComparisonView.java
+++ b/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/ui/StatComparisonView.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2013 Red Hat Inc.
+ * Copyright (c) 2013, 2017 Red Hat Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -206,8 +206,8 @@ public class StatComparisonView extends Viewer {
newDatum = generateTempFile(rStream);
}
- String title = MessageFormat.format(Messages.ContentDescription_0,
- new Object[] { oldDatum.toFile().getName(), newDatum.toFile().getName() });
+ String title = MessageFormat.format(Messages.ContentDescription_0, oldDatum.toFile().getName(),
+ newDatum.toFile().getName());
// create comparison data and run comparison.
StatComparisonData diffData;

Back to the top