diff --git a/ant/org.eclipse.ant.core/src/org/eclipse/ant/core/AntCorePreferences.java b/ant/org.eclipse.ant.core/src/org/eclipse/ant/core/AntCorePreferences.java index 771cf8a7346..6357fc384f4 100644 --- a/ant/org.eclipse.ant.core/src/org/eclipse/ant/core/AntCorePreferences.java +++ b/ant/org.eclipse.ant.core/src/org/eclipse/ant/core/AntCorePreferences.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2018 IBM Corporation and others. + * Copyright (c) 2000, 2025 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -607,9 +607,7 @@ private void addURLToExtraClasspathEntries(URL url, IConfigurationElement elemen if (eclipseRuntime != null) { eclipseRuntimeRequired = Boolean.parseBoolean(eclipseRuntime); } - Iterator itr = extraClasspathURLs.iterator(); - while (itr.hasNext()) { - IAntClasspathEntry entry = itr.next(); + for (IAntClasspathEntry entry : extraClasspathURLs) { if (entry.getEntryURL().equals(url)) { return; } @@ -689,8 +687,7 @@ private boolean configureAntObject(IConfigurationElement element, AntObject antO String library = element.getAttribute(AntCorePlugin.LIBRARY); if (library == null) { - IStatus status = new Status(IStatus.ERROR, AntCorePlugin.PI_ANTCORE, AntCorePlugin.ERROR_LIBRARY_NOT_SPECIFIED, NLS.bind(InternalCoreAntMessages.AntCorePreferences_Library_not_specified_for___0__4, new String[] { - objectName }), null); + IStatus status = new Status(IStatus.ERROR, AntCorePlugin.PI_ANTCORE, AntCorePlugin.ERROR_LIBRARY_NOT_SPECIFIED, NLS.bind(InternalCoreAntMessages.AntCorePreferences_Library_not_specified_for___0__4, objectName), null); AntCorePlugin.getPlugin().getLog().log(status); return false; } @@ -708,8 +705,7 @@ private boolean configureAntObject(IConfigurationElement element, AntObject antO } // type specifies a library that does not exist - IStatus status = new Status(IStatus.ERROR, AntCorePlugin.PI_ANTCORE, AntCorePlugin.ERROR_LIBRARY_NOT_SPECIFIED, NLS.bind(errorMessage, new String[] { - library, element.getContributor().getName() }), null); + IStatus status = new Status(IStatus.ERROR, AntCorePlugin.PI_ANTCORE, AntCorePlugin.ERROR_LIBRARY_NOT_SPECIFIED, NLS.bind(errorMessage, library, element.getContributor().getName()), null); AntCorePlugin.getPlugin().getLog().log(status); return false; } @@ -720,8 +716,7 @@ private boolean configureAntObject(IConfigurationElement element, AntObject antO } catch (Exception e) { // likely extra classpath entry library that does not exist - IStatus status = new Status(IStatus.ERROR, AntCorePlugin.PI_ANTCORE, AntCorePlugin.ERROR_LIBRARY_NOT_SPECIFIED, NLS.bind(InternalCoreAntMessages.AntCorePreferences_8, new String[] { - library, element.getContributor().getName() }), null); + IStatus status = new Status(IStatus.ERROR, AntCorePlugin.PI_ANTCORE, AntCorePlugin.ERROR_LIBRARY_NOT_SPECIFIED, NLS.bind(InternalCoreAntMessages.AntCorePreferences_8, library, element.getContributor().getName()), null); AntCorePlugin.getPlugin().getLog().log(status); } return false; @@ -744,8 +739,7 @@ protected void computeDefaultExtraClasspathEntries(List e addPluginClassLoader(bundle); } else { // extra classpath entry that does not exist - IStatus status = new Status(IStatus.ERROR, AntCorePlugin.PI_ANTCORE, AntCorePlugin.ERROR_LIBRARY_NOT_SPECIFIED, NLS.bind(InternalCoreAntMessages.AntCorePreferences_6, new String[] { - library, element.getContributor().getName() }), null); + IStatus status = new Status(IStatus.ERROR, AntCorePlugin.PI_ANTCORE, AntCorePlugin.ERROR_LIBRARY_NOT_SPECIFIED, NLS.bind(InternalCoreAntMessages.AntCorePreferences_6, library, element.getContributor().getName()), null); AntCorePlugin.getPlugin().getLog().log(status); continue; } @@ -758,8 +752,7 @@ protected void computeDefaultExtraClasspathEntries(List e } catch (Exception e) { // likely extra classpath entry that does not exist - IStatus status = new Status(IStatus.ERROR, AntCorePlugin.PI_ANTCORE, AntCorePlugin.ERROR_LIBRARY_NOT_SPECIFIED, NLS.bind(InternalCoreAntMessages.AntCorePreferences_6, new String[] { - library, element.getContributor().getName() }), null); + IStatus status = new Status(IStatus.ERROR, AntCorePlugin.PI_ANTCORE, AntCorePlugin.ERROR_LIBRARY_NOT_SPECIFIED, NLS.bind(InternalCoreAntMessages.AntCorePreferences_6, library, element.getContributor().getName()), null); AntCorePlugin.getPlugin().getLog().log(status); continue; } @@ -1069,11 +1062,9 @@ private void addEntryURLs(List result, IAntClasspathEntry[] entries) { protected ClassLoader[] getPluginClassLoaders() { if (orderedPluginClassLoaders == null) { - Iterator classLoaders = pluginClassLoaders.iterator(); Map idToLoader = new HashMap<>(pluginClassLoaders.size()); List bundles = new ArrayList<>(pluginClassLoaders.size()); - while (classLoaders.hasNext()) { - WrappedClassLoader loader = classLoaders.next(); + for (WrappedClassLoader loader : pluginClassLoaders) { idToLoader.put(loader.bundle.getSymbolicName(), loader); BundleRevision revision = loader.bundle.adapt(BundleRevision.class); if (revision != null) { @@ -1134,8 +1125,7 @@ private List computePrerequisiteOrder(List plugi prereqs.add(new Relation(currentFrag, hostWires.get(0).getProvider())); } } else { - AntCorePlugin.getPlugin().getLog().log(new Status(IStatus.ERROR, AntCorePlugin.PI_ANTCORE, AntCorePlugin.ERROR_MALFORMED_URL, NLS.bind(InternalCoreAntMessages.AntCorePreferences_1, new String[] { - currentFrag.getSymbolicName() }), null)); + AntCorePlugin.getPlugin().getLog().log(new Status(IStatus.ERROR, AntCorePlugin.PI_ANTCORE, AntCorePlugin.ERROR_MALFORMED_URL, NLS.bind(InternalCoreAntMessages.AntCorePreferences_1, currentFrag.getSymbolicName()), null)); } } @@ -1289,9 +1279,7 @@ public List getTasks() { public List getRemoteTasks() { List result = new ArrayList<>(10); if (defaultTasks != null && !defaultTasks.isEmpty()) { - Iterator iter = defaultTasks.iterator(); - while (iter.hasNext()) { - Task task = iter.next(); + for (Task task : defaultTasks) { if (!task.isEclipseRuntimeRequired()) { result.add(task); } @@ -1356,9 +1344,7 @@ public List getProperties() { public List getRemoteAntProperties() { List result = new ArrayList<>(10); if (defaultProperties != null && !defaultProperties.isEmpty()) { - Iterator iter = defaultProperties.iterator(); - while (iter.hasNext()) { - Property property = iter.next(); + for (Property property : defaultProperties) { if (!property.isEclipseRuntimeRequired()) { result.add(property); } @@ -1527,9 +1513,7 @@ public List getTypes() { public List getRemoteTypes() { List result = new ArrayList<>(10); if (defaultTypes != null && !defaultTypes.isEmpty()) { - Iterator iter = defaultTypes.iterator(); - while (iter.hasNext()) { - Type type = iter.next(); + for (Type type : defaultTypes) { if (!type.isEclipseRuntimeRequired()) { result.add(type); } diff --git a/ant/org.eclipse.ant.core/src/org/eclipse/ant/core/AntRunner.java b/ant/org.eclipse.ant.core/src/org/eclipse/ant/core/AntRunner.java index d508dec1e98..24c58c97ecc 100644 --- a/ant/org.eclipse.ant.core/src/org/eclipse/ant/core/AntRunner.java +++ b/ant/org.eclipse.ant.core/src/org/eclipse/ant/core/AntRunner.java @@ -303,8 +303,7 @@ private void basicConfigure(Class classInternalAntRunner, Object runner) thro */ public void run(IProgressMonitor monitor) throws CoreException { if (buildRunning) { - IStatus status = new Status(IStatus.ERROR, AntCorePlugin.PI_ANTCORE, AntCorePlugin.ERROR_RUNNING_BUILD, NLS.bind(InternalCoreAntMessages.AntRunner_Already_in_progess, new String[] { - buildFileLocation }), null); + IStatus status = new Status(IStatus.ERROR, AntCorePlugin.PI_ANTCORE, AntCorePlugin.ERROR_RUNNING_BUILD, NLS.bind(InternalCoreAntMessages.AntRunner_Already_in_progess, buildFileLocation), null); throw new CoreException(status); } buildRunning = true; @@ -450,7 +449,7 @@ protected void problemLoadingClass(Throwable e) throws CoreException { if (missingClassName != null) { missingClassName = missingClassName.replace('/', '.'); message = InternalCoreAntMessages.AntRunner_Could_not_find_one_or_more_classes__Please_check_the_Ant_classpath__2; - message = NLS.bind(message, new String[] { missingClassName }); + message = NLS.bind(message, missingClassName); } else { message = InternalCoreAntMessages.AntRunner_Could_not_find_one_or_more_classes__Please_check_the_Ant_classpath__1; } diff --git a/debug/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/launchConfigurations/ExternalToolsCoreUtil.java b/debug/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/launchConfigurations/ExternalToolsCoreUtil.java index 33f4daeb853..eb402a8e265 100644 --- a/debug/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/launchConfigurations/ExternalToolsCoreUtil.java +++ b/debug/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/launchConfigurations/ExternalToolsCoreUtil.java @@ -70,7 +70,7 @@ protected static void abort(String message, Throwable exception, int code) throw public static IPath getLocation(ILaunchConfiguration configuration) throws CoreException { String location = configuration.getAttribute(IExternalToolConstants.ATTR_LOCATION, (String) null); if (location == null) { - abort(NLS.bind(ExternalToolsProgramMessages.ExternalToolsUtil_Location_not_specified_by__0__1, new String[] { configuration.getName()}), null, 0); + abort(NLS.bind(ExternalToolsProgramMessages.ExternalToolsUtil_Location_not_specified_by__0__1, configuration.getName()), null, 0); } else { String expandedLocation = getStringVariableManager().performStringSubstitution(location); if (expandedLocation == null || expandedLocation.length() == 0) { diff --git a/debug/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/launchConfigurations/ProgramLaunchDelegate.java b/debug/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/launchConfigurations/ProgramLaunchDelegate.java index f6efdb87c0a..0c53f6486d8 100644 --- a/debug/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/launchConfigurations/ProgramLaunchDelegate.java +++ b/debug/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/launchConfigurations/ProgramLaunchDelegate.java @@ -117,7 +117,7 @@ public void launch(ILaunchConfiguration configuration, String mode, if (p != null) { monitor.beginTask(NLS.bind( ExternalToolsProgramMessages.ProgramLaunchDelegate_3, - new String[] { configuration.getName() }), + configuration.getName()), IProgressMonitor.UNKNOWN); String label = getProcessLabel(location, p); process = DebugPlugin.newProcess(launch, p, label, processAttributes); diff --git a/debug/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/model/ExternalToolBuilder.java b/debug/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/model/ExternalToolBuilder.java index 747decae3d7..4001ce97c5b 100644 --- a/debug/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/model/ExternalToolBuilder.java +++ b/debug/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/model/ExternalToolBuilder.java @@ -178,7 +178,7 @@ private void doBuildBasedOnScope(IResource[] resources, int kind, ILaunchConfigu } private void launchBuild(int kind, ILaunchConfiguration config, Map args, IProgressMonitor monitor) throws CoreException { - monitor.subTask(NLS.bind(ExternalToolsModelMessages.ExternalToolBuilder_Running__0_____1, new String[] { config.getName()})); + monitor.subTask(NLS.bind(ExternalToolsModelMessages.ExternalToolBuilder_Running__0_____1, config.getName())); buildStarted(kind, args); // The default value for "launch in background" is true in debug core. If // the user doesn't go through the UI, the new attribute won't be set. This means diff --git a/debug/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/ContributedValueVariable.java b/debug/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/ContributedValueVariable.java index e4af182656d..24e831212a4 100644 --- a/debug/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/ContributedValueVariable.java +++ b/debug/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/ContributedValueVariable.java @@ -88,10 +88,10 @@ private void initialize() { if (object instanceof IValueVariableInitializer initializer) { initializer.initialize(this); } else { - VariablesPlugin.logMessage(NLS.bind("Unable to initialize variable {0} - initializer must be an instance of IValueVariableInitializer.", new String[]{getName()}), null); //$NON-NLS-1$ + VariablesPlugin.logMessage(NLS.bind("Unable to initialize variable {0} - initializer must be an instance of IValueVariableInitializer.", getName()), null); //$NON-NLS-1$ } } catch (CoreException e) { - VariablesPlugin.logMessage(NLS.bind("Unable to initialize variable {0}",new String[]{getName()}), e); //$NON-NLS-1$ + VariablesPlugin.logMessage(NLS.bind("Unable to initialize variable {0}", getName()), e); //$NON-NLS-1$ } } } else { diff --git a/debug/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/DynamicVariable.java b/debug/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/DynamicVariable.java index 91c457cf911..95dbb06b8e6 100644 --- a/debug/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/DynamicVariable.java +++ b/debug/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/DynamicVariable.java @@ -37,25 +37,25 @@ public String getValue(String argument) throws CoreException { if (!supportsArgument()) { // check for an argument - not supported if (argument != null && argument.length() > 0) { - throw new CoreException(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, NLS.bind(VariablesMessages.DynamicVariable_0, new String[]{argument, getName()}), null)); + throw new CoreException(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, NLS.bind(VariablesMessages.DynamicVariable_0, argument, getName()), null)); } } if (fResolver == null) { String name = getConfigurationElement().getAttribute("resolver"); //$NON-NLS-1$ if (name == null) { - throw new CoreException(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, NLS.bind("Contributed context variable {0} must specify a resolver.",new String[]{getName()}), null)); //$NON-NLS-1$ + throw new CoreException(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, NLS.bind("Contributed context variable {0} must specify a resolver.", getName()), null)); //$NON-NLS-1$ } Object object = getConfigurationElement().createExecutableExtension("resolver"); //$NON-NLS-1$ if (object instanceof IDynamicVariableResolver) { fResolver = (IDynamicVariableResolver)object; } else { - throw new CoreException(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, NLS.bind("Contributed context variable resolver for {0} must be an instance of IContextVariableResolver.",new String[]{getName()}), null)); //$NON-NLS-1$ + throw new CoreException(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, NLS.bind("Contributed context variable resolver for {0} must be an instance of IContextVariableResolver.", getName()), null)); //$NON-NLS-1$ } } try { return fResolver.resolveValue(this, argument); } catch (RuntimeException e) { - throw new CoreException(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, NLS.bind("Error while evaluating variable {0}.",new String[]{getName()}), e)); //$NON-NLS-1$ + throw new CoreException(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, NLS.bind("Error while evaluating variable {0}.", getName()), e)); //$NON-NLS-1$ } } diff --git a/debug/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringSubstitutionEngine.java b/debug/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringSubstitutionEngine.java index 3f97def40de..60e56ebe03d 100644 --- a/debug/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringSubstitutionEngine.java +++ b/debug/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringSubstitutionEngine.java @@ -105,7 +105,7 @@ public String performStringSubstitution(String expression, boolean reportUndefin problemVariableList.append(", "); //$NON-NLS-1$ } problemVariableList.setLength(problemVariableList.length()-2); //truncate the last ", " - throw new CoreException(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.REFERENCE_CYCLE_ERROR, NLS.bind(VariablesMessages.StringSubstitutionEngine_4, new String[]{problemVariableList.toString()}), null)); + throw new CoreException(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.REFERENCE_CYCLE_ERROR, NLS.bind(VariablesMessages.StringSubstitutionEngine_4, problemVariableList.toString()), null)); } } @@ -260,7 +260,7 @@ private String resolve(VariableReference var, boolean reportUndefinedVariables, if (dynamicVariable == null) { // no variables with the given name if (reportUndefinedVariables) { - throw new CoreException(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, NLS.bind(VariablesMessages.StringSubstitutionEngine_3, new String[]{name}), null)); + throw new CoreException(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, NLS.bind(VariablesMessages.StringSubstitutionEngine_3, name), null)); } // leave as is return getOriginalVarText(var); @@ -283,7 +283,7 @@ private String resolve(VariableReference var, boolean reportUndefinedVariables, return getOriginalVarText(var); } // error - an argument specified for a value variable - throw new CoreException(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, NLS.bind(VariablesMessages.StringSubstitutionEngine_4, new String[]{valueVariable.getName()}), null)); + throw new CoreException(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, NLS.bind(VariablesMessages.StringSubstitutionEngine_4, valueVariable.getName()), null)); } private String getOriginalVarText(VariableReference var) { diff --git a/debug/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringVariableManager.java b/debug/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringVariableManager.java index cdb2220a050..659e1e89d95 100644 --- a/debug/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringVariableManager.java +++ b/debug/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringVariableManager.java @@ -223,7 +223,7 @@ private void loadDynamicVariables() { for (IConfigurationElement element : elements) { String name= element.getAttribute(ATTR_NAME); if (name == null) { - VariablesPlugin.logMessage(NLS.bind("Variable extension missing required 'name' attribute: {0}", new String[] {element.getDeclaringExtension().getLabel()}), null); //$NON-NLS-1$ + VariablesPlugin.logMessage(NLS.bind("Variable extension missing required 'name' attribute: {0}", element.getDeclaringExtension().getLabel()), null); //$NON-NLS-1$ continue; } String description= element.getAttribute(ATTR_DESCRIPTION); @@ -246,7 +246,7 @@ private void loadContributedValueVariables() { for (IConfigurationElement element : elements) { String name= element.getAttribute(ATTR_NAME); if (name == null) { - VariablesPlugin.logMessage(NLS.bind("Variable extension missing required 'name' attribute: {0}", new String[] {element.getDeclaringExtension().getLabel()}), null); //$NON-NLS-1$ + VariablesPlugin.logMessage(NLS.bind("Variable extension missing required 'name' attribute: {0}", element.getDeclaringExtension().getLabel()), null); //$NON-NLS-1$ continue; } String description= element.getAttribute(ATTR_DESCRIPTION); @@ -295,7 +295,7 @@ private void loadPersistedValueVariables() { if (node.getNodeType() == Node.ELEMENT_NODE) { Element element= (Element) node; if (!element.getNodeName().equals(VALUE_VARIABLE_TAG)) { - VariablesPlugin.logMessage(NLS.bind("Invalid XML element encountered while loading value variables: {0}", new String[] {node.getNodeName()}), null); //$NON-NLS-1$ + VariablesPlugin.logMessage(NLS.bind("Invalid XML element encountered while loading value variables: {0}", node.getNodeName()), null); //$NON-NLS-1$ continue; } String name= element.getAttribute(NAME_TAG); @@ -360,7 +360,7 @@ public synchronized void addVariables(IValueVariable[] variables) throws CoreExc MultiStatus status = new MultiStatus(VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, VariablesMessages.StringVariableManager_26, null); for (IValueVariable variable : variables) { if (getValueVariable(variable.getName()) != null) { - status.add(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, NLS.bind(VariablesMessages.StringVariableManager_27, new String[]{variable.getName()}), null)); + status.add(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, NLS.bind(VariablesMessages.StringVariableManager_27, variable.getName()), null)); } } if (status.isOK()) { diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationPresentationManager.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationPresentationManager.java index 3706e29cd27..046f1937095 100644 --- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationPresentationManager.java +++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationPresentationManager.java @@ -147,7 +147,8 @@ void reportReplacement(LaunchConfigurationTabGroupExtension oldext, LaunchConfig Status status = new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), NLS.bind(LaunchConfigurationsMessages.LaunchConfigurationPresentationManager_0, - new String[]{oldext.getIdentifier(), oldext.getTypeIdentifier(), mode.toString(), newext.getIdentifier()})); + oldext.getIdentifier(), oldext.getTypeIdentifier(), mode.toString(), + newext.getIdentifier())); DebugUIPlugin.log(status); } } diff --git a/debug/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/BuilderPropertyPage.java b/debug/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/BuilderPropertyPage.java index 808518efe03..56cf3b6c1bc 100644 --- a/debug/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/BuilderPropertyPage.java +++ b/debug/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/BuilderPropertyPage.java @@ -221,9 +221,9 @@ private void addBuildersToTable() { if (shell == null) { return; } - IStatus status = new Status(IStatus.ERROR, ExternalToolsPlugin.PLUGIN_ID, 0, NLS.bind(ExternalToolsUIMessages.BuilderPropertyPage_Exists, new String[]{config.getName()}), null); + IStatus status = new Status(IStatus.ERROR, ExternalToolsPlugin.PLUGIN_ID, 0, NLS.bind(ExternalToolsUIMessages.BuilderPropertyPage_Exists, config.getName()), null); ErrorDialog.openError(getShell(), ExternalToolsUIMessages.BuilderPropertyPage_errorTitle, - NLS.bind(ExternalToolsUIMessages.BuilderPropertyPage_External_Tool_Builder__0__Not_Added_2, new String[]{config.getName()}), + NLS.bind(ExternalToolsUIMessages.BuilderPropertyPage_External_Tool_Builder__0__Not_Added_2, config.getName()), status); userHasMadeChanges= true; } else { @@ -920,8 +920,7 @@ private void doPerformOk(IProgressMonitor monitor, Object[] itemData) { } catch (CoreException e) { Shell shell = getShell(); if (shell != null) { - MessageDialog.openError(shell, ExternalToolsUIMessages.BuilderPropertyPage_39, NLS.bind(ExternalToolsUIMessages.BuilderPropertyPage_40, new String[] { - workingCopy.getName() })); + MessageDialog.openError(shell, ExternalToolsUIMessages.BuilderPropertyPage_39, NLS.bind(ExternalToolsUIMessages.BuilderPropertyPage_40, workingCopy.getName())); } } } diff --git a/debug/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variables/BuildProjectResolver.java b/debug/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variables/BuildProjectResolver.java index ff96d4d1d07..5f3173c55ba 100644 --- a/debug/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variables/BuildProjectResolver.java +++ b/debug/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variables/BuildProjectResolver.java @@ -38,7 +38,7 @@ public String resolveValue(IDynamicVariable variable, String argument) throws Co if (resource != null && resource.exists()) { return resource.getLocation().toOSString(); } - abort(NLS.bind(VariableMessages.BuildProjectResolver_3, new String[]{getReferenceExpression(variable, argument)}), null); + abort(NLS.bind(VariableMessages.BuildProjectResolver_3, getReferenceExpression(variable, argument)), null); return null; } diff --git a/resources/bundles/org.eclipse.core.resources/META-INF/MANIFEST.MF b/resources/bundles/org.eclipse.core.resources/META-INF/MANIFEST.MF index aa042e2f420..33f9280afc5 100644 --- a/resources/bundles/org.eclipse.core.resources/META-INF/MANIFEST.MF +++ b/resources/bundles/org.eclipse.core.resources/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.core.resources; singleton:=true -Bundle-Version: 3.22.200.qualifier +Bundle-Version: 3.22.300.qualifier Bundle-Activator: org.eclipse.core.resources.ResourcesPlugin Bundle-Vendor: %providerName Bundle-Localization: plugin diff --git a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/ProjectDescriptionReader.java b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/ProjectDescriptionReader.java index 5b968235e76..1a3f9222f42 100644 --- a/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/ProjectDescriptionReader.java +++ b/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/ProjectDescriptionReader.java @@ -536,7 +536,7 @@ private void endMatcherElement(String elementName) { String id = (String) matcher[0]; // the id can't be null if (id == null) { - parseProblem(NLS.bind(Messages.projRead_badFilterID, null)); + parseProblem(NLS.bind(Messages.projRead_badFilterID)); return; } diff --git a/team/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/patch/FileDiffResult.java b/team/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/patch/FileDiffResult.java index 9aed0aa27e8..3c759d55d64 100644 --- a/team/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/patch/FileDiffResult.java +++ b/team/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/patch/FileDiffResult.java @@ -13,12 +13,23 @@ *******************************************************************************/ package org.eclipse.compare.internal.core.patch; -import java.io.*; -import java.util.*; +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import org.eclipse.compare.internal.core.Messages; -import org.eclipse.compare.patch.*; -import org.eclipse.core.runtime.*; +import org.eclipse.compare.patch.IFilePatchResult; +import org.eclipse.compare.patch.IHunk; +import org.eclipse.compare.patch.PatchConfiguration; +import org.eclipse.compare.patch.ReaderCreator; +import org.eclipse.core.runtime.ILog; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.osgi.util.NLS; public class FileDiffResult implements IFilePatchResult { @@ -182,7 +193,7 @@ public boolean containsProblems() { public String getLabel() { String label= getTargetPath().toString(); if (this.fDiffProblem) - return NLS.bind(Messages.FileDiffResult_2, new String[] {label, this.fErrorMessage}); + return NLS.bind(Messages.FileDiffResult_2, label, this.fErrorMessage); return label; } @@ -221,7 +232,7 @@ public int calculateFuzz(List lines, IProgressMonitor monitor) { IHunk[] hunks = this.fDiff.getHunks(); for (int j = 0; j < hunks.length; j++) { Hunk h = (Hunk) hunks[j]; - monitor.subTask(NLS.bind(Messages.FileDiffResult_3, new String[] {name, Integer.toString(j + 1)})); + monitor.subTask(NLS.bind(Messages.FileDiffResult_3, name, Integer.toString(j + 1))); HunkResult result = getHunkResult(h); result.setShift(shift); int fuzz = result.calculateFuzz(lines, monitor); diff --git a/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchCompareEditorInput.java b/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchCompareEditorInput.java index 067beac9139..74b4e3c33ce 100644 --- a/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchCompareEditorInput.java +++ b/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchCompareEditorInput.java @@ -84,38 +84,39 @@ public String getText(Object element) { if (node instanceof PatchProjectDiffNode) { PatchProjectDiffNode projectNode = (PatchProjectDiffNode) node; if (!Utilities.getProject(projectNode.getDiffProject()).exists()) { - text = NLS.bind(PatchMessages.Diff_2Args, new String[]{text, PatchMessages.PreviewPatchLabelDecorator_ProjectDoesNotExist}); + text = NLS.bind(PatchMessages.Diff_2Args, text, + PatchMessages.PreviewPatchLabelDecorator_ProjectDoesNotExist); } } if (!node.isEnabled()) { return NLS.bind(PatchMessages.Diff_2Args, - new String[]{text, PatchMessages.PatcherCompareEditorInput_NotIncluded}); + text, PatchMessages.PatcherCompareEditorInput_NotIncluded); } if (node instanceof PatchFileDiffNode) { PatchFileDiffNode fileNode = (PatchFileDiffNode) node; if (getPatcher().hasCachedContents(fileNode.getDiffResult().getDiff())) { - text = NLS.bind(PatchMessages.Diff_2Args, new String[] {text, PatchMessages.HunkMergePage_Merged}); + text = NLS.bind(PatchMessages.Diff_2Args, text, PatchMessages.HunkMergePage_Merged); } if (!fileNode.fileExists()) { - text = NLS.bind(PatchMessages.Diff_2Args, new String[] {text, PatchMessages.PatchCompareEditorInput_0}); + text = NLS.bind(PatchMessages.Diff_2Args, text, PatchMessages.PatchCompareEditorInput_0); } } if (node instanceof HunkDiffNode) { HunkDiffNode hunkNode = (HunkDiffNode) node; if (hunkNode.isManuallyMerged()) { - text = NLS.bind(PatchMessages.Diff_2Args, new String[] {text, PatchMessages.HunkMergePage_Merged}); + text = NLS.bind(PatchMessages.Diff_2Args, text, PatchMessages.HunkMergePage_Merged); } if (hunkNode.isFuzzUsed()) { text = NLS.bind(PatchMessages.Diff_2Args, - new String[] { text, + text, NLS.bind(hunkNode.isAllContextIgnored() ? PatchMessages.PreviewPatchPage_AllContextIgnored : PatchMessages.PreviewPatchPage_FuzzUsed, - new String[] { hunkNode.getHunkResult().getFuzz() + ""}) }); //$NON-NLS-1$ + hunkNode.getHunkResult().getFuzz() + "")); //$NON-NLS-1$ } } if (getPatcher().isRetargeted(node.getPatchElement())) return NLS.bind(PatchMessages.Diff_2Args, - new String[]{getPatcher().getOriginalPath(node.getPatchElement()).toString(), - NLS.bind(PatchMessages.PreviewPatchPage_Target, new String[]{node.getName()})}); + getPatcher().getOriginalPath(node.getPatchElement()).toString(), + NLS.bind(PatchMessages.PreviewPatchPage_Target, node.getName())); } return text; } diff --git a/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PreviewPatchPage2.java b/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PreviewPatchPage2.java index 91df1365e72..091ab787e5a 100644 --- a/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PreviewPatchPage2.java +++ b/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PreviewPatchPage2.java @@ -730,7 +730,7 @@ private String countLines() { } return NLS.bind(PatchMessages.PreviewPatchPage2_AddedRemovedLines, - new String[] { added + "", removed + "" }); //$NON-NLS-1$ //$NON-NLS-2$ + added + "", removed + ""); //$NON-NLS-1$ //$NON-NLS-2$ } @Override diff --git a/team/bundles/org.eclipse.team.core/src/org/eclipse/team/core/RepositoryProvider.java b/team/bundles/org.eclipse.team.core/src/org/eclipse/team/core/RepositoryProvider.java index 4efb16ea326..ed6d0471f7b 100644 --- a/team/bundles/org.eclipse.team.core/src/org/eclipse/team/core/RepositoryProvider.java +++ b/team/bundles/org.eclipse.team.core/src/org/eclipse/team/core/RepositoryProvider.java @@ -156,7 +156,9 @@ public static void map(IProject project, String id) throws TeamException { project.setSessionProperty(TeamPlugin.PROVIDER_PROP_KEY, null); } catch (CoreException inner) { // something is seriously wrong - TeamPlugin.log(IStatus.ERROR, NLS.bind(Messages.RepositoryProvider_couldNotClearAfterError, new String[] { project.getName(), id }), inner); + TeamPlugin.log(IStatus.ERROR, + NLS.bind(Messages.RepositoryProvider_couldNotClearAfterError, project.getName(), id), + inner); } throw outer; } @@ -195,7 +197,8 @@ private static RepositoryProvider mapNewProvider(final IProject project, final S final RepositoryProvider provider = newProvider(id); // instantiate via extension point if(provider == null) - throw new TeamException(NLS.bind(Messages.RepositoryProvider_couldNotInstantiateProvider, new String[] { project.getName(), id })); + throw new TeamException( + NLS.bind(Messages.RepositoryProvider_couldNotInstantiateProvider, project.getName(), id)); // validate that either the provider supports linked resources or the project has no linked resources if (!provider.canHandleLinkedResourceURI()) { @@ -205,7 +208,10 @@ private static RepositoryProvider mapNewProvider(final IProject project, final S if (!provider.canHandleLinkedResources() || proxy.requestFullPath().segmentCount() > 2 || !EFS.SCHEME_FILE.equals(proxy.requestResource().getLocationURI().getScheme())) - throw new TeamException(new Status(IStatus.ERROR, TeamPlugin.ID, IResourceStatus.LINKING_NOT_ALLOWED, NLS.bind(Messages.RepositoryProvider_linkedURIsExist, new String[] { project.getName(), id }), null)); + throw new TeamException(new Status(IStatus.ERROR, TeamPlugin.ID, + IResourceStatus.LINKING_NOT_ALLOWED, + NLS.bind(Messages.RepositoryProvider_linkedURIsExist, project.getName(), id), + null)); } return true; }, IResource.NONE); @@ -222,7 +228,10 @@ private static RepositoryProvider mapNewProvider(final IProject project, final S IResource[] members = project.members(); for (IResource resource : members) { if (resource.isLinked()) { - throw new TeamException(new Status(IStatus.ERROR, TeamPlugin.ID, IResourceStatus.LINKING_NOT_ALLOWED, NLS.bind(Messages.RepositoryProvider_linkedResourcesExist, new String[] { project.getName(), id }), null)); + throw new TeamException(new Status(IStatus.ERROR, TeamPlugin.ID, + IResourceStatus.LINKING_NOT_ALLOWED, + NLS.bind(Messages.RepositoryProvider_linkedResourcesExist, project.getName(), id), + null)); } } } catch (CoreException e) { @@ -283,7 +292,8 @@ public static void unmap(IProject project) throws TeamException { //If you tried to remove a non-existant nature it would fail, so we need to as well with the persistent prop if(id == null) { - throw new TeamException(NLS.bind(Messages.RepositoryProvider_No_Provider_Registered, new String[] { project.getName() })); + throw new TeamException( + NLS.bind(Messages.RepositoryProvider_No_Provider_Registered, project.getName())); } //This will instantiate one if it didn't already exist, @@ -293,7 +303,9 @@ public static void unmap(IProject project) throws TeamException { // There is a persistent property but the provider cannot be obtained. // The reason could be that the provider's plugin is no longer available. // Better log it just in case this is unexpected. - TeamPlugin.log(IStatus.ERROR, NLS.bind(Messages.RepositoryProvider_couldNotInstantiateProvider, new String[] { project.getName(), id }), null); + TeamPlugin.log(IStatus.ERROR, + NLS.bind(Messages.RepositoryProvider_couldNotInstantiateProvider, project.getName(), id), + null); } if (provider != null) provider.deconfigure(); @@ -486,7 +498,7 @@ public IMoveDeleteHook getMoveDeleteHook() { */ @Override public String toString() { - return NLS.bind(Messages.RepositoryProvider_toString, new String[] { getProject().getName(), getID() }); + return NLS.bind(Messages.RepositoryProvider_toString, getProject().getName(), getID()); } /** @@ -739,7 +751,8 @@ private static RepositoryProvider newProvider(String id) { TeamPlugin.log(e); } catch (ClassCastException e) { String className = configElement.getAttribute("class"); //$NON-NLS-1$ - TeamPlugin.log(IStatus.ERROR, NLS.bind(Messages.RepositoryProvider_invalidClass, new String[] { id, className }), e); + TeamPlugin.log(IStatus.ERROR, + NLS.bind(Messages.RepositoryProvider_invalidClass, id, className), e); } return null; } @@ -773,7 +786,9 @@ public IStatus validateCreateLink(IResource resource, int updateFlags, IPath loc if (canHandleLinkedResources()) { return Team.OK_STATUS; } else { - return new Status(IStatus.ERROR, TeamPlugin.ID, IResourceStatus.LINKING_NOT_ALLOWED, NLS.bind(Messages.RepositoryProvider_linkedResourcesNotSupported, new String[] { getProject().getName(), getID() }), null); + return new Status(IStatus.ERROR, TeamPlugin.ID, IResourceStatus.LINKING_NOT_ALLOWED, + NLS.bind(Messages.RepositoryProvider_linkedResourcesNotSupported, getProject().getName(), getID()), + null); } } @@ -803,7 +818,9 @@ public IStatus validateCreateLink(IResource resource, int updateFlags, URI locat if (canHandleLinkedResourceURI()) { return Team.OK_STATUS; } else { - return new Status(IStatus.ERROR, TeamPlugin.ID, IResourceStatus.LINKING_NOT_ALLOWED, NLS.bind(Messages.RepositoryProvider_linkedURIsNotSupported, new String[] { getProject().getName(), getID() }), null); + return new Status(IStatus.ERROR, TeamPlugin.ID, IResourceStatus.LINKING_NOT_ALLOWED, + NLS.bind(Messages.RepositoryProvider_linkedURIsNotSupported, getProject().getName(), getID()), + null); } } diff --git a/team/bundles/org.eclipse.team.core/src/org/eclipse/team/core/diff/provider/ThreeWayDiff.java b/team/bundles/org.eclipse.team.core/src/org/eclipse/team/core/diff/provider/ThreeWayDiff.java index 2a94771091e..07d3379318a 100644 --- a/team/bundles/org.eclipse.team.core/src/org/eclipse/team/core/diff/provider/ThreeWayDiff.java +++ b/team/bundles/org.eclipse.team.core/src/org/eclipse/team/core/diff/provider/ThreeWayDiff.java @@ -105,7 +105,7 @@ public String toDiffString() { label = super.toDiffString(); } else { label = SyncInfoToDiffConverter.diffDirectionToString(getDirection()); - label = NLS.bind(Messages.concatStrings, new String[] { label, super.toDiffString() }); + label = NLS.bind(Messages.concatStrings, label, super.toDiffString()); } return label; } diff --git a/team/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/DelegatingStorageMerger.java b/team/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/DelegatingStorageMerger.java index 213fad098da..d385011c749 100644 --- a/team/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/DelegatingStorageMerger.java +++ b/team/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/DelegatingStorageMerger.java @@ -91,7 +91,7 @@ public IStatus merge(OutputStream output, String outputEncoding, Messages.DelegatingStorageMerger_0, null); if (ancestor == null && !merger.canMergeWithoutAncestor()) { return new Status(IStatus.WARNING, TeamPlugin.ID, CONFLICT, - NLS.bind(Messages.MergeContext_1, new String[] { target.getFullPath().toString() }), null); + NLS.bind(Messages.MergeContext_1, target.getFullPath().toString()), null); } return merger.merge(output, outputEncoding, ancestor, target, other, monitor); } diff --git a/team/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/provider/MergeContext.java b/team/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/provider/MergeContext.java index e49c8a56e79..844db51b941 100644 --- a/team/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/provider/MergeContext.java +++ b/team/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/provider/MergeContext.java @@ -180,7 +180,8 @@ public IStatus merge(IDiff diff, boolean ignoreLocalChanges, IProgressMonitor mo if (remote == null || !getLocalFile(diff).exists()) { // Nothing we can do so return a conflict status // TODO: Should we handle the case where the local and remote have the same contents for a conflicting addition? - return new MergeStatus(TeamPlugin.ID, NLS.bind(Messages.MergeContext_1, new String[] { diff.getPath().toString() }), new IFile[] { getLocalFile(diff) }); + return new MergeStatus(TeamPlugin.ID, NLS.bind(Messages.MergeContext_1, diff.getPath().toString()), + new IFile[] { getLocalFile(diff) }); } // We have a conflict, a local, base and remote so we can do // a three-way merge @@ -268,7 +269,8 @@ private OutputStream getTempOutputStream(IFile file) throws CoreException { try { return new BufferedOutputStream(new FileOutputStream(tmpFile)); } catch (FileNotFoundException e) { - TeamPlugin.log(IStatus.ERROR, NLS.bind("Could not open temporary file {0} for writing: {1}", new String[] { tmpFile.getAbsolutePath(), e.getMessage() }), e); //$NON-NLS-1$ + TeamPlugin.log(IStatus.ERROR, NLS.bind("Could not open temporary file {0} for writing: {1}", //$NON-NLS-1$ + tmpFile.getAbsolutePath(), e.getMessage()), e); return new ByteArrayOutputStream(); } } @@ -290,7 +292,8 @@ private InputStream getTempInputStream(IFile file, OutputStream output) throws C try { return new BufferedInputStream(new FileInputStream(tmpFile)); } catch (FileNotFoundException e) { - throw new CoreException(new Status(IStatus.ERROR, TeamPlugin.ID, IMergeStatus.INTERNAL_ERROR, NLS.bind(Messages.MergeContext_4, new String[] { tmpFile.getAbsolutePath(), e.getMessage() }), e)); + throw new CoreException(new Status(IStatus.ERROR, TeamPlugin.ID, IMergeStatus.INTERNAL_ERROR, + NLS.bind(Messages.MergeContext_4, tmpFile.getAbsolutePath(), e.getMessage()), e)); } } diff --git a/team/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/Subscriber.java b/team/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/Subscriber.java index c8b9a07472b..d4fc0e9d730 100644 --- a/team/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/Subscriber.java +++ b/team/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/Subscriber.java @@ -326,11 +326,13 @@ private void collect( : IResource.DEPTH_ZERO, set, monitor); } } catch (TeamException e) { - set.addError(new TeamStatus(IStatus.ERROR, TeamPlugin.ID, ITeamStatus.SYNC_INFO_SET_ERROR, NLS.bind(Messages.SubscriberEventHandler_8, new String[] { resource.getFullPath().toString(), e.getMessage() }), e, resource)); + set.addError(new TeamStatus(IStatus.ERROR, TeamPlugin.ID, ITeamStatus.SYNC_INFO_SET_ERROR, + NLS.bind(Messages.SubscriberEventHandler_8, resource.getFullPath().toString(), e.getMessage()), + e, resource)); } } - monitor.subTask(NLS.bind(Messages.SubscriberEventHandler_2, new String[] { resource.getFullPath().toString() })); + monitor.subTask(NLS.bind(Messages.SubscriberEventHandler_2, resource.getFullPath().toString())); try { SyncInfo info = getSyncInfo(resource); if (info == null || info.getKind() == SyncInfo.IN_SYNC) { @@ -343,7 +345,7 @@ private void collect( } catch (TeamException e) { set.addError(new TeamStatus( IStatus.ERROR, TeamPlugin.ID, ITeamStatus.RESOURCE_SYNC_INFO_ERROR, - NLS.bind(Messages.SubscriberEventHandler_9, new String[] { resource.getFullPath().toString(), e.getMessage() }), + NLS.bind(Messages.SubscriberEventHandler_9, resource.getFullPath().toString(), e.getMessage()), e, resource)); } // Tick the monitor to give the owner a chance to do something diff --git a/team/bundles/org.eclipse.team.core/src/org/eclipse/team/core/synchronize/SyncInfo.java b/team/bundles/org.eclipse.team.core/src/org/eclipse/team/core/synchronize/SyncInfo.java index e7ce2bf7ff2..09318761d5b 100644 --- a/team/bundles/org.eclipse.team.core/src/org/eclipse/team/core/synchronize/SyncInfo.java +++ b/team/bundles/org.eclipse.team.core/src/org/eclipse/team/core/synchronize/SyncInfo.java @@ -376,18 +376,24 @@ public static String kindToString(int kind) { case INCOMING: label = Messages.RemoteSyncElement_incoming; break; } switch(kind & CHANGE_MASK) { - case CHANGE: label = NLS.bind(Messages.concatStrings, new String[] { label, Messages.RemoteSyncElement_change }); break; // - case ADDITION: label = NLS.bind(Messages.concatStrings, new String[] { label, Messages.RemoteSyncElement_addition }); break; // - case DELETION: label = NLS.bind(Messages.concatStrings, new String[] { label, Messages.RemoteSyncElement_deletion }); break; // + case CHANGE: + label = NLS.bind(Messages.concatStrings, label, Messages.RemoteSyncElement_change); + break; // + case ADDITION: + label = NLS.bind(Messages.concatStrings, label, Messages.RemoteSyncElement_addition); + break; // + case DELETION: + label = NLS.bind(Messages.concatStrings, label, Messages.RemoteSyncElement_deletion); + break; // } if((kind & MANUAL_CONFLICT) != 0) { - label = NLS.bind(Messages.concatStrings, new String[] { label, Messages.RemoteSyncElement_manual }); // + label = NLS.bind(Messages.concatStrings, label, Messages.RemoteSyncElement_manual); // } if((kind & AUTOMERGE_CONFLICT) != 0) { - label = NLS.bind(Messages.concatStrings, new String[] { label, Messages.RemoteSyncElement_auto }); // + label = NLS.bind(Messages.concatStrings, label, Messages.RemoteSyncElement_auto); // } } - return NLS.bind(Messages.RemoteSyncElement_delimit, new String[] { label }); + return NLS.bind(Messages.RemoteSyncElement_delimit, label); } /** diff --git a/team/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/AbstractResourceVariantTree.java b/team/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/AbstractResourceVariantTree.java index e1cd255e0e0..87850e26e80 100644 --- a/team/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/AbstractResourceVariantTree.java +++ b/team/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/AbstractResourceVariantTree.java @@ -93,7 +93,8 @@ protected IResource[] refresh(IResource resource, int depth, IProgressMonitor mo IResource[] changedResources = null; monitor.beginTask(null, 100); try { - monitor.setTaskName(NLS.bind(Messages.SynchronizationCacheRefreshOperation_0, new String[] { resource.getFullPath().makeRelative().toString() })); + monitor.setTaskName(NLS.bind(Messages.SynchronizationCacheRefreshOperation_0, + resource.getFullPath().makeRelative().toString())); // build the remote tree only if an initial tree hasn't been provided IResourceVariant tree = fetchVariant(resource, depth, Policy.subMonitorFor(monitor, 70)); diff --git a/team/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/CachedResourceVariant.java b/team/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/CachedResourceVariant.java index 97a1f7a23f4..7cb31a04805 100644 --- a/team/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/CachedResourceVariant.java +++ b/team/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/CachedResourceVariant.java @@ -76,7 +76,7 @@ public InputStream getContents() throws CoreException { if (!isContentsCached()) { // The cache may have been cleared if someone held // on to the storage too long - throw new TeamException(NLS.bind(Messages.CachedResourceVariant_0, new String[] { getCachePath() })); + throw new TeamException(NLS.bind(Messages.CachedResourceVariant_0, getCachePath())); } return getCachedContents(); } @@ -102,7 +102,9 @@ public String getCharset() throws CoreException { String charSet = TeamPlugin.getCharset(getName(), contents); return charSet; } catch (IOException e) { - throw new TeamException(new Status(IStatus.ERROR, TeamPlugin.ID, IResourceStatus.FAILED_DESCRIBING_CONTENTS, NLS.bind(Messages.CachedResourceVariant_1, new String[] { getFullPath().toString() }), e)); + throw new TeamException( + new Status(IStatus.ERROR, TeamPlugin.ID, IResourceStatus.FAILED_DESCRIBING_CONTENTS, + NLS.bind(Messages.CachedResourceVariant_1, getFullPath().toString()), e)); } } } diff --git a/team/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/ResourceVariantTreeSubscriber.java b/team/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/ResourceVariantTreeSubscriber.java index ea88f25f459..654ceb124ae 100644 --- a/team/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/ResourceVariantTreeSubscriber.java +++ b/team/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/ResourceVariantTreeSubscriber.java @@ -187,11 +187,12 @@ private IStatus refresh(IResource resource, int depth, IProgressMonitor monitor) fireTeamResourceChange(SubscriberChangeEvent.asSyncChangedDeltas(this, changedResources)); return Status.OK_STATUS; } catch (TeamException e) { - return new TeamStatus(IStatus.ERROR, TeamPlugin.ID, 0, NLS.bind(Messages.ResourceVariantTreeSubscriber_2, new String[] { resource.getFullPath().toString(), e.getMessage() }), e, resource); + return new TeamStatus(IStatus.ERROR, TeamPlugin.ID, 0, NLS.bind(Messages.ResourceVariantTreeSubscriber_2, + resource.getFullPath().toString(), e.getMessage()), e, resource); } catch (OperationCanceledException e) { return new TeamStatus(IStatus.CANCEL, TeamPlugin.ID, 0, NLS.bind( Messages.ResourceVariantTreeSubscriber_4, - new String[] { resource.getFullPath().toString() }), e, + resource.getFullPath().toString()), e, resource); } finally { monitor.done(); diff --git a/team/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/DefaultFileModificationValidator.java b/team/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/DefaultFileModificationValidator.java index 200035bfa78..6e371c23d17 100644 --- a/team/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/DefaultFileModificationValidator.java +++ b/team/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/DefaultFileModificationValidator.java @@ -43,7 +43,9 @@ public class DefaultFileModificationValidator extends FileModificationValidator protected IStatus getDefaultStatus(IFile file) { return file.isReadOnly() - ? new TeamStatus(IStatus.ERROR, TeamPlugin.ID, ITeamStatus.READ_ONLY_LOCAL, NLS.bind(Messages.FileModificationValidator_fileIsReadOnly, new String[] { file.getFullPath().toString() }), null, file) + ? new TeamStatus(IStatus.ERROR, TeamPlugin.ID, ITeamStatus.READ_ONLY_LOCAL, + NLS.bind(Messages.FileModificationValidator_fileIsReadOnly, file.getFullPath().toString()), + null, file) : Status.OK_STATUS; } diff --git a/team/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/ResourceVariantCache.java b/team/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/ResourceVariantCache.java index 848d3313cc4..2c159445e5b 100644 --- a/team/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/ResourceVariantCache.java +++ b/team/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/ResourceVariantCache.java @@ -166,7 +166,7 @@ private synchronized void createCacheDirectory() { } } if (! file.exists() && ! file.mkdirs()) { - TeamPlugin.log(new TeamException(NLS.bind(Messages.RemoteContentsCache_fileError, new String[] { file.getAbsolutePath() }))); + TeamPlugin.log(new TeamException(NLS.bind(Messages.RemoteContentsCache_fileError, file.getAbsolutePath()))); } cacheEntries = new HashMap<>(); lastCacheCleanup = -1; @@ -193,14 +193,14 @@ private void deleteFile(File file) throws TeamException { if (file.isDirectory()) { File[] children = file.listFiles(); if(children == null) { - throw new TeamException(NLS.bind(Messages.RemoteContentsCache_fileError, new String[] { file.getAbsolutePath() })); + throw new TeamException(NLS.bind(Messages.RemoteContentsCache_fileError, file.getAbsolutePath())); } for (File f : children) { deleteFile(f); } } if (! file.delete()) { - throw new TeamException(NLS.bind(Messages.RemoteContentsCache_fileError, new String[] { file.getAbsolutePath() })); + throw new TeamException(NLS.bind(Messages.RemoteContentsCache_fileError, file.getAbsolutePath())); } } @@ -215,7 +215,7 @@ protected void purgeFromCache(ResourceVariantCacheEntry entry) { private synchronized ResourceVariantCacheEntry internalGetCacheEntry(String id) { if (cacheEntries == null) { // This probably means that the cache has been disposed - throw new IllegalStateException(NLS.bind(Messages.RemoteContentsCache_cacheDisposed, new String[] { name })); + throw new IllegalStateException(NLS.bind(Messages.RemoteContentsCache_cacheDisposed, name)); } ResourceVariantCacheEntry entry = cacheEntries.get(id); if (entry != null) { diff --git a/team/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/ResourceVariantCacheEntry.java b/team/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/ResourceVariantCacheEntry.java index 8fd766329df..b63e8bbc820 100644 --- a/team/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/ResourceVariantCacheEntry.java +++ b/team/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/ResourceVariantCacheEntry.java @@ -73,7 +73,7 @@ public InputStream getContents() throws TeamException { } } catch (IOException e) { // We will end up here if we couldn't read or delete the cache file - throw new TeamException(NLS.bind(Messages.RemoteContentsCache_fileError, new String[] { ioFile.getAbsolutePath() }), e); + throw new TeamException(NLS.bind(Messages.RemoteContentsCache_fileError, ioFile.getAbsolutePath()), e); } // This can occur when there is no remote contents return new ByteArrayInputStream(new byte[0]); @@ -112,7 +112,7 @@ private void beginOperation() { private void internalSetContents(InputStream stream, IProgressMonitor monitor) throws TeamException { // if the state is DISPOSED then there is a problem if (state == DISPOSED) { - throw new TeamException(NLS.bind(Messages.RemoteContentsCacheEntry_3, new String[] { cache.getName(), id })); + throw new TeamException(NLS.bind(Messages.RemoteContentsCacheEntry_3, cache.getName(), id)); } // Otherwise, the state is UNINITIALIZED or READY so we can proceed registerHit(); @@ -134,7 +134,7 @@ private void internalSetContents(InputStream stream, IProgressMonitor monitor) t } } catch (FileNotFoundException e) { throw new TeamException( - NLS.bind(Messages.RemoteContentsCache_fileError, new String[] { ioFile.getAbsolutePath() }), e); + NLS.bind(Messages.RemoteContentsCache_fileError, ioFile.getAbsolutePath()), e); } catch (IOException e) { // Make sure we don't leave the cache file around as it may not have the right // contents @@ -145,7 +145,7 @@ private void internalSetContents(InputStream stream, IProgressMonitor monitor) t // Mark the cache entry as ready state = READY; } catch (IOException e) { - throw new TeamException(NLS.bind(Messages.RemoteContentsCache_fileError, new String[] { ioFile.getAbsolutePath() }), e); + throw new TeamException(NLS.bind(Messages.RemoteContentsCache_fileError, ioFile.getAbsolutePath()), e); } finally { try { stream.close(); diff --git a/team/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/ActiveChangeSetManager.java b/team/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/ActiveChangeSetManager.java index ce63e5216b8..76bcd97801c 100644 --- a/team/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/ActiveChangeSetManager.java +++ b/team/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/ActiveChangeSetManager.java @@ -332,7 +332,7 @@ protected void save(Preferences prefs) { prefs.node(string).removeNode(); } } catch (BackingStoreException e) { - TeamPlugin.log(IStatus.ERROR, NLS.bind(Messages.SubscriberChangeSetCollector_5, new String[] { getName() }), e); + TeamPlugin.log(IStatus.ERROR, NLS.bind(Messages.SubscriberChangeSetCollector_5, getName()), e); } ChangeSet[] sets = getSets(); for (ChangeSet set : sets) { @@ -354,7 +354,7 @@ protected void save(Preferences prefs) { try { prefs.flush(); } catch (BackingStoreException e) { - TeamPlugin.log(IStatus.ERROR, NLS.bind(Messages.SubscriberChangeSetCollector_3, new String[] { getName() }), e); + TeamPlugin.log(IStatus.ERROR, NLS.bind(Messages.SubscriberChangeSetCollector_3, getName()), e); } } @@ -406,7 +406,7 @@ protected void load(Preferences prefs) { } } } catch (BackingStoreException e) { - TeamPlugin.log(IStatus.ERROR, NLS.bind(Messages.SubscriberChangeSetCollector_4, new String[] { getName() }), e); + TeamPlugin.log(IStatus.ERROR, NLS.bind(Messages.SubscriberChangeSetCollector_4, getName()), e); } } diff --git a/team/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/SubscriberChangeSetManager.java b/team/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/SubscriberChangeSetManager.java index bc7d48f4f9c..f9d74b83495 100644 --- a/team/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/SubscriberChangeSetManager.java +++ b/team/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/SubscriberChangeSetManager.java @@ -262,7 +262,8 @@ protected boolean hasMembers(IResource resource) { public SubscriberChangeSetManager(Subscriber subscriber) { collector = new ResourceCollector(subscriber); - handler = new EventHandler(NLS.bind(Messages.SubscriberChangeSetCollector_1, new String[] { subscriber.getName() }), NLS.bind(Messages.SubscriberChangeSetCollector_2, new String[] { subscriber.getName() })); // + handler = new EventHandler(NLS.bind(Messages.SubscriberChangeSetCollector_1, subscriber.getName()), + NLS.bind(Messages.SubscriberChangeSetCollector_2, subscriber.getName())); } @Override diff --git a/team/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/SubscriberEventHandler.java b/team/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/SubscriberEventHandler.java index ab691daaaa0..2ba445324b3 100644 --- a/team/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/SubscriberEventHandler.java +++ b/team/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/SubscriberEventHandler.java @@ -95,8 +95,8 @@ public ResourceTraversal asTraversal() { */ public SubscriberEventHandler(Subscriber subscriber, ISynchronizationScope scope) { super( - NLS.bind(Messages.SubscriberEventHandler_jobName, new String[] { subscriber.getName() }), - NLS.bind(Messages.SubscriberEventHandler_errors, new String[] { subscriber.getName() })); + NLS.bind(Messages.SubscriberEventHandler_jobName, subscriber.getName()), + NLS.bind(Messages.SubscriberEventHandler_errors, subscriber.getName())); this.subscriber = subscriber; this.scope = scope; scopeChangeListener = (scope1, newMappings, newTraversals) -> reset(new ResourceTraversal[0], scope1.getTraversals()); @@ -208,16 +208,18 @@ private void collect( // We only handle the exception if the resource's project is accessible. // The project close delta will clean up. if (resource.getProject().isAccessible()) - handleException(e, resource, ITeamStatus.SYNC_INFO_SET_ERROR, NLS.bind(Messages.SubscriberEventHandler_8, new String[] { resource.getFullPath().toString(), e.getMessage() })); + handleException(e, resource, ITeamStatus.SYNC_INFO_SET_ERROR, NLS.bind( + Messages.SubscriberEventHandler_8, resource.getFullPath().toString(), e.getMessage())); } } - monitor.subTask(NLS.bind(Messages.SubscriberEventHandler_2, new String[] { resource.getFullPath().toString() })); + monitor.subTask(NLS.bind(Messages.SubscriberEventHandler_2, resource.getFullPath().toString())); try { handleChange(resource); handlePendingDispatch(monitor); } catch (CoreException e) { - handleException(e, resource, ITeamStatus.RESOURCE_SYNC_INFO_ERROR, NLS.bind(Messages.SubscriberEventHandler_9, new String[] { resource.getFullPath().toString(), e.getMessage() })); + handleException(e, resource, ITeamStatus.RESOURCE_SYNC_INFO_ERROR, + NLS.bind(Messages.SubscriberEventHandler_9, resource.getFullPath().toString(), e.getMessage())); } monitor.worked(1); } @@ -309,7 +311,8 @@ protected void processEvent(Event event, IProgressMonitor monitor) { monitor); break; case SubscriberEvent.INITIALIZE : - monitor.subTask(NLS.bind(Messages.SubscriberEventHandler_2, new String[] { event.getResource().getFullPath().toString() })); + monitor.subTask( + NLS.bind(Messages.SubscriberEventHandler_2, event.getResource().getFullPath().toString())); collectAll( event.getResource(), ((ResourceEvent)event).getDepth(), @@ -327,7 +330,9 @@ protected void processEvent(Event event, IProgressMonitor monitor) { if (event.getType() == BackgroundEventHandler.RUNNABLE_EVENT ) { handleException(new TeamException(Messages.SubscriberEventHandler_10, e)); } else { - handleException(new TeamException(Messages.SubscriberEventHandler_10, e), event.getResource(), ITeamStatus.SYNC_INFO_SET_ERROR, NLS.bind(Messages.SubscriberEventHandler_11, new String[] { event.getResource().getFullPath().toString(), e.getMessage() })); + handleException(new TeamException(Messages.SubscriberEventHandler_10, e), event.getResource(), + ITeamStatus.SYNC_INFO_SET_ERROR, NLS.bind(Messages.SubscriberEventHandler_11, + event.getResource().getFullPath().toString(), e.getMessage())); } } } diff --git a/team/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/SyncByteConverter.java b/team/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/SyncByteConverter.java index a61d77d51a0..21d95300a51 100644 --- a/team/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/SyncByteConverter.java +++ b/team/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/SyncByteConverter.java @@ -34,7 +34,7 @@ public class SyncByteConverter { public static byte[] setSlot(byte[] syncBytes, int slot, byte[] newBytes) throws TeamException { int start = startOfSlot(syncBytes, slot); if (start == -1) { - throw new TeamException(NLS.bind(Messages.SyncByteConverter_1, new String[] { new String(syncBytes) })); + throw new TeamException(NLS.bind(Messages.SyncByteConverter_1, new String(syncBytes))); } int end = startOfSlot(syncBytes, slot + 1); int totalLength = start + 1 + newBytes.length; diff --git a/team/bundles/org.eclipse.team.ui/META-INF/MANIFEST.MF b/team/bundles/org.eclipse.team.ui/META-INF/MANIFEST.MF index 3bd12874e5f..2282a033267 100644 --- a/team/bundles/org.eclipse.team.ui/META-INF/MANIFEST.MF +++ b/team/bundles/org.eclipse.team.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.team.ui; singleton:=true -Bundle-Version: 3.11.100.qualifier +Bundle-Version: 3.11.200.qualifier Bundle-Activator: org.eclipse.team.internal.ui.TeamUIPlugin Bundle-Vendor: %providerName Bundle-Localization: plugin diff --git a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/DefaultUIFileModificationValidator.java b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/DefaultUIFileModificationValidator.java index 3071b413b9b..ded6ada125e 100644 --- a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/DefaultUIFileModificationValidator.java +++ b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/DefaultUIFileModificationValidator.java @@ -121,7 +121,7 @@ public IStatus validateEdit(final IFile[] allFiles, FileModificationValidationCo final Shell shell = getShell(context); final boolean[] ok = new boolean[] { false }; if (readOnlyFiles.length == 1) { - syncExec(() -> ok[0] = MessageDialog.openQuestion(shell, TeamUIMessages.DefaultUIFileModificationValidator_3, NLS.bind(TeamUIMessages.DefaultUIFileModificationValidator_4, new String[] { readOnlyFiles[0].getFullPath().toString() }))); + syncExec(() -> ok[0] = MessageDialog.openQuestion(shell, TeamUIMessages.DefaultUIFileModificationValidator_3, NLS.bind(TeamUIMessages.DefaultUIFileModificationValidator_4, readOnlyFiles[0].getFullPath().toString()))); } else { syncExec(() -> ok[0] = FileListDialog.openQuestion(shell, readOnlyFiles)); } diff --git a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/ProjectSetImporter.java b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/ProjectSetImporter.java index 7db159970ba..8276ad9c02f 100644 --- a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/ProjectSetImporter.java +++ b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/ProjectSetImporter.java @@ -121,7 +121,8 @@ private static IProject[] importProjectSet(XMLMemento xmlMemento, providerType = TeamPlugin.getAliasType(id); } if (providerType == null) { - throw new TeamException(new Status(IStatus.ERROR, TeamUIPlugin.ID, 0, NLS.bind(TeamUIMessages.ProjectSetImportWizard_0, new String[] { id }), null)); + throw new TeamException(new Status(IStatus.ERROR, TeamUIPlugin.ID, 0, + NLS.bind(TeamUIMessages.ProjectSetImportWizard_0, id), null)); } ProjectSetCapability serializer = providerType.getProjectSetCapability(); ProjectSetCapability.ensureBackwardsCompatible(providerType, serializer); diff --git a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/UIProjectSetSerializationContext.java b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/UIProjectSetSerializationContext.java index 4b940cdd655..29caf9aea18 100644 --- a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/UIProjectSetSerializationContext.java +++ b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/UIProjectSetSerializationContext.java @@ -98,8 +98,9 @@ public boolean needsPrompt(IResource resource) { @Override public String promptMessage(IResource resource) { if (resource.exists()) - return NLS.bind(TeamUIMessages.UIProjectSetSerializationContext_0, new String[] { resource.getName() }); - return NLS.bind(TeamUIMessages.UIProjectSetSerializationContext_2, new String[] { resource.getName(), getTargetFile((IProject)resource).getAbsolutePath() }); + return NLS.bind(TeamUIMessages.UIProjectSetSerializationContext_0, resource.getName()); + return NLS.bind(TeamUIMessages.UIProjectSetSerializationContext_2, resource.getName(), + getTargetFile((IProject) resource).getAbsolutePath()); } public File getTargetFile(IProject project) { return new File(project.getParent().getLocation().toFile(), project.getName()); diff --git a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Utils.java b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Utils.java index 0085cd4348b..b286f0cf4af 100644 --- a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Utils.java +++ b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Utils.java @@ -408,27 +408,30 @@ else if (localContentId.equals(remoteAuthor)) } if (localContentId != null) { if (localAuthor != null) { - config.setLeftLabel(NLS.bind(TeamUIMessages.SyncInfoCompareInput_localLabelAuthorExists, new String[] { localContentId, localAuthor })); + config.setLeftLabel(NLS.bind(TeamUIMessages.SyncInfoCompareInput_localLabelAuthorExists, localContentId, + localAuthor)); } else { - config.setLeftLabel(NLS.bind(TeamUIMessages.SyncInfoCompareInput_localLabelExists, new String[] { localContentId })); + config.setLeftLabel(NLS.bind(TeamUIMessages.SyncInfoCompareInput_localLabelExists, localContentId)); } } else { config.setLeftLabel(TeamUIMessages.SyncInfoCompareInput_localLabel); } if (remote != null) { if (remoteAuthor != null) { - config.setRightLabel(NLS.bind(TeamUIMessages.SyncInfoCompareInput_remoteLabelAuthorExists, new String[] { remoteContentId, remoteAuthor })); + config.setRightLabel(NLS.bind(TeamUIMessages.SyncInfoCompareInput_remoteLabelAuthorExists, + remoteContentId, remoteAuthor)); } else { - config.setRightLabel(NLS.bind(TeamUIMessages.SyncInfoCompareInput_remoteLabelExists, new String[] { remoteContentId })); + config.setRightLabel(NLS.bind(TeamUIMessages.SyncInfoCompareInput_remoteLabelExists, remoteContentId)); } } else { config.setRightLabel(TeamUIMessages.SyncInfoCompareInput_remoteLabel); } if (base != null) { if (baseAuthor != null) { - config.setAncestorLabel(NLS.bind(TeamUIMessages.SyncInfoCompareInput_baseLabelAuthorExists, new String[] { baseContentId, baseAuthor })); + config.setAncestorLabel( + NLS.bind(TeamUIMessages.SyncInfoCompareInput_baseLabelAuthorExists, baseContentId, baseAuthor)); } else { - config.setAncestorLabel(NLS.bind(TeamUIMessages.SyncInfoCompareInput_baseLabelExists, new String[] { baseContentId })); + config.setAncestorLabel(NLS.bind(TeamUIMessages.SyncInfoCompareInput_baseLabelExists, baseContentId)); } } else { config.setAncestorLabel(TeamUIMessages.SyncInfoCompareInput_baseLabel); @@ -556,7 +559,7 @@ public static void initAction(IAction a, String prefix, ResourceBundle bundle, S } String s = null; if (bindings != null) { - s = NLS.bind(getString(labelKey, bundle), bindings); + s = NLS.bind(getString(labelKey, bundle), (Object[]) bindings); } else { s = getString(labelKey, bundle); } @@ -1117,7 +1120,7 @@ private static IContentType getContentType(FileRevisionEditorInput editorInput) // ignore } catch (CoreException e) { TeamUIPlugin.log(IStatus.ERROR, NLS.bind("An error occurred reading the contents of file {0}", //$NON-NLS-1$ - new String[] { editorInput.getName() }), e); + editorInput.getName()), e); } return null; } diff --git a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/CompareRevisionAction.java b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/CompareRevisionAction.java index c9f9b347d1f..be5929fc1d8 100644 --- a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/CompareRevisionAction.java +++ b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/CompareRevisionAction.java @@ -201,7 +201,8 @@ protected boolean updateSelection(IStructuredSelection selection) { this.setText(TeamUIMessages.CompareRevisionAction_Local); else if (el instanceof FileRevision){ FileRevision tempFileRevision = (FileRevision) el; - this.setText(NLS.bind(TeamUIMessages.CompareRevisionAction_Revision, new String[]{tempFileRevision.getContentIdentifier()})); + this.setText(NLS.bind(TeamUIMessages.CompareRevisionAction_Revision, + tempFileRevision.getContentIdentifier())); } else this.setText(TeamUIMessages.CompareRevisionAction_CompareWithCurrent); diff --git a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/CompareFileRevisionEditorInput.java b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/CompareFileRevisionEditorInput.java index f33ed0dfbb8..e66d561388d 100644 --- a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/CompareFileRevisionEditorInput.java +++ b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/CompareFileRevisionEditorInput.java @@ -103,7 +103,7 @@ public CompareFileRevisionEditorInput(ITypedElement left, ITypedElement right, I super(new CompareConfiguration(), page); this.left = left; this.right = right; - setTitle(NLS.bind(TeamUIMessages.SyncInfoCompareInput_title, new String[] { left.getName() })); + setTitle(NLS.bind(TeamUIMessages.SyncInfoCompareInput_title, left.getName())); } @Override diff --git a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/FileRevisionEditorInput.java b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/FileRevisionEditorInput.java index 404a4211c81..ef380100034 100644 --- a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/FileRevisionEditorInput.java +++ b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/FileRevisionEditorInput.java @@ -169,7 +169,7 @@ public ImageDescriptor getImageDescriptor() { public String getName() { IFileRevision rev = getAdapter(IFileRevision.class); if (rev != null) - return NLS.bind(TeamUIMessages.nameAndRevision, new String[] { rev.getName(), rev.getContentIdentifier()}); + return NLS.bind(TeamUIMessages.nameAndRevision, rev.getName(), rev.getContentIdentifier()); IFileState state = getAdapter(IFileState.class); if (state != null) return state.getName() + " " + DateFormat.getInstance().format(new Date(state.getModificationTime())) ; //$NON-NLS-1$ diff --git a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/DiffTreeChangesSection.java b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/DiffTreeChangesSection.java index f593e37f055..0b3b717b263 100644 --- a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/DiffTreeChangesSection.java +++ b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/DiffTreeChangesSection.java @@ -404,7 +404,8 @@ private Composite getInitializationPane(Composite parent) { data.grabExcessVerticalSpace = true; composite.setLayoutData(data); - createDescriptionLabel(composite, NLS.bind(TeamUIMessages.DiffTreeChangesSection_3, new String[] { Utils.shortenText(SynchronizeView.MAX_NAME_LENGTH, getConfiguration().getParticipant().getName()) })); + createDescriptionLabel(composite, NLS.bind(TeamUIMessages.DiffTreeChangesSection_3, + Utils.shortenText(SynchronizeView.MAX_NAME_LENGTH, getConfiguration().getParticipant().getName()))); final boolean[] remember = new boolean[] { false }; final PreferenceStore store = (PreferenceStore) getConfiguration() @@ -467,9 +468,11 @@ private Composite getInitializingMessagePane(Composite parent) { data.grabExcessVerticalSpace = true; composite.setLayoutData(data); if (isRefreshRunning()) { - createDescriptionLabel(composite,NLS.bind(TeamUIMessages.DiffTreeChangesSection_6, new String[] { Utils.shortenText(SynchronizeView.MAX_NAME_LENGTH, getConfiguration().getParticipant().getName()) })); + createDescriptionLabel(composite, NLS.bind(TeamUIMessages.DiffTreeChangesSection_6, + Utils.shortenText(SynchronizeView.MAX_NAME_LENGTH, getConfiguration().getParticipant().getName()))); } else { - createDescriptionLabel(composite,NLS.bind(TeamUIMessages.DiffTreeChangesSection_7, new String[] { Utils.shortenText(SynchronizeView.MAX_NAME_LENGTH, getConfiguration().getParticipant().getName()) })); + createDescriptionLabel(composite, NLS.bind(TeamUIMessages.DiffTreeChangesSection_7, + Utils.shortenText(SynchronizeView.MAX_NAME_LENGTH, getConfiguration().getParticipant().getName()))); } return composite; } @@ -495,17 +498,18 @@ private Composite getPointerToModel(Composite parent, final ModelProvider provid IModelProviderDescriptor oldDesc = ModelProvider.getModelProviderDescriptor(oldId); String message; String modeToString = Utils.modeToString(getConfiguration().getMode()); - message = NLS.bind(TeamUIMessages.DiffTreeChangesSection_0, new String[] { + message = NLS.bind(TeamUIMessages.DiffTreeChangesSection_0, provider.getDescriptor().getLabel(), - modeToString }); - message = NLS.bind(TeamUIMessages.DiffTreeChangesSection_1, new String[] { modeToString, oldDesc.getLabel(), message }); + modeToString); + message = NLS.bind(TeamUIMessages.DiffTreeChangesSection_1, modeToString, oldDesc.getLabel(), message); createDescriptionLabel(composite, message); Label warning = new Label(composite, SWT.NONE); warning.setImage(TeamUIPlugin.getPlugin().getImage(ISharedImages.IMG_WARNING_OVR)); - Hyperlink link = getForms().createHyperlink(composite, NLS.bind(TeamUIMessages.DiffTreeChangesSection_2, new String[] { provider.getDescriptor().getLabel() }), SWT.WRAP); + Hyperlink link = getForms().createHyperlink(composite, + NLS.bind(TeamUIMessages.DiffTreeChangesSection_2, provider.getDescriptor().getLabel()), SWT.WRAP); link.addHyperlinkListener(new HyperlinkAdapter() { @Override public void linkActivated(HyperlinkEvent e) { @@ -583,7 +587,8 @@ private Composite getErrorComposite(Composite parent) { data.grabExcessVerticalSpace = true; composite.setLayoutData(data); - createDescriptionLabel(composite, NLS.bind(TeamUIMessages.ChangesSection_10, new String[] { Utils.shortenText(SynchronizeView.MAX_NAME_LENGTH, getConfiguration().getParticipant().getName()) })); + createDescriptionLabel(composite, NLS.bind(TeamUIMessages.ChangesSection_10, + Utils.shortenText(SynchronizeView.MAX_NAME_LENGTH, getConfiguration().getParticipant().getName()))); Hyperlink link = getForms().createHyperlink(composite, TeamUIMessages.ChangesSection_8, SWT.WRAP); link.addHyperlinkListener(new HyperlinkAdapter() { diff --git a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/MergeAllActionHandler.java b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/MergeAllActionHandler.java index c596db6b955..d1a57545a01 100644 --- a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/MergeAllActionHandler.java +++ b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/MergeAllActionHandler.java @@ -162,10 +162,10 @@ protected boolean promptToUpdate() { final boolean[] result = new boolean[] {true}; TeamUIPlugin.getStandardDisplay().syncExec(() -> { String sizeString = Long.toString(count); - String message = tree.size() > 1 ? NLS.bind(TeamUIMessages.MergeAllActionHandler_1, new String[] { sizeString }) : - NLS.bind(TeamUIMessages.MergeAllActionHandler_2, new String[] { sizeString }); + String message = tree.size() > 1 ? NLS.bind(TeamUIMessages.MergeAllActionHandler_1, sizeString) + : NLS.bind(TeamUIMessages.MergeAllActionHandler_2, sizeString); result[0] = MessageDialog.openQuestion(getConfiguration().getSite().getShell(), - NLS.bind(TeamUIMessages.MergeAllActionHandler_3, new String[] { sizeString }), message); + NLS.bind(TeamUIMessages.MergeAllActionHandler_3, sizeString), message); }); return result[0]; } diff --git a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ModelCompareEditorInput.java b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ModelCompareEditorInput.java index a3e90b8f2bd..06a2b8f027f 100644 --- a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ModelCompareEditorInput.java +++ b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ModelCompareEditorInput.java @@ -79,7 +79,7 @@ public ModelCompareEditorInput(ModelSynchronizeParticipant participant, ICompare this.input = input; contextListener = cache -> closeEditor(true); getCompareConfiguration().addPropertyChangeListener(this); - setTitle(NLS.bind(TeamUIMessages.SyncInfoCompareInput_title, new String[] { input.getName() })); + setTitle(NLS.bind(TeamUIMessages.SyncInfoCompareInput_title, input.getName())); } private static CompareConfiguration createCompareConfiguration(ISynchronizePageConfiguration pageConfiguration) { @@ -173,7 +173,8 @@ public String getToolTipText() { } else { fullPath = getName(); } - return NLS.bind(TeamUIMessages.SyncInfoCompareInput_tooltip, new String[] { Utils.shortenText(SynchronizeView.MAX_NAME_LENGTH, participant.getName()), fullPath }); + return NLS.bind(TeamUIMessages.SyncInfoCompareInput_tooltip, + Utils.shortenText(SynchronizeView.MAX_NAME_LENGTH, participant.getName()), fullPath); } @Override diff --git a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ModelSynchronizePage.java b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ModelSynchronizePage.java index a251f62e78e..c14045230f9 100644 --- a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ModelSynchronizePage.java +++ b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ModelSynchronizePage.java @@ -122,7 +122,8 @@ public boolean aboutToChangeProperty(ISynchronizePageConfiguration configuration ModelProvider provider = (ModelProvider) input; configuration.setProperty( ISynchronizePageConfiguration.P_PAGE_DESCRIPTION, - NLS.bind(TeamUIMessages.ShowModelProviderAction_0, new String[] {Utils.getLabel(provider), Utils.shortenText(SynchronizeView.MAX_NAME_LENGTH, configuration.getParticipant().getName()) })); + NLS.bind(TeamUIMessages.ShowModelProviderAction_0, Utils.getLabel(provider), Utils.shortenText( + SynchronizeView.MAX_NAME_LENGTH, configuration.getParticipant().getName()))); } else if (input != null) { configuration.setProperty( ISynchronizePageConfiguration.P_PAGE_DESCRIPTION, diff --git a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceCompareInputChangeNotifier.java b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceCompareInputChangeNotifier.java index cd8919927e6..4989cecea2b 100644 --- a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceCompareInputChangeNotifier.java +++ b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceCompareInputChangeNotifier.java @@ -70,12 +70,14 @@ public String getAncestorLabel(Object input) { if (Utils.isShowAuthor()) { String author = ((FileRevisionTypedElement)element).getAuthor(); if (author != null) { - return NLS.bind(TeamUIMessages.SyncInfoCompareInput_baseLabelAuthorExists, new String[] { revision.getContentIdentifier(), author }); + return NLS.bind(TeamUIMessages.SyncInfoCompareInput_baseLabelAuthorExists, + revision.getContentIdentifier(), author); } else if (revision.isPropertyMissing()) { fetchAuthors(rdci); } } - return NLS.bind(TeamUIMessages.SyncInfoCompareInput_baseLabelExists, new String[] { revision.getContentIdentifier() }); + return NLS.bind(TeamUIMessages.SyncInfoCompareInput_baseLabelExists, + revision.getContentIdentifier()); } else { return TeamUIMessages.SyncInfoCompareInput_baseLabel; } @@ -101,13 +103,14 @@ public String getLeftLabel(Object input) { if (Utils.isShowAuthor()) { String author= ((LocalResourceTypedElement)element).getAuthor(); if (author != null) { - return NLS.bind(TeamUIMessages.SyncInfoCompareInput_localLabelAuthorExists, new String[] { localContentId, author }); + return NLS.bind(TeamUIMessages.SyncInfoCompareInput_localLabelAuthorExists, + localContentId, author); } else { // NOTE: Must not check for revision#isPropertyMissing() as this will always return true for the workspace file revision fetchAuthors(rdci); } } } - return NLS.bind(TeamUIMessages.SyncInfoCompareInput_localLabelExists, new String[] { localContentId }); + return NLS.bind(TeamUIMessages.SyncInfoCompareInput_localLabelExists, localContentId); } else { return TeamUIMessages.SyncInfoCompareInput_localLabel; } @@ -132,12 +135,14 @@ public String getRightLabel(Object input) { if (Utils.isShowAuthor()) { String author = ((FileRevisionTypedElement)element).getAuthor(); if (author != null) { - return NLS.bind(TeamUIMessages.SyncInfoCompareInput_remoteLabelAuthorExists, new String[] { revision.getContentIdentifier(), author }); + return NLS.bind(TeamUIMessages.SyncInfoCompareInput_remoteLabelAuthorExists, + revision.getContentIdentifier(), author); } else if (revision.isPropertyMissing()) { fetchAuthors(rdci); } } - return NLS.bind(TeamUIMessages.SyncInfoCompareInput_remoteLabelExists, new String[] { revision.getContentIdentifier() }); + return NLS.bind(TeamUIMessages.SyncInfoCompareInput_remoteLabelExists, + revision.getContentIdentifier()); } else { return TeamUIMessages.SyncInfoCompareInput_remoteLabel; } diff --git a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/TeamContentProviderDescriptor.java b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/TeamContentProviderDescriptor.java index 83ac72b1cda..c5062f96d8d 100644 --- a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/TeamContentProviderDescriptor.java +++ b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/TeamContentProviderDescriptor.java @@ -85,17 +85,14 @@ protected void readExtension(IExtension extension) throws CoreException { } } else { fail(NLS.bind(TeamUIMessages.TeamContentProviderDescriptor_2, - new String[] { TAG_TEAM_CONTENT_PROVIDER, - id == null ? "" : id })); //$NON-NLS-1$ + TAG_TEAM_CONTENT_PROVIDER, id == null ? "" : id)); //$NON-NLS-1$ } if (modelProviderId == null) fail(NLS.bind(TeamUIMessages.TeamContentProviderDescriptor_1, - new String[] { ATT_MODEL_PROVIDER_ID, - TAG_TEAM_CONTENT_PROVIDER, id == null ? "" : id })); //$NON-NLS-1$ + ATT_MODEL_PROVIDER_ID, TAG_TEAM_CONTENT_PROVIDER, id == null ? "" : id)); //$NON-NLS-1$ if (contentExtensionId == null) fail(NLS.bind(TeamUIMessages.TeamContentProviderDescriptor_1, - new String[] { ATT_CONTENT_EXTENSION_ID, - TAG_TEAM_CONTENT_PROVIDER, id == null ? "" : id })); //$NON-NLS-1$ + ATT_CONTENT_EXTENSION_ID, TAG_TEAM_CONTENT_PROVIDER, id == null ? "" : id)); //$NON-NLS-1$ } protected void fail(String reason) throws CoreException { @@ -167,7 +164,8 @@ private boolean hasPreferences() { try { return getParentPreferences().nodeExists(getPreferenceName()); } catch (BackingStoreException e) { - TeamUIPlugin.log(IStatus.ERROR, NLS.bind("Error accessing team content preference store for {0}", new String[] { getModelProviderId() }), e); //$NON-NLS-1$ + TeamUIPlugin.log(IStatus.ERROR, + NLS.bind("Error accessing team content preference store for {0}", getModelProviderId()), e); //$NON-NLS-1$ return false; } } @@ -193,7 +191,8 @@ private void flushPreferences() { try { internalGetPreferences().flush(); } catch (BackingStoreException e) { - TeamUIPlugin.log(IStatus.ERROR, NLS.bind("Error flushing team content preference store for {0}", new String[] { getModelProviderId() }), e); //$NON-NLS-1$ + TeamUIPlugin.log(IStatus.ERROR, + NLS.bind("Error flushing team content preference store for {0}", getModelProviderId()), e); //$NON-NLS-1$ } } diff --git a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/TeamDecoratorDescription.java b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/TeamDecoratorDescription.java index 343609adb31..3d2b90c8485 100644 --- a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/TeamDecoratorDescription.java +++ b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/TeamDecoratorDescription.java @@ -71,9 +71,11 @@ protected void readExtension(IExtension extension) throws CoreException { } } if (repositoryId == null) - fail(NLS.bind(TeamUIMessages.TeamContentProviderDescriptor_1, new String[] { ATT_REPOSITORY_ID, TAG_TEAM_DECORATOR, id == null ? "" : id})); //$NON-NLS-1$ + fail(NLS.bind(TeamUIMessages.TeamContentProviderDescriptor_1, ATT_REPOSITORY_ID, TAG_TEAM_DECORATOR, + id == null ? "" : id)); //$NON-NLS-1$ if (repositoryId == null) - fail(NLS.bind(TeamUIMessages.TeamContentProviderDescriptor_1, new String[] { ATT_DECORATOR_ID, TAG_TEAM_DECORATOR, id == null ? "" : id})); //$NON-NLS-1$ + fail(NLS.bind(TeamUIMessages.TeamContentProviderDescriptor_1, ATT_DECORATOR_ID, TAG_TEAM_DECORATOR, + id == null ? "" : id)); //$NON-NLS-1$ } protected void fail(String reason) throws CoreException { diff --git a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangeSetLabelDecorator.java b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangeSetLabelDecorator.java index 80b41608266..920756b3edc 100644 --- a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangeSetLabelDecorator.java +++ b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangeSetLabelDecorator.java @@ -51,7 +51,7 @@ public String decorateText(String input, Object element) { if (element instanceof ChangeSetDiffNode) { ChangeSet set = ((ChangeSetDiffNode)element).getSet(); if (set instanceof ActiveChangeSet && isDefaultActiveSet((ActiveChangeSet)set)) { - text = NLS.bind(TeamUIMessages.CommitSetDiffNode_0, new String[] { text }); + text = NLS.bind(TeamUIMessages.CommitSetDiffNode_0, text); } } return text; diff --git a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ConfigureRefreshScheduleDialog.java b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ConfigureRefreshScheduleDialog.java index fc10423b177..c184961e54c 100644 --- a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ConfigureRefreshScheduleDialog.java +++ b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ConfigureRefreshScheduleDialog.java @@ -33,7 +33,8 @@ public class ConfigureRefreshScheduleDialog extends DetailsDialog { private final SubscriberRefreshSchedule schedule; public ConfigureRefreshScheduleDialog(Shell parentShell, SubscriberRefreshSchedule schedule) { - super(parentShell, NLS.bind(TeamUIMessages.ConfigureRefreshScheduleDialog_0, new String[] { Utils.getTypeName(schedule.getParticipant()) })); + super(parentShell, NLS.bind(TeamUIMessages.ConfigureRefreshScheduleDialog_0, + Utils.getTypeName(schedule.getParticipant()))); this.schedule = schedule; } diff --git a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ConfigureSynchronizeScheduleComposite.java b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ConfigureSynchronizeScheduleComposite.java index 2b87227a869..7215182bfe5 100644 --- a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ConfigureSynchronizeScheduleComposite.java +++ b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ConfigureSynchronizeScheduleComposite.java @@ -111,7 +111,8 @@ protected void createMainDialogArea(Composite parent) { setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); Composite area = this; - createWrappingLabel(area, NLS.bind(TeamUIMessages.ConfigureRefreshScheduleDialog_1, new String[] { Utils.shortenText(SynchronizeView.MAX_NAME_LENGTH, schedule.getParticipant().getName()) }), 0, 3); + createWrappingLabel(area, NLS.bind(TeamUIMessages.ConfigureRefreshScheduleDialog_1, + Utils.shortenText(SynchronizeView.MAX_NAME_LENGTH, schedule.getParticipant().getName())), 0, 3); enableBackgroundRefresh = new Button(area, SWT.CHECK); GridData gridData = new GridData(); @@ -171,7 +172,8 @@ public void widgetDefaultSelected(SelectionEvent e) { gridData = new GridData(GridData.FILL_HORIZONTAL); gridData.horizontalSpan = 3; label.setLayoutData(gridData); - label.setText(NLS.bind(TeamUIMessages.ConfigureRefreshScheduleDialog_2, new String[] { SubscriberRefreshSchedule.refreshEventAsString(schedule.getLastRefreshEvent()) })); + label.setText(NLS.bind(TeamUIMessages.ConfigureRefreshScheduleDialog_2, + SubscriberRefreshSchedule.refreshEventAsString(schedule.getLastRefreshEvent()))); initializeValues(); updateEnablements(); @@ -214,8 +216,8 @@ public void saveValues() { ISynchronizeParticipant participant = schedule.getParticipant(); if (!participant.isPinned() && schedule.isEnabled()) { participant.setPinned(MessageDialog.openQuestion(getShell(), - NLS.bind(TeamUIMessages.ConfigureSynchronizeScheduleComposite_0, new String[] { Utils.getTypeName(participant) }), - NLS.bind(TeamUIMessages.ConfigureSynchronizeScheduleComposite_1, new String[] { Utils.getTypeName(participant) }))); + NLS.bind(TeamUIMessages.ConfigureSynchronizeScheduleComposite_0, Utils.getTypeName(participant)), + NLS.bind(TeamUIMessages.ConfigureSynchronizeScheduleComposite_1, Utils.getTypeName(participant)))); } schedule.getRefreshable().setRefreshSchedule(schedule); } diff --git a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ForwardingChangesSection.java b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ForwardingChangesSection.java index 0a21c362d12..10f0fea7502 100644 --- a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ForwardingChangesSection.java +++ b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ForwardingChangesSection.java @@ -91,7 +91,8 @@ protected Composite getEmptyChangesComposite(Composite parent) { composite.setLayoutData(data); if(! isThreeWay()) { - createDescriptionLabel(composite,NLS.bind(TeamUIMessages.ChangesSection_noChanges, new String[] { Utils.shortenText(SynchronizeView.MAX_NAME_LENGTH, getConfiguration().getParticipant().getName()) })); + createDescriptionLabel(composite, NLS.bind(TeamUIMessages.ChangesSection_noChanges, + Utils.shortenText(SynchronizeView.MAX_NAME_LENGTH, getConfiguration().getParticipant().getName()))); return composite; } @@ -106,16 +107,21 @@ protected Composite getEmptyChangesComposite(Composite parent) { if (numChanges > 0) { String message; if(numChanges > 1) { - message = NLS.bind(TeamUIMessages.ChangesSection_filterHidesPlural, new String[] { Long.toString(numChanges), Utils.modeToString(candidateMode) }); + message = NLS.bind(TeamUIMessages.ChangesSection_filterHidesPlural, Long.toString(numChanges), + Utils.modeToString(candidateMode)); } else { - message = NLS.bind(TeamUIMessages.ChangesSection_filterHidesSingular, new String[] { Long.toString(numChanges), Utils.modeToString(candidateMode) }); + message = NLS.bind(TeamUIMessages.ChangesSection_filterHidesSingular, Long.toString(numChanges), + Utils.modeToString(candidateMode)); } - message = NLS.bind(TeamUIMessages.ChangesSection_filterHides, new String[] { Utils.modeToString(getConfiguration().getMode()), message }); + message = NLS.bind(TeamUIMessages.ChangesSection_filterHides, + Utils.modeToString(getConfiguration().getMode()), message); Label warning = new Label(composite, SWT.NONE); warning.setImage(TeamUIPlugin.getPlugin().getImage(ISharedImages.IMG_WARNING_OVR)); - Hyperlink link = getForms().createHyperlink(composite, NLS.bind(TeamUIMessages.ChangesSection_filterChange, new String[] { Utils.modeToString(candidateMode) }), SWT.WRAP); + Hyperlink link = getForms().createHyperlink(composite, + NLS.bind(TeamUIMessages.ChangesSection_filterChange, Utils.modeToString(candidateMode)), + SWT.WRAP); link.addHyperlinkListener(new HyperlinkAdapter() { @Override public void linkActivated(HyperlinkEvent e) { @@ -129,7 +135,8 @@ public void linkActivated(HyperlinkEvent e) { } } // There is no other mode that can be shown so just indicate that there are no changes - createDescriptionLabel(composite,NLS.bind(TeamUIMessages.ChangesSection_noChanges, new String[] { Utils.shortenText(SynchronizeView.MAX_NAME_LENGTH, getConfiguration().getParticipant().getName()) })); // + createDescriptionLabel(composite, NLS.bind(TeamUIMessages.ChangesSection_noChanges, + Utils.shortenText(SynchronizeView.MAX_NAME_LENGTH, getConfiguration().getParticipant().getName()))); // return composite; } diff --git a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshParticipantJob.java b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshParticipantJob.java index ab145803e7f..0e013349cef 100644 --- a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshParticipantJob.java +++ b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshParticipantJob.java @@ -446,7 +446,7 @@ private IStatus calculateStatus(IRefreshEvent event) { } else { // No changes found code = IRefreshEvent.STATUS_NO_CHANGES; - text.append(NLS.bind(TeamUIMessages.RefreshCompleteDialog_6, new String[] { getName() })); + text.append(NLS.bind(TeamUIMessages.RefreshCompleteDialog_6, getName())); } return new Status(IStatus.OK, TeamUIPlugin.ID, code, text.toString(), null); } diff --git a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshUserNotificationPolicy.java b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshUserNotificationPolicy.java index e325bd277b6..030673cc139 100644 --- a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshUserNotificationPolicy.java +++ b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshUserNotificationPolicy.java @@ -90,7 +90,8 @@ public String getToolTipText() { if(prompt) { return TeamUIMessages.RefreshSubscriberJob_2a; } else { - return NLS.bind(TeamUIMessages.RefreshSubscriberJob_2b, new String[] { Utils.shortenText(SynchronizeView.MAX_NAME_LENGTH, participant.getName()) }); + return NLS.bind(TeamUIMessages.RefreshSubscriberJob_2b, + Utils.shortenText(SynchronizeView.MAX_NAME_LENGTH, participant.getName())); } } }; @@ -99,9 +100,9 @@ public String getToolTipText() { private void notifyIfNeededModal(final IRefreshEvent event) { TeamUIPlugin.getStandardDisplay().asyncExec(() -> { String title = (event.getRefreshType() == IRefreshEvent.SCHEDULED_REFRESH - ? NLS.bind(TeamUIMessages.RefreshCompleteDialog_4a, new String[] { Utils.getTypeName(participant) }) + ? NLS.bind(TeamUIMessages.RefreshCompleteDialog_4a, Utils.getTypeName(participant)) : NLS.bind(TeamUIMessages.RefreshCompleteDialog_4, - new String[] { Utils.getTypeName(participant) })); + Utils.getTypeName(participant))); MessageDialog.openInformation(Utils.getShell(null), title, event.getStatus().getMessage()); }); } diff --git a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SaveablesCompareEditorInput.java b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SaveablesCompareEditorInput.java index 01fb59c9fb0..7bb1f857ad6 100644 --- a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SaveablesCompareEditorInput.java +++ b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SaveablesCompareEditorInput.java @@ -250,16 +250,16 @@ private String[] getLabels() { public String getToolTipText() { String[] labels = getLabels(); if (labels.length == 3) - return NLS.bind(TeamUIMessages.SaveablesCompareEditorInput_threeWayTooltip, labels); - return NLS.bind(TeamUIMessages.SaveablesCompareEditorInput_twoWayTooltip, labels); + return NLS.bind(TeamUIMessages.SaveablesCompareEditorInput_threeWayTooltip, (Object[]) labels); + return NLS.bind(TeamUIMessages.SaveablesCompareEditorInput_twoWayTooltip, (Object[]) labels); } @Override public String getTitle() { String[] labels = getLabels(); if (labels.length == 3) - return NLS.bind(TeamUIMessages.SaveablesCompareEditorInput_threeWayTitle, labels); - return NLS.bind(TeamUIMessages.SaveablesCompareEditorInput_twoWayTitle, labels); + return NLS.bind(TeamUIMessages.SaveablesCompareEditorInput_threeWayTitle, (Object[]) labels); + return NLS.bind(TeamUIMessages.SaveablesCompareEditorInput_twoWayTitle, (Object[]) labels); } private IWorkbenchPage getPage() { @@ -462,7 +462,7 @@ protected Object prepareInput(IProgressMonitor monitor) final ICompareInput input = prepareCompareInput(monitor); if (input != null) setTitle(NLS.bind(TeamUIMessages.SyncInfoCompareInput_title, - new String[] { input.getName() })); + input.getName())); return input; } diff --git a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SubscriberRefreshSchedule.java b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SubscriberRefreshSchedule.java index 4741979fecf..69dae5f101f 100644 --- a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SubscriberRefreshSchedule.java +++ b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SubscriberRefreshSchedule.java @@ -231,9 +231,9 @@ public static String refreshEventAsString(IRefreshEvent event) { if (changeCount == 0) { text.append(TeamUIMessages.RefreshSchedule_7); } else if (changeCount == 1) { - text.append(NLS.bind(TeamUIMessages.RefreshSchedule_changesSingular, new String[] { Integer.toString(changeCount) })); + text.append(NLS.bind(TeamUIMessages.RefreshSchedule_changesSingular, Integer.toString(changeCount))); } else { - text.append(NLS.bind(TeamUIMessages.RefreshSchedule_changesPlural, new String[] { Integer.toString(changeCount) })); + text.append(NLS.bind(TeamUIMessages.RefreshSchedule_changesPlural, Integer.toString(changeCount))); } return text.toString(); } @@ -261,7 +261,7 @@ private String getRefreshIntervalAsString() { } else { unit = (hours ? TeamUIMessages.RefreshSchedule_11 : TeamUIMessages.RefreshSchedule_12); } - return NLS.bind(TeamUIMessages.RefreshSchedule_13, new String[] { Long.toString(minutes), unit }); + return NLS.bind(TeamUIMessages.RefreshSchedule_13, Long.toString(minutes), unit); } public IRefreshable getRefreshable() { diff --git a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SyncInfoSetChangesSection.java b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SyncInfoSetChangesSection.java index 64654e6b82e..577bf5f849e 100644 --- a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SyncInfoSetChangesSection.java +++ b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SyncInfoSetChangesSection.java @@ -228,7 +228,8 @@ public void linkActivated(HyperlinkEvent e) { link.setBackground(getListBackgroundColor()); link.setUnderlined(true); - createDescriptionLabel(composite, NLS.bind(TeamUIMessages.ChangesSection_10, new String[] { Utils.shortenText(SynchronizeView.MAX_NAME_LENGTH, getConfiguration().getParticipant().getName()) })); + createDescriptionLabel(composite, NLS.bind(TeamUIMessages.ChangesSection_10, + Utils.shortenText(SynchronizeView.MAX_NAME_LENGTH, getConfiguration().getParticipant().getName()))); return composite; } diff --git a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeManager.java b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeManager.java index daef9360e31..a67149d06ac 100644 --- a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeManager.java +++ b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeManager.java @@ -292,11 +292,11 @@ private ISynchronizeParticipant instantiate() throws TeamException { savedState = null; return participant; } catch (PartInitException e) { - throw new TeamException(NLS.bind(TeamUIMessages.SynchronizeManager_11, new String[] { descriptor.getName() }), e); + throw new TeamException(NLS.bind(TeamUIMessages.SynchronizeManager_11, descriptor.getName()), e); } catch (CoreException e) { throw TeamException.asTeamException(e); } catch(Exception e) { - throw new TeamException(NLS.bind(TeamUIMessages.SynchronizeManager_11, new String[] { descriptor.getName() }), e); + throw new TeamException(NLS.bind(TeamUIMessages.SynchronizeManager_11, descriptor.getName()), e); } } @@ -352,7 +352,7 @@ private ParticipantInstance createParticipantReference(String type, String secon SynchronizeParticipantDescriptor desc = participantRegistry.find(type); // ensure that the view id is valid if (desc == null) - throw new PartInitException(NLS.bind(TeamUIMessages.SynchronizeManager_19, new String[] { type })); + throw new PartInitException(NLS.bind(TeamUIMessages.SynchronizeManager_19, type)); // ensure that multiple instances are allowed if a secondary id is given if (secondaryId != null) { // if (!desc.isMultipleInstances()) { @@ -491,7 +491,8 @@ public ISynchronizeView showSynchronizeViewInActivePage() { return (ISynchronizeView) part; } catch (ClassCastException e) { // Strange that we cannot cast the part (see bug 53671) - TeamUIPlugin.log(IStatus.ERROR, NLS.bind(TeamUIMessages.SynchronizeManager_18, new String[] { part.getClass().getName() }), e); + TeamUIPlugin.log(IStatus.ERROR, + NLS.bind(TeamUIMessages.SynchronizeManager_18, part.getClass().getName()), e); return null; } } catch (PartInitException pe) { @@ -532,9 +533,9 @@ private boolean promptForPerspectiveSwitch() { String message; String desc = perspectiveDescriptor.getDescription(); if (desc == null) { - message = NLS.bind(TeamUIMessages.SynchronizeManager_30, new String[] { perspectiveDescriptor.getLabel() }); + message = NLS.bind(TeamUIMessages.SynchronizeManager_30, perspectiveDescriptor.getLabel()); } else { - message = NLS.bind(TeamUIMessages.SynchronizeManager_32, new String[] { perspectiveDescriptor.getLabel(), desc }); + message = NLS.bind(TeamUIMessages.SynchronizeManager_32, perspectiveDescriptor.getLabel(), desc); } MessageDialogWithToggle m = MessageDialogWithToggle.openYesNoQuestion(Utils.getShell(null), TeamUIMessages.SynchronizeManager_27, @@ -610,7 +611,8 @@ private void restoreSavedParticipants() throws CoreException { String key = Utils.getKey(id, secondayId); participantReferences.put(key, new ParticipantInstance(desc, secondayId, displayName, memento2.getChild(CTX_PARTICIPANT_DATA))); } else { - TeamUIPlugin.log(new Status(IStatus.ERROR, TeamUIPlugin.ID, 1, NLS.bind(TeamUIMessages.SynchronizeManager_9, new String[] { id }), null)); + TeamUIPlugin.log(new Status(IStatus.ERROR, TeamUIPlugin.ID, 1, + NLS.bind(TeamUIMessages.SynchronizeManager_9, id), null)); } } } diff --git a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeModelElementLabelProvider.java b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeModelElementLabelProvider.java index f28baa1b0d9..af5049d4a53 100644 --- a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeModelElementLabelProvider.java +++ b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeModelElementLabelProvider.java @@ -121,7 +121,7 @@ public String getText(Object element) { int kind = ((DiffNode) element).getKind(); if (kind != SyncInfo.IN_SYNC) { String syncKindString = SyncInfo.kindToString(kind); - return NLS.bind(TeamUIMessages.TeamSubscriberSyncPage_labelWithSyncKind, new String[] { base, syncKindString }); // + return NLS.bind(TeamUIMessages.TeamSubscriberSyncPage_labelWithSyncKind, base, syncKindString); // } } } diff --git a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeView.java b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeView.java index 617433e4318..c693ca95db4 100644 --- a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeView.java +++ b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeView.java @@ -773,7 +773,7 @@ private void setStatusLineMessage(String description, int mode) { if (viewSite != null && syncMode != null) { viewSite.getActionBars().getStatusLineManager().setMessage( NLS.bind(TeamUIMessages.SynchronizeView_statusLine, - new String[] { description, syncMode })); + description, syncMode)); } } diff --git a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/ChangeSetActionGroup.java b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/ChangeSetActionGroup.java index fb7c3a9db8c..ae0fae39bed 100644 --- a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/ChangeSetActionGroup.java +++ b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/ChangeSetActionGroup.java @@ -159,7 +159,9 @@ public RemoveChangeSetAction(ISynchronizePageConfiguration configuration) { public void run() { ActiveChangeSet set = getSelectedSet(); if (set == null) return; - if (MessageDialog.openConfirm(getConfiguration().getSite().getShell(), TeamUIMessages.ChangeSetActionGroup_0, NLS.bind(TeamUIMessages.ChangeSetActionGroup_1, new String[] { LegacyActionTools.escapeMnemonics(set.getTitle()) }))) { // + if (MessageDialog.openConfirm(getConfiguration().getSite().getShell(), + TeamUIMessages.ChangeSetActionGroup_0, NLS.bind(TeamUIMessages.ChangeSetActionGroup_1, + LegacyActionTools.escapeMnemonics(set.getTitle())))) { // getActiveChangeSetManager().remove(set); } } diff --git a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/GlobalRefreshAction.java b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/GlobalRefreshAction.java index 867da70cdf1..3d1a63c5ef6 100644 --- a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/GlobalRefreshAction.java +++ b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/GlobalRefreshAction.java @@ -245,7 +245,7 @@ protected void updateTooltipText() { if (!id.equals(NO_DEFAULT_PARTICPANT)) { ISynchronizeParticipantReference ref = TeamUI.getSynchronizeManager().get(id, secondaryId); if (ref != null) { - actionProxy.setToolTipText(NLS.bind(TeamUIMessages.GlobalRefreshAction_5, new String[] { ref.getDisplayName() })); + actionProxy.setToolTipText(NLS.bind(TeamUIMessages.GlobalRefreshAction_5, ref.getDisplayName())); return; } } diff --git a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/StatusLineContributionGroup.java b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/StatusLineContributionGroup.java index 8070d841451..b6035f13e52 100644 --- a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/StatusLineContributionGroup.java +++ b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/StatusLineContributionGroup.java @@ -92,14 +92,19 @@ protected void updateCounts() { incoming.setText(Integer.toString(workspaceIncoming)); outgoing.setText(Integer.toString(workspaceOutgoing)); - conflicting.setTooltip(NLS.bind(TeamUIMessages.StatisticsPanel_numbersTooltip, new String[] { TeamUIMessages.StatisticsPanel_conflicting })); - outgoing.setTooltip(NLS.bind(TeamUIMessages.StatisticsPanel_numbersTooltip, new String[] { TeamUIMessages.StatisticsPanel_outgoing })); - incoming.setTooltip(NLS.bind(TeamUIMessages.StatisticsPanel_numbersTooltip, new String[] { TeamUIMessages.StatisticsPanel_incoming })); + conflicting.setTooltip(NLS.bind(TeamUIMessages.StatisticsPanel_numbersTooltip, + TeamUIMessages.StatisticsPanel_conflicting)); + outgoing.setTooltip(NLS.bind(TeamUIMessages.StatisticsPanel_numbersTooltip, + TeamUIMessages.StatisticsPanel_outgoing)); + incoming.setTooltip(NLS.bind(TeamUIMessages.StatisticsPanel_numbersTooltip, + TeamUIMessages.StatisticsPanel_incoming)); } else { if (total == 1) { - totalChanges.setText(NLS.bind(TeamUIMessages.StatisticsPanel_numberTotalSingular, new String[] { Integer.toString(total) })); + totalChanges.setText( + NLS.bind(TeamUIMessages.StatisticsPanel_numberTotalSingular, Integer.toString(total))); } else { - totalChanges.setText(NLS.bind(TeamUIMessages.StatisticsPanel_numberTotalPlural, new String[] { Integer.toString(total) })); + totalChanges.setText( + NLS.bind(TeamUIMessages.StatisticsPanel_numberTotalPlural, Integer.toString(total))); } } }); diff --git a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/SynchronizePageDropDownAction.java b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/SynchronizePageDropDownAction.java index e662b2969fa..c574557c70b 100644 --- a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/SynchronizePageDropDownAction.java +++ b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/SynchronizePageDropDownAction.java @@ -151,7 +151,8 @@ public void update() { ISynchronizeParticipantReference[] refs = TeamUI.getSynchronizeManager().getSynchronizeParticipants(); String text = null; if(current != null && refs.length > 0) { - text = NLS.bind(TeamUIMessages.GlobalRefreshAction_5, new String[] { Utils.shortenText(SynchronizeView.MAX_NAME_LENGTH, current.getName()) }); + text = NLS.bind(TeamUIMessages.GlobalRefreshAction_5, + Utils.shortenText(SynchronizeView.MAX_NAME_LENGTH, current.getName())); setToolTipText(text); setText(text); } else { diff --git a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ProjectSetImportWizard.java b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ProjectSetImportWizard.java index b874d12160b..c20b333bf03 100644 --- a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ProjectSetImportWizard.java +++ b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ProjectSetImportWizard.java @@ -78,10 +78,12 @@ public boolean performFinish() { throw (Error)target; } if (target instanceof SAXException) { - ErrorDialog.openError(getShell(), null, null, new Status(IStatus.ERROR, TeamUIPlugin.ID, 0, NLS.bind(TeamUIMessages.ProjectSetImportWizard_2, new String[] { target.getMessage() }), target)); + ErrorDialog.openError(getShell(), null, null, new Status(IStatus.ERROR, TeamUIPlugin.ID, 0, + NLS.bind(TeamUIMessages.ProjectSetImportWizard_2, target.getMessage()), target)); return false; } - ErrorDialog.openError(getShell(), null, null, new Status(IStatus.ERROR, TeamUIPlugin.ID, 0, NLS.bind(TeamUIMessages.ProjectSetImportWizard_3, new String[] { target.getMessage() }), target)); + ErrorDialog.openError(getShell(), null, null, new Status(IStatus.ERROR, TeamUIPlugin.ID, 0, + NLS.bind(TeamUIMessages.ProjectSetImportWizard_3, target.getMessage()), target)); } return result[0]; } diff --git a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/AbstractSynchronizeLabelProvider.java b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/AbstractSynchronizeLabelProvider.java index c4592fcb7ec..71350aedeb1 100644 --- a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/AbstractSynchronizeLabelProvider.java +++ b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/AbstractSynchronizeLabelProvider.java @@ -187,7 +187,7 @@ protected String decorateText(String base, Object element) { IDiff node = getDiff(element); if (node != null && node.getKind() != IDiff.NO_CHANGE) { String syncKindString = node.toDiffString(); - return NLS.bind(TeamUIMessages.AbstractSynchronizationLabelProvider_0, new String[] { base, syncKindString }); + return NLS.bind(TeamUIMessages.AbstractSynchronizationLabelProvider_0, base, syncKindString); } return base; } diff --git a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ModelSynchronizeParticipant.java b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ModelSynchronizeParticipant.java index 9d0333c9ea0..50468ae2db2 100644 --- a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ModelSynchronizeParticipant.java +++ b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ModelSynchronizeParticipant.java @@ -203,7 +203,7 @@ public String getName() { String name = super.getName(); if (description == null) description = Utils.getScopeDescription(getContext().getScope()); - return NLS.bind(TeamUIMessages.SubscriberParticipant_namePattern, new String[] { name, description }); + return NLS.bind(TeamUIMessages.SubscriberParticipant_namePattern, name, description); } /** @@ -414,9 +414,11 @@ protected String getLongTaskName(ResourceMapping[] mappings) { mappingCount = mappings.length; } if (mappingCount == 1) { - return NLS.bind(TeamUIMessages.Participant_synchronizingMoreDetails, new String[] { getShortName(), Utils.getLabel(mappings[0]) }); + return NLS.bind(TeamUIMessages.Participant_synchronizingMoreDetails, getShortName(), + Utils.getLabel(mappings[0])); } - return NLS.bind(TeamUIMessages.Participant_synchronizingResources, new String[] { getShortName(), Integer.toString(mappingCount) }); + return NLS.bind(TeamUIMessages.Participant_synchronizingResources, getShortName(), + Integer.toString(mappingCount)); } private IRefreshable createRefreshable() { @@ -424,7 +426,8 @@ private IRefreshable createRefreshable() { @Override public RefreshParticipantJob createJob(String interval) { - String jobName = NLS.bind(TeamUIMessages.RefreshSchedule_15, new String[] { ModelSynchronizeParticipant.this.getName(), interval }); + String jobName = NLS.bind(TeamUIMessages.RefreshSchedule_15, ModelSynchronizeParticipant.this.getName(), + interval); return new RefreshModelParticipantJob(ModelSynchronizeParticipant.this, jobName, jobName, diff --git a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ParticipantSynchronizeWizard.java b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ParticipantSynchronizeWizard.java index 17090411254..8f9db270eaa 100644 --- a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ParticipantSynchronizeWizard.java +++ b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ParticipantSynchronizeWizard.java @@ -56,13 +56,14 @@ public void addPages() { importWizard.addPages(); IWizardPage startingPage = importWizard.getStartingPage(); if (startingPage != null) { - startingPage.setTitle(NLS.bind(TeamUIMessages.SubscriberParticipantWizard_0, new String[] { getPageTitle() })); - startingPage.setDescription(NLS.bind(TeamUIMessages.SubscriberParticipantWizard_1, new String[] { importWizard.getWindowTitle() })); + startingPage.setTitle(NLS.bind(TeamUIMessages.SubscriberParticipantWizard_0, getPageTitle())); + startingPage.setDescription( + NLS.bind(TeamUIMessages.SubscriberParticipantWizard_1, importWizard.getWindowTitle())); } } } else { selectionPage = createScopeSelectionPage(); - selectionPage.setTitle(NLS.bind(TeamUIMessages.GlobalRefreshSubscriberPage_1, new String[] { getPageTitle() })); + selectionPage.setTitle(NLS.bind(TeamUIMessages.GlobalRefreshSubscriberPage_1, getPageTitle())); selectionPage.setMessage(TeamUIMessages.GlobalRefreshSubscriberPage_2); addPage(selectionPage); } diff --git a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SaveableCompareEditorInput.java b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SaveableCompareEditorInput.java index 60a87a3b9e8..83d8b08e336 100644 --- a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SaveableCompareEditorInput.java +++ b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SaveableCompareEditorInput.java @@ -300,7 +300,7 @@ protected Object prepareInput(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { final ICompareInput input = prepareCompareInput(monitor); if (input != null) - setTitle(NLS.bind(TeamUIMessages.SyncInfoCompareInput_title, new String[] { input.getName()})); + setTitle(NLS.bind(TeamUIMessages.SyncInfoCompareInput_title, input.getName())); return input; } diff --git a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SubscriberParticipant.java b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SubscriberParticipant.java index ad3a564e90c..1127fd40f66 100644 --- a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SubscriberParticipant.java +++ b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SubscriberParticipant.java @@ -108,7 +108,8 @@ private IRefreshable createRefreshable() { public RefreshParticipantJob createJob(String interval) { return new RefreshSubscriberParticipantJob(SubscriberParticipant.this, TeamUIMessages.RefreshSchedule_14, - NLS.bind(TeamUIMessages.RefreshSchedule_15, new String[] { SubscriberParticipant.this.getName(), interval }), getResources(), + NLS.bind(TeamUIMessages.RefreshSchedule_15, SubscriberParticipant.this.getName(), interval), + getResources(), new RefreshUserNotificationPolicy(SubscriberParticipant.this)); } @Override @@ -229,7 +230,7 @@ public void dispose() { @Override public String getName() { String name = super.getName(); - return NLS.bind(TeamUIMessages.SubscriberParticipant_namePattern, new String[] { name, scope.getName() }); + return NLS.bind(TeamUIMessages.SubscriberParticipant_namePattern, name, scope.getName()); } /** @@ -430,12 +431,14 @@ protected String getLongTaskName(IResource[] resources) { resourceCount = resources.length; } if (resourceCount == 1) { - return NLS.bind(TeamUIMessages.Participant_synchronizingMoreDetails, new String[] { getShortName(), resources[0].getFullPath().toString() }); + return NLS.bind(TeamUIMessages.Participant_synchronizingMoreDetails, getShortName(), + resources[0].getFullPath().toString()); } else if (resourceCount > 1) { - return NLS.bind(TeamUIMessages.Participant_synchronizingResources, new String[] { getShortName(), Integer.toString(resourceCount) }); + return NLS.bind(TeamUIMessages.Participant_synchronizingResources, getShortName(), + Integer.toString(resourceCount)); } // A resource count of zero means that it is a non-resource scope so we can print the scope name - return NLS.bind(TeamUIMessages.Participant_synchronizingDetails, new String[] { getName() }); + return NLS.bind(TeamUIMessages.Participant_synchronizingDetails, getName()); } /** diff --git a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoCompareInput.java b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoCompareInput.java index 51b00bfcff1..9befe95ba8d 100644 --- a/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoCompareInput.java +++ b/team/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoCompareInput.java @@ -97,7 +97,7 @@ public SyncInfoCompareInput(String description, SyncInfo sync) { this.description = description; this.resource = sync.getLocal(); this.node = new MyDiffNode(null, sync); - setTitle(NLS.bind(TeamUIMessages.SyncInfoCompareInput_title, new String[] { sync.getLocal().getName() })); + setTitle(NLS.bind(TeamUIMessages.SyncInfoCompareInput_title, sync.getLocal().getName())); } /** @@ -201,7 +201,8 @@ protected ICompareInput prepareCompareInput(IProgressMonitor monitor) @Override public String getToolTipText() { - return NLS.bind(TeamUIMessages.SyncInfoCompareInput_tooltip, new String[] { Utils.shortenText(30, description), node.getResource().getFullPath().toString() }); + return NLS.bind(TeamUIMessages.SyncInfoCompareInput_tooltip, Utils.shortenText(30, description), + node.getResource().getFullPath().toString()); } @Override diff --git a/team/examples/org.eclipse.team.examples.filesystem/META-INF/MANIFEST.MF b/team/examples/org.eclipse.team.examples.filesystem/META-INF/MANIFEST.MF index 6150136e394..ce8a09414ca 100644 --- a/team/examples/org.eclipse.team.examples.filesystem/META-INF/MANIFEST.MF +++ b/team/examples/org.eclipse.team.examples.filesystem/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.team.examples.filesystem; singleton:=true -Bundle-Version: 3.7.700.qualifier +Bundle-Version: 3.7.800.qualifier Bundle-Vendor: %providerName Bundle-Localization: plugin Export-Package: org.eclipse.team.examples.filesystem, diff --git a/team/examples/org.eclipse.team.examples.filesystem/pom.xml b/team/examples/org.eclipse.team.examples.filesystem/pom.xml index 11bb012a6aa..867ff937982 100644 --- a/team/examples/org.eclipse.team.examples.filesystem/pom.xml +++ b/team/examples/org.eclipse.team.examples.filesystem/pom.xml @@ -18,7 +18,7 @@ ../../ org.eclipse.team.examples.filesystem - 3.7.700-SNAPSHOT + 3.7.800-SNAPSHOT eclipse-plugin diff --git a/team/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/localhistory/LocalHistoryParticipant.java b/team/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/localhistory/LocalHistoryParticipant.java index 459205b7a35..a5ce4f63bd9 100644 --- a/team/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/localhistory/LocalHistoryParticipant.java +++ b/team/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/localhistory/LocalHistoryParticipant.java @@ -120,7 +120,7 @@ public void prepareCompareInput(ISynchronizeModelElement element, final IResourceVariant remote = sync.getRemote(); if (remote != null) { config.setRightLabel(NLS.bind("Local History ({0})", - new String[] { remote.getContentIdentifier() })); + remote.getContentIdentifier())); } else { config.setRightLabel("Local History"); } diff --git a/ua/org.eclipse.help.ui/META-INF/MANIFEST.MF b/ua/org.eclipse.help.ui/META-INF/MANIFEST.MF index 1218bc2fd5e..7593a417641 100644 --- a/ua/org.eclipse.help.ui/META-INF/MANIFEST.MF +++ b/ua/org.eclipse.help.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %help_system_plugin_name Bundle-SymbolicName: org.eclipse.help.ui; singleton:=true -Bundle-Version: 4.8.100.qualifier +Bundle-Version: 4.8.200.qualifier Bundle-Activator: org.eclipse.help.ui.internal.HelpUIPlugin Bundle-Vendor: %providerName Bundle-Localization: plugin diff --git a/ua/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/EngineResultSection.java b/ua/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/EngineResultSection.java index c7d60a67b96..01350d6fa24 100644 --- a/ua/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/EngineResultSection.java +++ b/ua/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/EngineResultSection.java @@ -583,8 +583,8 @@ else if (size <= HITS_PER_PAGE) int from = (resultOffset + 1); int to = (resultOffset + HITS_PER_PAGE); to = Math.min(to, size); - section.setText(NLS.bind(Messages.EngineResultSection_sectionTitle_hitsRange, new String[] { - desc.getLabel(), "" + from, "" + to, "" + size })); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + section.setText(NLS.bind(Messages.EngineResultSection_sectionTitle_hitsRange, desc.getLabel(), "" + from, //$NON-NLS-1$ + "" + to, "" + size)); //$NON-NLS-1$ //$NON-NLS-2$ } } @@ -607,8 +607,8 @@ private void recursiveSetMenu(Control control, Menu menu) { if (control instanceof Composite) { Composite parent = (Composite) control; Control[] children = parent.getChildren(); - for (int i = 0; i < children.length; i++) { - recursiveSetMenu(children[i], menu); + for (Control child : children) { + recursiveSetMenu(child, menu); } } } diff --git a/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/BundleManifest.java b/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/BundleManifest.java index 53c16a952be..938fb2523ec 100644 --- a/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/BundleManifest.java +++ b/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/BundleManifest.java @@ -13,11 +13,17 @@ * James D Miles (IBM Corp.) - bug 182666, trim spaces from version id *******************************************************************************/ package org.eclipse.update.internal.configurator; -import java.io.*; -import java.util.jar.*; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.jar.Attributes; +import java.util.jar.Manifest; -import org.eclipse.osgi.util.*; -import org.osgi.framework.*; +import org.eclipse.osgi.util.ManifestElement; +import org.eclipse.osgi.util.NLS; +import org.osgi.framework.BundleException; +import org.osgi.framework.Constants; /** * Parses MANIFEST.MF */ @@ -52,7 +58,7 @@ public BundleManifest(InputStream input, String bundleUrl) { /** * Parses manifest, creates PluginEntry if manifest is valid, stores * exception if any occurs - * + * * @param in * InputStream */ @@ -77,7 +83,7 @@ private void parse(InputStream in) { // plugin version String version = a.getValue(Constants.BUNDLE_VERSION); if (version == null) { - Utils.log(NLS.bind(Messages.BundleManifest_noVersion, (new String[] { Constants.BUNDLE_VERSION, id }))); + Utils.log(NLS.bind(Messages.BundleManifest_noVersion, Constants.BUNDLE_VERSION, id)); return; } version = version.trim(); @@ -109,7 +115,7 @@ public boolean exists() { } /** * Obtains PluginEntry from a manifest. - * + * * @return PluginEntry or null if valid manifest does not exist * @throws IOException * if exception during parsing @@ -117,7 +123,7 @@ public boolean exists() { public PluginEntry getPluginEntry() throws IOException { if (exception != null) { throw exception; - } - return pluginEntry; + } + return pluginEntry; } } diff --git a/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/ConfigurationParser.java b/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/ConfigurationParser.java index 72d09ab61e7..5c0c66c2dd9 100644 --- a/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/ConfigurationParser.java +++ b/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/ConfigurationParser.java @@ -64,8 +64,8 @@ public ConfigurationParser() throws InvocationTargetException { public Configuration parse(URL url, URL installLocation) throws Exception { - // DEBUG: - Utils.debug("Start parsing Configuration:" + url); //$NON-NLS-1$ + // DEBUG: + Utils.debug("Start parsing Configuration:" + url); //$NON-NLS-1$ long lastModified = 0; this.configURL = url; this.installLocation = installLocation; @@ -97,7 +97,7 @@ public Configuration parse(URL url, URL installLocation) throws Exception { @Override public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { - // DEBUG: + // DEBUG: Utils.debug("Start Element: uri:" + uri + " local Name:" + localName + " qName:" + qName); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ try { @@ -119,13 +119,13 @@ public void startElement(String uri, String localName, String qName, Attributes } } catch (MalformedURLException e) { - throw new SAXException(NLS.bind(Messages.InstalledSiteParser_UnableToCreateURL, (new String[] { e.getMessage() })), e); + throw new SAXException(NLS.bind(Messages.InstalledSiteParser_UnableToCreateURL, (e.getMessage())), e); } catch (CoreException e) { - throw new SAXException(NLS.bind(Messages.InstalledSiteParser_ErrorParsingFile, (new String[] { e.toString() })), e); + throw new SAXException(NLS.bind(Messages.InstalledSiteParser_ErrorParsingFile, (e.toString())), e); } } - /** + /** * process the Site info */ private void processSite(Attributes attributes) @@ -133,11 +133,11 @@ private void processSite(Attributes attributes) if (config == null) return; - + // reset current site currentSiteURL = null; - - String urlString = attributes.getValue(CFG_URL); + + String urlString = attributes.getValue(CFG_URL); if (urlString == null) return; @@ -149,21 +149,21 @@ private void processSite(Attributes attributes) url = new URL(PlatformConfiguration.getInstallURL(), urlString); return; } - + // when reading externalized URLs, need to convert them to absolute form String property = System.getProperty(URL_PROPERTY, EMPTY_STRING); URL root = property == null || property.length() == 0 ? Utils.getInstallURL() : new URL(property); url = Utils.makeAbsolute(root, url); - + if (!isValidSite(url)) return; - + // use this new site currentSiteURL = url; int policyType; String[] policyList = null; - String typeString = attributes.getValue(CFG_POLICY); + String typeString = attributes.getValue(CFG_POLICY); if (typeString == null) { policyType = PlatformConfiguration.getDefaultPolicy(); policyList = DEFAULT_POLICY_LIST; @@ -192,33 +192,33 @@ private void processSite(Attributes attributes) SitePolicy sp = new SitePolicy(policyType, policyList); SiteEntry site = new SiteEntry(url, sp); - String flag = attributes.getValue(CFG_UPDATEABLE); + String flag = attributes.getValue(CFG_UPDATEABLE); if (flag != null) { if (flag.equals("true")) //$NON-NLS-1$ site.setUpdateable(true); else site.setUpdateable(false); } - - flag = attributes.getValue(CFG_ENABLED); + + flag = attributes.getValue(CFG_ENABLED); if (flag != null && flag.equals("false")) //$NON-NLS-1$ site.setEnabled(false); else site.setEnabled(true); - String linkname = attributes.getValue(CFG_LINK_FILE); + String linkname = attributes.getValue(CFG_LINK_FILE); if (linkname != null && !linkname.isEmpty()) { site.setLinkFileName(linkname.replace('/', File.separatorChar)); } - // DEBUG: + // DEBUG: Utils.debug("End process config site url:" + urlString + " policy:" + typeString + " updatable:"+flag ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - + currentSiteURL = site.getURL(); config.addSiteEntry(currentSiteURL.toExternalForm(), site); } - - /** + + /** * process the DefaultFeature info */ private void processFeature(Attributes attributes) @@ -226,19 +226,19 @@ private void processFeature(Attributes attributes) if (currentSiteURL == null) return; // the site was not correct - - String id = attributes.getValue(CFG_FEATURE_ENTRY_ID); + + String id = attributes.getValue(CFG_FEATURE_ENTRY_ID); if (id == null) return; - String version = attributes.getValue(CFG_FEATURE_ENTRY_VERSION); - String pluginVersion = attributes.getValue(CFG_FEATURE_ENTRY_PLUGIN_VERSION); + String version = attributes.getValue(CFG_FEATURE_ENTRY_VERSION); + String pluginVersion = attributes.getValue(CFG_FEATURE_ENTRY_PLUGIN_VERSION); if (pluginVersion == null || pluginVersion.trim().length() == 0) pluginVersion = version; - String pluginIdentifier = attributes.getValue(CFG_FEATURE_ENTRY_PLUGIN_IDENTIFIER); + String pluginIdentifier = attributes.getValue(CFG_FEATURE_ENTRY_PLUGIN_IDENTIFIER); if (pluginIdentifier != null && pluginIdentifier.trim().length() == 0) pluginIdentifier = null; - String application = attributes.getValue(CFG_FEATURE_ENTRY_APPLICATION); - + String application = attributes.getValue(CFG_FEATURE_ENTRY_APPLICATION); + // get install locations String locations = attributes.getValue(CFG_FEATURE_ENTRY_ROOT); StringTokenizer st = locations != null ? new StringTokenizer(locations,",") : new StringTokenizer(""); //$NON-NLS-1$ //$NON-NLS-2$ @@ -255,29 +255,29 @@ private void processFeature(Attributes attributes) // get primary flag boolean primary = false; - String flag = attributes.getValue(CFG_FEATURE_ENTRY_PRIMARY); + String flag = attributes.getValue(CFG_FEATURE_ENTRY_PRIMARY); if (flag != null) { if (flag.equals("true")) //$NON-NLS-1$ primary = true; } - + FeatureEntry featureEntry = new FeatureEntry(id, version, pluginIdentifier, pluginVersion, primary, application, roots); // set the url - String url = attributes.getValue(CFG_URL); + String url = attributes.getValue(CFG_URL); if (url != null && url.trim().length() > 0) featureEntry.setURL(url); - + SiteEntry site = config.getSiteEntry(currentSiteURL.toExternalForm()); site.addFeatureEntry(featureEntry); - + // configured ? // String configuredString = attributes.getValue("configured"); //$NON-NLS-1$ // boolean configured = configuredString.trim().equalsIgnoreCase("true") ? true : false; //$NON-NLS-1$ } - /** + /** * process the Config info */ private void processConfig(Attributes attributes) { @@ -291,14 +291,14 @@ private void processConfig(Attributes attributes) { config = new Configuration(new Date(time)); } catch (NumberFormatException e1) { time = new Date().getTime(); - Utils.log(NLS.bind(Messages.InstalledSiteParser_date, (new String[] { date }))); + Utils.log(NLS.bind(Messages.InstalledSiteParser_date, (date))); config = new Configuration(); // constructed with current date } } - + config.setURL(configURL); config.setInstallLocation(installLocation); - + try { String sharedURLString = attributes.getValue(CFG_SHARED_URL); if (sharedURLString != null) { @@ -320,34 +320,34 @@ private void processConfig(Attributes attributes) { } } catch (Exception e) { // could not load from shared install - Utils.log(Utils.newStatus(Messages.ConfigurationParser_cannotLoadSharedInstall, e)); + Utils.log(Utils.newStatus(Messages.ConfigurationParser_cannotLoadSharedInstall, e)); } String flag = attributes.getValue(CFG_TRANSIENT); if (flag != null) { config.setTransient(flag.equals("true")); //$NON-NLS-1$ } - - // DEBUG: + + // DEBUG: Utils.debug("End Processing Config Tag: date:" + attributes.getValue(CFG_DATE)); //$NON-NLS-1$ } - + private boolean isValidSite(URL url) { URL resolvedURL= url; if (url.getProtocol().equals("platform")) { //$NON-NLS-1$ - try { + try { // resolve the config location relative to the configURL - if (url.getPath().startsWith("/config")) { + if (url.getPath().startsWith("/config")) { URL config_loc = new URL(configURL, ".."); resolvedURL = PlatformConfiguration.resolvePlatformURL(url, config_loc); // 19536 } - else + else resolvedURL = PlatformConfiguration.resolvePlatformURL(url, config.getInstallURL()); // 19536 } catch (IOException e) { // will use the baseline URL ... } } - + if (!PlatformConfiguration.supportsDetection(resolvedURL, config.getInstallURL())) return false; @@ -363,8 +363,8 @@ private boolean isValidSite(URL url) { public void endElement(String uri, String localName, String qName) throws SAXException { super.endElement(uri, localName, qName); - - // DEBUG: + + // DEBUG: Utils.debug("End Element: uri:" + uri + " local Name:" + localName + " qName:" + qName); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ try { @@ -372,7 +372,7 @@ public void endElement(String uri, String localName, String qName) if (tag.equalsIgnoreCase(CFG)) { // This is a bit of a hack. - // When no features were added to the site, but the site is initialized from platform.xml + // When no features were added to the site, but the site is initialized from platform.xml // we need to set the feature set to empty, so we don't try to detect them. for (SiteEntry site : config.getSites()) site.initialized(); diff --git a/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/FeatureParser.java b/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/FeatureParser.java index a180a7b5e69..2946bcfbf69 100644 --- a/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/FeatureParser.java +++ b/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/FeatureParser.java @@ -90,7 +90,7 @@ public void startElement(String uri, String localName, String qName, Attributes processFeature(attributes); // stop parsing now throw new SAXException(""); //$NON-NLS-1$ - } + } } /* @@ -104,7 +104,7 @@ private void processFeature(Attributes attributes) { if (id == null || id.trim().isEmpty() || ver == null || ver.trim().isEmpty()) { - System.out.println(NLS.bind(Messages.FeatureParser_IdOrVersionInvalid, (new String[] { id, ver}))); + System.out.println(NLS.bind(Messages.FeatureParser_IdOrVersionInvalid, id, ver)); } else { // String label = attributes.getValue("label"); //$NON-NLS-1$ // String provider = attributes.getValue("provider-name"); //$NON-NLS-1$ @@ -113,7 +113,7 @@ private void processFeature(Attributes attributes) { String ws = attributes.getValue("ws"); //$NON-NLS-1$ String nl = attributes.getValue("nl"); //$NON-NLS-1$ String arch = attributes.getValue("arch"); //$NON-NLS-1$ - if (!Utils.isValidEnvironment(os, ws, arch, nl)) + if (!Utils.isValidEnvironment(os, ws, arch, nl)) return; // String exclusive = attributes.getValue("exclusive"); //$NON-NLS-1$ // String affinity = attributes.getValue("colocation-affinity"); //$NON-NLS-1$ @@ -129,7 +129,7 @@ private void processFeature(Attributes attributes) { File f = new File(url.getFile().replace('/', File.separatorChar)); feature.setURL("features" + "/" + f.getParentFile().getName() + "/");// + f.getName()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ } else { - // externalized URLs might be in relative form, ensure they are absolute + // externalized URLs might be in relative form, ensure they are absolute feature.setURL(Utils.makeAbsolute(Utils.getInstallURL(), url).toExternalForm()); } diff --git a/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/FullFeatureParser.java b/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/FullFeatureParser.java index 2d056f06797..b8428493f46 100644 --- a/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/FullFeatureParser.java +++ b/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/FullFeatureParser.java @@ -103,7 +103,7 @@ private void processPlugin(Attributes attributes) { if (id == null || id.trim().isEmpty() || ver == null || ver.trim().isEmpty()) { - System.out.println(NLS.bind(Messages.FeatureParser_IdOrVersionInvalid, (new String[] { id, ver}))); + System.out.println(NLS.bind(Messages.FeatureParser_IdOrVersionInvalid, id, ver)); } else { // String label = attributes.getValue("label"); //$NON-NLS-1$ // String provider = attributes.getValue("provider-name"); //$NON-NLS-1$ @@ -118,16 +118,16 @@ private void processPlugin(Attributes attributes) { plugin.setPluginIdentifier(id); plugin.setPluginVersion(ver); feature.addPlugin(plugin); - + Utils. debug("End process DefaultFeature tag: id:" +id + " ver:" +ver + " url:" + feature.getURL()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ } } - + private void processLicense(Attributes attributes ){ feature.setLicenseURL(attributes.getValue("url")); //$NON-NLS-1$ } - + @Override public void characters(char[] ch, int start, int length) throws SAXException { diff --git a/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/PlatformConfiguration.java b/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/PlatformConfiguration.java index d3b2567c56e..c3cbbe642df 100644 --- a/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/PlatformConfiguration.java +++ b/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/PlatformConfiguration.java @@ -501,7 +501,7 @@ public synchronized void save(URL url) throws IOException { } catch (CoreException e) { Utils.log(e.getMessage()); Utils.log(e.getStatus()); - throw new IOException(NLS.bind(Messages.cfig_unableToSave, (new String[] {url.toExternalForm()}))); + throw new IOException(NLS.bind(Messages.cfig_unableToSave, (url.toExternalForm()))); } } else { // file protocol - do safe i/o @@ -569,7 +569,7 @@ public synchronized void save(URL url) throws IOException { changeStamp = config.getDate().getTime(); config.setDirty(false); } catch (CoreException e) { - throw new IOException(NLS.bind(Messages.cfig_unableToSave, (new String[] {cfigTmp.getAbsolutePath()}))); + throw new IOException(NLS.bind(Messages.cfig_unableToSave, (cfigTmp.getAbsolutePath()))); } // at this point we have old config (if existed) as "bak" and the @@ -583,7 +583,7 @@ public synchronized void save(URL url) throws IOException { // case we will restart with the previous state. Utils.log(Messages.PlatformConfiguration_cannotRenameTempFile); - throw new IOException(NLS.bind(Messages.cfig_unableToSave, (new String[] {cfigTmp.getAbsolutePath()}))); + throw new IOException(NLS.bind(Messages.cfig_unableToSave, (cfigTmp.getAbsolutePath()))); } } } diff --git a/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/PluginEntry.java b/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/PluginEntry.java index d508459a903..8156b5057c8 100644 --- a/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/PluginEntry.java +++ b/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/PluginEntry.java @@ -22,7 +22,7 @@ public class PluginEntry { private boolean isFragment = false; private VersionedIdentifier versionId; private String url; - + public PluginEntry() { super(); } @@ -34,7 +34,7 @@ public PluginEntry() { public String getURL() { return url; } - + /** * url is relative to the site */ @@ -44,7 +44,7 @@ public void setURL(String url) { /** * Returns the plug-in identifier for this entry. - * + * * @return the plug-in identifier, or null */ public String getPluginIdentifier() { @@ -53,7 +53,7 @@ public String getPluginIdentifier() { /** * Returns the plug-in version for this entry. - * + * * @return the plug-in version, or null */ public String getPluginVersion() { @@ -61,10 +61,10 @@ public String getPluginVersion() { } /** - * Indicates whether the entry describes a full plug-in, or + * Indicates whether the entry describes a full plug-in, or * a plug-in fragment. - * - * @return true if the entry is a plug-in fragment, + * + * @return true if the entry is a plug-in fragment, * false if the entry is a plug-in */ public boolean isFragment() { @@ -124,7 +124,7 @@ public VersionedIdentifier getVersionedIdentifier() { versionId = new VersionedIdentifier(id, ver); return versionId; } catch (Exception e) { - Utils.log(NLS.bind(Messages.PluginEntry_versionError, (new String[] { id, ver }))); + Utils.log(NLS.bind(Messages.PluginEntry_versionError, id, ver)); } } @@ -133,18 +133,18 @@ public VersionedIdentifier getVersionedIdentifier() { } /** - * Sets the identifier of this plugin entry. + * Sets the identifier of this plugin entry. */ void setVersionedIdentifier(VersionedIdentifier identifier) { setPluginIdentifier(identifier.getIdentifier()); setPluginVersion(identifier.getVersion().toString()); - } + } /** * Compares two plugin entries for equality - * + * * @param object plugin entry object to compare with - * @return true if the two entries are equal, + * @return true if the two entries are equal, * false otherwise */ @Override @@ -154,7 +154,7 @@ public boolean equals(Object object) { PluginEntry e = (PluginEntry) object; return getVersionedIdentifier().equals(e.getVersionedIdentifier()); } - + @Override public int hashCode() { return getVersionedIdentifier().hashCode(); diff --git a/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/PluginParser.java b/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/PluginParser.java index 406f656b998..400d6b33501 100644 --- a/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/PluginParser.java +++ b/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/PluginParser.java @@ -90,19 +90,19 @@ public void startElement(String uri, String localName, String qName, Attributes String tag = localName.trim(); if (tag.equalsIgnoreCase(CFG_PLUGIN)) { - pluginEntry.isFragment(false); + pluginEntry.isFragment(false); processPlugin(attributes); return; } if (tag.equalsIgnoreCase(CFG_FRAGMENT)) { - pluginEntry.isFragment(true); + pluginEntry.isFragment(true); processPlugin(attributes); return; } } - /** + /** * process plugin entry info */ private void processPlugin(Attributes attributes) throws ParseCompleteException { @@ -110,14 +110,14 @@ private void processPlugin(Attributes attributes) throws ParseCompleteException String version = attributes.getValue("version"); //$NON-NLS-1$ if (id == null || id.trim().length() == 0) { id = "_no_id_"; //$NON-NLS-1$ - Utils.log(NLS.bind(Messages.PluginParser_plugin_no_id, (new String[] { location }))); + Utils.log(NLS.bind(Messages.PluginParser_plugin_no_id, location)); } if (version == null || version.trim().length() == 0) { version = "0.0.0"; //$NON-NLS-1$ - Utils.log(NLS.bind(Messages.PluginParser_plugin_no_version, (new String[] { location }))); + Utils.log(NLS.bind(Messages.PluginParser_plugin_no_version, location)); } pluginEntry.setVersionedIdentifier(new VersionedIdentifier(id, version)); - + // stop parsing now throw new ParseCompleteException(""); //$NON-NLS-1$ } diff --git a/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/SiteEntry.java b/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/SiteEntry.java index 7a1bf19bb89..48c6cf5c62d 100644 --- a/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/SiteEntry.java +++ b/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/SiteEntry.java @@ -274,7 +274,7 @@ private void detectFeatures() { return false; boolean valid = f.isDirectory() && (new File(f,FEATURE_XML).exists()); if (!valid) - Utils.log(NLS.bind(Messages.SiteEntry_cannotFindFeatureInDir, (new String[] { f.getAbsolutePath() }))); + Utils.log(NLS.bind(Messages.SiteEntry_cannotFindFeatureInDir, f.getAbsolutePath())); return valid; }); @@ -289,7 +289,8 @@ private void detectFeatures() { if (featureEntry != null) addFeatureEntry(featureEntry); } catch (MalformedURLException e) { - Utils.log(NLS.bind(Messages.InstalledSiteParser_UnableToCreateURLForFile, (new String[] { featuresDir.getAbsolutePath() }))); + Utils.log(NLS.bind(Messages.InstalledSiteParser_UnableToCreateURLForFile, + featuresDir.getAbsolutePath())); } } } @@ -368,10 +369,10 @@ private void detectPackedPlugin(File file, boolean compareTimeStamps) { } } catch (IOException e5) { String pluginFileString2 = pluginURL + "!" + entryName; //$NON-NLS-1$ - Utils.log(NLS.bind(Messages.InstalledSiteParser_ErrorAccessing, (new String[] { pluginFileString2 }))); + Utils.log(NLS.bind(Messages.InstalledSiteParser_ErrorAccessing, pluginFileString2)); } catch (SAXException e3) { String pluginFileString1 = pluginURL + "!" + entryName; //$NON-NLS-1$ - Utils.log(NLS.bind(Messages.InstalledSiteParser_ErrorParsingFile, (new String[] { pluginFileString1 }))); + Utils.log(NLS.bind(Messages.InstalledSiteParser_ErrorParsingFile, pluginFileString1)); } finally { if (bundleManifestIn != null) { try { @@ -430,12 +431,13 @@ private void detectUnpackedPlugin(File file, boolean compareTimeStamps) { } catch (IOException e) { String pluginFileString = pluginFile.getAbsolutePath(); if (ConfigurationActivator.DEBUG) - Utils.log(Utils.newStatus(NLS.bind(Messages.InstalledSiteParser_ErrorParsingFile, (new String[] { pluginFileString })), e)); + Utils.log( + Utils.newStatus(NLS.bind(Messages.InstalledSiteParser_ErrorParsingFile, pluginFileString), e)); else - Utils.log(NLS.bind(Messages.InstalledSiteParser_ErrorAccessing, (new String[] { pluginFileString }))); + Utils.log(NLS.bind(Messages.InstalledSiteParser_ErrorAccessing, pluginFileString)); } catch (SAXException e) { String pluginFileString = pluginFile.getAbsolutePath(); - Utils.log(NLS.bind(Messages.InstalledSiteParser_ErrorParsingFile, (new String[] { pluginFileString }))); + Utils.log(NLS.bind(Messages.InstalledSiteParser_ErrorParsingFile, pluginFileString)); } } @@ -500,7 +502,7 @@ private synchronized long computePluginsChangeStamp() { return pluginsChangeStamp; if (!PlatformConfiguration.supportsDetection(resolvedURL, config.getInstallURL())) { - Utils.log(NLS.bind(Messages.SiteEntry_computePluginStamp, (new String[] { resolvedURL.toExternalForm() }))); + Utils.log(NLS.bind(Messages.SiteEntry_computePluginStamp, resolvedURL.toExternalForm())); return 0; } @@ -508,7 +510,7 @@ private synchronized long computePluginsChangeStamp() { File root = new File(resolvedURL.getFile().replace('/', File.separatorChar)); File pluginsDir = new File(root, PLUGINS); if (!pluginsDir.exists() || !pluginsDir.isDirectory()) { - Utils.debug(NLS.bind(Messages.SiteEntry_pluginsDir, (new String[] { pluginsDir.getAbsolutePath() }))); + Utils.debug(NLS.bind(Messages.SiteEntry_pluginsDir, pluginsDir.getAbsolutePath())); return 0; } @@ -743,4 +745,4 @@ public void initialized() { if (featureEntries == null) featureEntries = new HashMap<>(); } -} +} \ No newline at end of file diff --git a/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/branding/IniFileReader.java b/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/branding/IniFileReader.java index 0709a57ed3a..3ec0c78952a 100644 --- a/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/branding/IniFileReader.java +++ b/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/branding/IniFileReader.java @@ -61,7 +61,7 @@ public class IniFileReader { /** * Creates an INI file reader that can parse the contents into key,value pairs. - * + * * @param featureId the unique identifier of the feature, must not be null * @param pluginId the unique identifier of the feature plug-in, must not be null * @param iniFilename the INI file name, must not be null @@ -70,11 +70,11 @@ public class IniFileReader { */ public IniFileReader(String featureId, String pluginId, String iniFilename, String propertiesFilename, String mappingsFilename) { super(); - + if (featureId == null || pluginId == null || iniFilename == null) { throw new IllegalArgumentException(); } - + this.featureId = featureId; this.pluginId = pluginId; this.iniFilename = iniFilename; @@ -85,19 +85,19 @@ public IniFileReader(String featureId, String pluginId, String iniFilename, Stri /** * Read the contents of the INI, properties, and mappings files. * Does nothing if the content has already been read and parsed. - * + * * @return an IStatus indicating the success or failure * of reading and parsing the INI file content */ public IStatus load() { if (ini != null) return OK_STATUS; - + // attempt to locate the corresponding plugin bundle = Utils.getBundle(pluginId); if (bundle == null || bundle.getState() == Bundle.UNINSTALLED || bundle.getState() == Bundle.INSTALLED) { bundle = null; // make it null for other test down the road - String message = NLS.bind(Messages.IniFileReader_MissingDesc, (new String[] { featureId })); + String message = NLS.bind(Messages.IniFileReader_MissingDesc, featureId); return new Status(IStatus.ERROR, PID, 0, message, null); } @@ -106,10 +106,10 @@ public IStatus load() { IOException ioe = null; iniURL = FileLocator.find(bundle, IPath.fromOSString(NLS_TAG).append(iniFilename), null); if (iniURL == null) { - String message = NLS.bind(Messages.IniFileReader_OpenINIError, (new String[] { iniFilename })); + String message = NLS.bind(Messages.IniFileReader_OpenINIError, iniFilename); return new Status(IStatus.ERROR, PID, 0, message, ioe); } - + // Determine the properties file location URL propertiesURL = null; if (propertiesFilename != null && !propertiesFilename.isEmpty()) { @@ -125,11 +125,11 @@ public IStatus load() { // OK to pass null properties and/or mapping file return load(iniURL, propertiesURL, mappingsURL); } - + /** * Returns the string value for the given key, or null. * The string value is NLS if requested. - * + * * @return the string value for the given key, or null */ public String getString(String key, boolean doNls, Hashtable runtimeMappings) { @@ -144,7 +144,7 @@ public String getString(String key, boolean doNls, Hashtable run /** * Returns a URL for the given key, or null. - * + * * @return a URL for the given key, or null */ public URL getURL(String key) { @@ -160,12 +160,12 @@ public URL getURL(String key) { } return url; } - + /** * Returns a array of URL for the given key, or null. The * property value should be a comma separated list of urls, tokens for * which bundle cannot build an url will have a null entry. - * + * * @param key name of the property containing the requested urls * @return a URL for the given key, or null * @since 3.0 @@ -192,7 +192,7 @@ public URL[] getURLs(String key) { /** * Returns the feature plugin label, or null. - * + * * @return the feature plugin lable, or null if none. */ public String getFeaturePluginLabel() { @@ -200,10 +200,10 @@ public String getFeaturePluginLabel() { return null; return bundle.getHeaders().get(Constants.BUNDLE_NAME); } - + /** * Returns the provider name for this feature, or null. - * + * * @return the provider name for this feature, or null */ public String getProviderName() { @@ -211,15 +211,15 @@ public String getProviderName() { return null; return bundle.getHeaders().get(Constants.BUNDLE_VENDOR); } - + /* - * Returns a resource string corresponding to the given argument + * Returns a resource string corresponding to the given argument * value and bundle. * If the argument value specifies a resource key, the string * is looked up in the given resource bundle. If the argument does not * specify a valid key, the argument itself is returned as the * resource string. The key lookup is performed against the - * specified resource bundle. If a resource string + * specified resource bundle. If a resource string * corresponding to the key is not found in the resource bundle * the key value, or any default text following the key in the * argument value is returned as the resource string. @@ -245,7 +245,7 @@ public String getProviderName() { * @return the resource string */ public String getResourceString(String value, Hashtable runtimeMappings) { - + if (value == null) return null; String s = value.trim(); @@ -281,7 +281,7 @@ public String getResourceString(String value, Hashtable runtimeM } } } - + if (result.indexOf('{') != -1) { // We test for the curly braces since due to NL issues we do not // want to use MessageFormat unless we have to. @@ -291,8 +291,8 @@ public String getResourceString(String value, Hashtable runtimeM //ignore and return string without bound parameters } } - - return result; + + return result; } /* @@ -307,7 +307,7 @@ private IStatus load(URL iniURL, URL propertiesURL, URL mappingsURL) { ini.load(is); } catch (IOException e) { ini = null; - String message = NLS.bind(Messages.IniFileReader_ReadIniError, (new String[] { iniURL.toExternalForm() })); + String message = NLS.bind(Messages.IniFileReader_ReadIniError, iniURL.toExternalForm()); return new Status(IStatus.ERROR, PID, 0, message, e); } finally { try { @@ -324,7 +324,7 @@ private IStatus load(URL iniURL, URL propertiesURL, URL mappingsURL) { properties = new PropertyResourceBundle(is); } catch (IOException e) { properties = null; - String message = NLS.bind(Messages.IniFileReader_ReadPropError, (new String[] { propertiesURL.toExternalForm() })); + String message = NLS.bind(Messages.IniFileReader_ReadPropError, propertiesURL.toExternalForm()); return new Status(IStatus.ERROR, PID, 0, message, e); } finally { try { @@ -343,7 +343,7 @@ private IStatus load(URL iniURL, URL propertiesURL, URL mappingsURL) { bundle = new PropertyResourceBundle(is); } catch (IOException e) { bundle = null; - String message = NLS.bind(Messages.IniFileReader_ReadMapError, (new String[] { mappingsURL.toExternalForm() })); + String message = NLS.bind(Messages.IniFileReader_ReadMapError, mappingsURL.toExternalForm()); return new Status(IStatus.ERROR, PID, 0, message, e); } finally { try { @@ -368,7 +368,7 @@ private IStatus load(URL iniURL, URL propertiesURL, URL mappingsURL) { } } mappings = mappingsList.toArray(new String[mappingsList.size()]); - + return OK_STATUS; } }