1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Revert "Bug 560614 - Drop dependency on ICU4J"

This reverts commit 87b627bf02.

Change-Id: I54ea1ac766437deb174eeba571a7a5094c180828
This commit is contained in:
Jonah Graham 2020-03-02 06:49:24 -05:00
parent 87b627bf02
commit 5a6b9b4bf4
148 changed files with 514 additions and 290 deletions

View file

@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.cdt.make.core; singleton:=true
Bundle-Version: 7.4.200.qualifier
Bundle-Version: 7.4.100.qualifier
Bundle-Activator: org.eclipse.cdt.make.core.MakeCorePlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
@ -28,4 +28,5 @@ Require-Bundle: org.eclipse.cdt.core;bundle-version="[5.0.0,7.0.0)",
org.eclipse.tools.templates.freemarker;bundle-version="1.0.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Import-Package: com.ibm.icu.text
Automatic-Module-Name: org.eclipse.cdt.make.core

View file

@ -13,10 +13,11 @@
*******************************************************************************/
package org.eclipse.cdt.make.internal.core;
import java.text.MessageFormat;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
import com.ibm.icu.text.MessageFormat;
public class MakeMessages {
private static final String RESOURCE_BUNDLE = MakeMessages.class.getName();
@ -42,10 +43,19 @@ public class MakeMessages {
}
}
/**
* Gets a string from the resource bundle and formats it with the argument
*
* @param key the string used to get the bundle value, must not be null
*/
public static String getFormattedString(String key, Object arg) {
return MessageFormat.format(getString(key), new Object[] { arg });
}
/**
* Gets a string from the resource bundle and formats it with arguments
*/
public static String getFormattedString(String key, Object... args) {
public static String getFormattedString(String key, Object[] args) {
return MessageFormat.format(getString(key), args);
}
}

View file

@ -20,13 +20,14 @@ import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.Writer;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
import com.ibm.icu.text.DateFormat;
import com.ibm.icu.text.SimpleDateFormat;
/**
* Log writer utility
*

View file

@ -41,4 +41,5 @@ Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.2.0,4.0.0)",
org.eclipse.cdt.launch;bundle-version="9.2.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Import-Package: com.ibm.icu.text
Automatic-Module-Name: org.eclipse.cdt.make.ui

View file

@ -13,7 +13,6 @@
*******************************************************************************/
package org.eclipse.cdt.make.internal.ui;
import java.text.MessageFormat;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Hashtable;
@ -69,6 +68,8 @@ import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.TableItem;
import org.eclipse.ui.dialogs.ListSelectionDialog;
import com.ibm.icu.text.MessageFormat;
/**
* @deprecated as of CDT 4.0. This tab was used to set preferences/properties
* for 3.X style projects.

View file

@ -17,10 +17,11 @@
package org.eclipse.cdt.make.internal.ui.actions;
import java.text.MessageFormat;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
import com.ibm.icu.text.MessageFormat;
/**
* Class that gives access to the folding messages resource bundle.
*/
@ -58,6 +59,19 @@ public class FoldingMessages {
return RESOURCE_BUNDLE;
}
/**
* Returns the formatted resource string associated with the given key in the resource bundle.
* <code>MessageFormat</code> is used to format the message. If there isn't any value
* under the given key, the key is returned.
*
* @param key the resource key
* @param arg the message argument
* @return the string
*/
public static String getFormattedString(String key, Object arg) {
return getFormattedString(key, new Object[] { arg });
}
/**
* Returns the formatted resource string associated with the given key in the resource bundle.
* <code>MessageFormat</code> is used to format the message. If there isn't any value
@ -67,7 +81,7 @@ public class FoldingMessages {
* @param args the message arguments
* @return the string
*/
public static String getFormattedString(String key, Object... args) {
public static String getFormattedString(String key, Object[] args) {
return MessageFormat.format(getString(key), args);
}
}

View file

@ -15,7 +15,6 @@
package org.eclipse.cdt.make.internal.ui.dnd;
import java.lang.reflect.InvocationTargetException;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.List;
@ -44,6 +43,8 @@ import org.eclipse.swt.SWTException;
import org.eclipse.swt.dnd.DND;
import org.eclipse.swt.widgets.Shell;
import com.ibm.icu.text.MessageFormat;
/**
* A collection of various functions for Make Target View drag and drop support.
*/
@ -238,7 +239,7 @@ public class MakeTargetDndUtil {
// Try "Copy of name"
newName = MessageFormat.format(MakeUIPlugin.getResourceString("MakeTargetDnD.copyOf.uniqueName"), //$NON-NLS-1$
targetName);
new Object[] { targetName });
if (makeTargetManager.findTarget(container, newName) == null) {
return newName;
}
@ -246,7 +247,7 @@ public class MakeTargetDndUtil {
// Try "Copy (2) of name"
for (int counter = 1;; counter++) {
newName = MessageFormat.format(MakeUIPlugin.getResourceString("MakeTargetDnD.countedCopyOf.uniqueName"), //$NON-NLS-1$
counter, targetName);
new Object[] { counter, targetName });
if (makeTargetManager.findTarget(container, newName) == null) {
return newName;
}

View file

@ -14,7 +14,6 @@
package org.eclipse.cdt.make.internal.ui.dnd;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.List;
@ -29,6 +28,8 @@ import org.eclipse.swt.dnd.TextTransfer;
import org.eclipse.swt.dnd.Transfer;
import org.eclipse.swt.widgets.Shell;
import com.ibm.icu.text.MessageFormat;
/**
* {@code TextTransferDropTargetListener} handles dropping of selected text to
* Make Target View. Each line of miltiline text passed is treated as separate
@ -164,7 +165,7 @@ public class TextTransferDropTargetListener extends AbstractContainerAreaDropAda
String title = MakeUIPlugin.getResourceString("MakeTargetDnD.title.createFromTextConfirm"); //$NON-NLS-1$
String question = MessageFormat.format(
MakeUIPlugin.getResourceString("MakeTargetDnD.message.createFromTextConfirm"), //$NON-NLS-1$
Integer.valueOf(makeTargets.length));
new Object[] { Integer.valueOf(makeTargets.length) });
String topTargets = ""; //$NON-NLS-1$
for (int i = 0; i < makeTargets.length; i++) {

View file

@ -13,8 +13,6 @@
*******************************************************************************/
package org.eclipse.cdt.make.internal.ui.part;
import java.text.MessageFormat;
import org.eclipse.cdt.make.internal.ui.MakeUIPlugin;
import org.eclipse.jface.viewers.CheckboxTableViewer;
import org.eclipse.jface.viewers.StructuredViewer;
@ -24,6 +22,8 @@ import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import com.ibm.icu.text.MessageFormat;
/**
* @version 1.0
*/
@ -126,7 +126,8 @@ public class WizardCheckboxTablePart extends CheckboxTablePart {
protected void updateCounterLabel() {
String number = EMPTY_STRING + getSelectionCount();
String totalNumber = EMPTY_STRING + getTotalCount();
String message = MessageFormat.format(MakeUIPlugin.getResourceString(KEY_COUNTER), number, totalNumber);
String message = MessageFormat.format(MakeUIPlugin.getResourceString(KEY_COUNTER),
new Object[] { number, totalNumber });
counterLabel.setText(message);
}

View file

@ -17,7 +17,6 @@ package org.eclipse.cdt.make.internal.ui.preferences;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.text.MessageFormat;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
@ -43,6 +42,8 @@ import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
import com.ibm.icu.text.MessageFormat;
/**
* AbstraceMakeEditorPreferencePage
*/

View file

@ -13,7 +13,6 @@
*******************************************************************************/
package org.eclipse.cdt.make.ui.views;
import java.text.MessageFormat;
import java.util.List;
import org.eclipse.cdt.make.core.IMakeTarget;
@ -31,6 +30,8 @@ import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.actions.SelectionListenerAction;
import com.ibm.icu.text.MessageFormat;
/**
* @noextend This class is not intended to be subclassed by clients.
* @noinstantiate This class is not intended to be instantiated by clients.
@ -63,12 +64,12 @@ public class DeleteTargetAction extends SelectionListenerAction {
title = MakeUIPlugin.getResourceString("DeleteTargetAction.title.confirmDeletion"); //$NON-NLS-1$
IMakeTarget target = (IMakeTarget) targets.get(0);
msg = MessageFormat.format(MakeUIPlugin.getResourceString("DeleteTargetAction.message.confirmDeleteion"), //$NON-NLS-1$
target.getName());
new Object[] { target.getName() });
} else {
title = MakeUIPlugin.getResourceString("DeleteTargetAction.title.confirmMultipleDeletion"); //$NON-NLS-1$
msg = MessageFormat.format(
MakeUIPlugin.getResourceString("DeleteTargetAction.message.confirmMultipleDeletion"), //$NON-NLS-1$
Integer.valueOf(targets.size()));
new Object[] { Integer.valueOf(targets.size()) });
}
return MessageDialog.openQuestion(shell, title, msg);
}

View file

@ -41,5 +41,6 @@ Require-Bundle: org.eclipse.cdt.core;bundle-version="[5.0.0,7.0.0)",
org.eclipse.core.filesystem;bundle-version="1.2.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Import-Package: com.google.gson;version="2.8.0"
Import-Package: com.google.gson;version="2.8.0",
com.ibm.icu.text
Automatic-Module-Name: org.eclipse.cdt.managedbuilder.core

View file

@ -13,7 +13,6 @@
*******************************************************************************/
package org.eclipse.cdt.build.internal.core.scannerconfig;
import java.text.MessageFormat;
import java.util.Set;
import java.util.TreeSet;
@ -31,6 +30,8 @@ import org.eclipse.cdt.managedbuilder.internal.core.Tool;
import org.eclipse.cdt.managedbuilder.internal.core.ToolChain;
import org.eclipse.core.runtime.Assert;
import com.ibm.icu.text.MessageFormat;
public class CfgScannerConfigUtil {
public static CfgInfoContext adjustPerRcTypeContext(CfgInfoContext context) {
if (((Configuration) context.getConfiguration()).isPreference())
@ -196,7 +197,7 @@ public class CfgScannerConfigUtil {
if (!(tool instanceof Tool)) {
String msg = MessageFormat.format(ManagedMakeMessages.getString("CfgScannerConfigUtil_ErrorNotSupported"), //$NON-NLS-1$
Tool.class.getName());
new Object[] { Tool.class.getName() });
throw new UnsupportedOperationException(msg);
}
@ -228,7 +229,7 @@ public class CfgScannerConfigUtil {
if (!(inputType instanceof InputType)) {
String msg = MessageFormat.format(ManagedMakeMessages.getString("CfgScannerConfigUtil_ErrorNotSupported"), //$NON-NLS-1$
InputType.class.getName());
new Object[] { InputType.class.getName() });
throw new UnsupportedOperationException(msg);
}

View file

@ -14,10 +14,11 @@
*******************************************************************************/
package org.eclipse.cdt.managedbuilder.internal.buildmodel;
import java.text.MessageFormat;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
import com.ibm.icu.text.MessageFormat;
public class BuildModelMessages {
private static final String BUNDLE_NAME = "org.eclipse.cdt.managedbuilder.internal.buildmodel.BuildModelMessages"; //$NON-NLS-1$
@ -41,7 +42,7 @@ public class BuildModelMessages {
}
public static String getFormattedString(String key, String arg) {
return MessageFormat.format(getResourceString(key), arg);
return MessageFormat.format(getResourceString(key), (Object[]) new String[] { arg });
}
public static String getFormattedString(String key, String[] args) {

View file

@ -13,10 +13,11 @@
*******************************************************************************/
package org.eclipse.cdt.managedbuilder.internal.core;
import java.text.MessageFormat;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
import com.ibm.icu.text.MessageFormat;
/**
* @since 2.0
*/
@ -49,7 +50,7 @@ public class ManagedMakeMessages {
}
public static String getFormattedString(String key, String arg) {
return MessageFormat.format(getResourceString(key), arg);
return MessageFormat.format(getResourceString(key), new Object[] { arg });
}
public static String getFormattedString(String key, String[] args) {

View file

@ -13,10 +13,11 @@
*******************************************************************************/
package org.eclipse.cdt.managedbuilder.internal.dataprovider;
import java.text.MessageFormat;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
import com.ibm.icu.text.MessageFormat;
public class DataProviderMessages {
private static final String BUNDLE_NAME = "org.eclipse.cdt.managedbuilder.internal.dataprovider.DataProviderMessages"; //$NON-NLS-1$
@ -40,7 +41,7 @@ public class DataProviderMessages {
}
public static String getFormattedString(String key, String arg) {
return MessageFormat.format(getResourceString(key), arg);
return MessageFormat.format(getResourceString(key), new Object[] { arg });
}
public static String getFormattedString(String key, String[] args) {

View file

@ -17,7 +17,6 @@ import java.net.URI;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.attribute.FileTime;
import java.text.MessageFormat;
import java.util.List;
import java.util.Set;
@ -58,6 +57,7 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.SubMonitor;
import com.google.gson.Gson;
import com.ibm.icu.text.MessageFormat;
/**
* This language settings provider takes a compile_commands.json file as input (aka, Compilation Database or CDB) and parses the commands

View file

@ -13,10 +13,11 @@
*******************************************************************************/
package org.eclipse.cdt.managedbuilder.projectconverter;
import java.text.MessageFormat;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
import com.ibm.icu.text.MessageFormat;
/**
* @noextend This class is not intended to be subclassed by clients.
* @noinstantiate This class is not intended to be instantiated by clients.
@ -50,7 +51,7 @@ public class ConverterMessages {
}
public static String getFormattedString(String key, String arg) {
return MessageFormat.format(getResourceString(key), arg);
return MessageFormat.format(getResourceString(key), new Object[] { arg });
}
public static String getFormattedString(String key, String[] args) {

View file

@ -13,10 +13,11 @@
*******************************************************************************/
package org.eclipse.cdt.newmake.internal.core;
import java.text.MessageFormat;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
import com.ibm.icu.text.MessageFormat;
public class MakeMessages {
private static final String RESOURCE_BUNDLE = MakeMessages.class.getName();
@ -42,10 +43,19 @@ public class MakeMessages {
}
}
/**
* Gets a string from the resource bundle and formats it with the argument
*
* @param key the string used to get the bundle value, must not be null
*/
public static String getFormattedString(String key, Object arg) {
return MessageFormat.format(getString(key), new Object[] { arg });
}
/**
* Gets a string from the resource bundle and formats it with arguments
*/
public static String getFormattedString(String key, Object... args) {
public static String getFormattedString(String key, Object[] args) {
return MessageFormat.format(getString(key), args);
}
}

View file

@ -26,4 +26,5 @@ Require-Bundle: org.eclipse.core.resources;bundle-version="[3.2.0,4.0.0)",
org.eclipse.core.expressions
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Import-Package: com.ibm.icu.text
Automatic-Module-Name: org.eclipse.cdt.managedbuilder.ui

View file

@ -13,8 +13,6 @@
*******************************************************************************/
package org.eclipse.cdt.managedbuilder.internal.ui.commands;
import java.text.MessageFormat;
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
@ -27,6 +25,8 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import com.ibm.icu.text.MessageFormat;
/**
* A job to build CDT build configurations.
*/
@ -39,11 +39,11 @@ public class BuildConfigurationsJob extends Job {
String firstProjectName = cfgDescriptions[0].getProjectDescription().getName();
String firstConfigurationName = cfgDescriptions[0].getName();
if (isCleaning) {
return MessageFormat.format(Messages.BuildConfigurationsJob_Cleaning, cfgDescriptions.length,
firstProjectName, firstConfigurationName);
return MessageFormat.format(Messages.BuildConfigurationsJob_Cleaning,
new Object[] { cfgDescriptions.length, firstProjectName, firstConfigurationName });
} else {
return MessageFormat.format(Messages.BuildConfigurationsJob_Building, cfgDescriptions.length,
firstProjectName, firstConfigurationName);
return MessageFormat.format(Messages.BuildConfigurationsJob_Building,
new Object[] { cfgDescriptions.length, firstProjectName, firstConfigurationName });
}
}

View file

@ -13,7 +13,6 @@
*******************************************************************************/
package org.eclipse.cdt.managedbuilder.ui.properties;
import java.text.Collator;
import java.util.Arrays;
import java.util.Comparator;
@ -50,6 +49,8 @@ import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import com.ibm.icu.text.Collator;
/**
* the dialog used to create or edit the build macro
*

View file

@ -133,6 +133,7 @@ Require-Bundle: org.eclipse.cdt.core.native;bundle-version="[5.10.100,6.0.0)";vi
org.eclipse.ltk.core.refactoring;bundle-version="[3.10.200,4.0.0)",
org.eclipse.osgi.services;bundle-version="[3.8.0,4.0.0)",
org.eclipse.text;bundle-version="[3.9.0,4.0.0)",
com.ibm.icu;bundle-version="4.4.2",
com.google.gson,
org.eclipse.jdt.annotation;bundle-version="[2.0.0,3.0.0)";resolution:=optional
Bundle-ActivationPolicy: lazy

View file

@ -13,10 +13,11 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.model;
import java.text.MessageFormat;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
import com.ibm.icu.text.MessageFormat;
/**
* @noreference This class is not intended to be referenced by clients.
*/
@ -53,10 +54,19 @@ public class CoreModelMessages {
return getString(key);
}
/**
* Returns a string from the resource bundle and formats it with the argument
*
* @param key the string used to get the bundle value, must not be {@code null}
*/
public static String getFormattedString(String key, Object arg) {
return MessageFormat.format(getString(key), new Object[] { arg });
}
/**
* Returns a string from the resource bundle and formats it with arguments
*/
public static String getFormattedString(String key, Object... args) {
public static String getFormattedString(String key, Object[] args) {
return MessageFormat.format(getString(key), args);
}
}

View file

@ -23,7 +23,6 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URI;
import java.text.MessageFormat;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.ICLogConstants;
@ -46,6 +45,8 @@ import org.eclipse.core.runtime.preferences.InstanceScope;
import org.osgi.service.prefs.BackingStoreException;
import org.osgi.service.prefs.Preferences;
import com.ibm.icu.text.MessageFormat;
public class Util implements ICLogConstants {
public static boolean VERBOSE_PARSER;
public static boolean VERBOSE_SCANNER;
@ -196,8 +197,8 @@ public class Util implements ICLogConstants {
if (CCorePlugin.getDefault().isDebugging() && isActive(client)) {
// Time stamp
if (addTimeStamp)
message = MessageFormat.format("[{0}] {1}", //$NON-NLS-1$
Long.valueOf(System.currentTimeMillis()), message);
message = MessageFormat.format("[{0}] {1}", new Object[] { //$NON-NLS-1$
Long.valueOf(System.currentTimeMillis()), message });
while (message.length() > 100) {
String partial = message.substring(0, 100);
message = message.substring(100);

View file

@ -14,8 +14,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.settings.model;
import java.text.MessageFormat;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.model.ICProject;
import org.eclipse.cdt.core.settings.model.CProjectDescriptionEvent;
@ -36,6 +34,8 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.osgi.framework.Version;
import com.ibm.icu.text.MessageFormat;
/**
* This abstract class provides an extension point for functionality for loading
* a CDT Project Description from some kind of backing store. This allows
@ -159,7 +159,7 @@ public abstract class AbstractCProjectDescriptionStorage {
if (!project.isAccessible())
throw ExceptionFactory.createCoreException(
MessageFormat.format(CCorePlugin.getResourceString("ProjectDescription.ProjectNotAccessible"), //$NON-NLS-1$
getProject().getName()));
new Object[] { getProject().getName() }));
return currentThreadProjectDescription.get();
}

View file

@ -27,7 +27,6 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.net.URI;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
@ -136,6 +135,8 @@ import org.w3c.dom.NodeList;
import org.w3c.dom.ProcessingInstruction;
import org.xml.sax.SAXException;
import com.ibm.icu.text.MessageFormat;
/**
* The CProjectDescriptionManager is to marshall the loading and storing
* of CDT Project Descriptions.
@ -845,7 +846,7 @@ public class CProjectDescriptionManager implements ICProjectDescriptionManager {
if (!project.isAccessible())
throw ExceptionFactory.createCoreException(MessageFormat.format(
CCorePlugin.getResourceString("ProjectDescription.ProjectNotAccessible"), //$NON-NLS-1$
project.getName()));
new Object[] { project.getName() }));
if (!des.isValid() && (!fAllowEmptyCreatingDescription || !des.isCdtProjectCreating()))
throw ExceptionFactory.createCoreException(
@ -886,7 +887,7 @@ public class CProjectDescriptionManager implements ICProjectDescriptionManager {
if (project == null || !project.isAccessible())
throw ExceptionFactory.createCoreException(
MessageFormat.format(CCorePlugin.getResourceString("ProjectDescription.ProjectNotAccessible"), //$NON-NLS-1$
project != null ? project.getName() : "<null>")); //$NON-NLS-1$
new Object[] { project != null ? project.getName() : "<null>" })); //$NON-NLS-1$
AbstractCProjectDescriptionStorage storage = CProjectDescriptionStorageManager.getInstance()
.getProjectDescriptionStorage(project);
if (storage == null)
@ -1388,6 +1389,7 @@ public class CProjectDescriptionManager implements ICProjectDescriptionManager {
/* void postProcessNewDescriptionCache(CProjectDescription des, ICProjectDescriptionDelta delta) {
if (delta == null && delta.getDeltaKind() != ICProjectDescriptionDelta.CHANGED)
return;
ICConfigurationDescription indexCfg = des.getIndexConfiguration();
ICConfigurationDescription activeCfg = des.getActiveConfiguration();
ICProjectDescriptionDelta activeCfgDelta = findDelta(activeCfg.getId(), delta);
@ -1397,6 +1399,8 @@ public class CProjectDescriptionManager implements ICProjectDescriptionManager {
des.setIndexConfiguration(activeCfg);
}
}
}
*/
private ICDescriptionDelta findDelta(String id, ICDescriptionDelta delta) {
@ -1929,6 +1933,18 @@ public class CProjectDescriptionManager implements ICProjectDescriptionManager {
return result;
}
/* public boolean entriesEqual(ICLanguageSettingEntry entries1[], ICLanguageSettingEntry entries2[]) {
if (entries1.length != entries2.length)
return false;
for (int i = 0; i < entries1.length; i++) {
if (!entries1[i].equals(entries2[i]))
return false;
}
return true;
}
*/
private CProjectDescriptionDelta createDelta(ICBuildSetting newBuildSetting, ICBuildSetting oldBuildSetting) {
CProjectDescriptionDelta delta = new CProjectDescriptionDelta(newBuildSetting, oldBuildSetting);
if (!Arrays.equals(newBuildSetting.getErrorParserIDs(), oldBuildSetting.getErrorParserIDs()))

View file

@ -14,8 +14,6 @@
package org.eclipse.cdt.core.index.export;
import java.io.File;
import java.text.DateFormat;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
@ -50,6 +48,9 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
import com.ibm.icu.text.DateFormat;
import com.ibm.icu.text.MessageFormat;
/**
* An IExportProjectProvider suitable for indexing an external folder. The arguments understood by this provider
* are
@ -81,7 +82,7 @@ public class ExternalExportProjectProvider extends AbstractExportProjectProvider
// -source
File source = new File(getSingleString(OPT_SOURCE));
if (!source.exists()) {
fail(MessageFormat.format(Messages.ExternalContentPEM_LocationToIndexNonExistent, source));
fail(MessageFormat.format(Messages.ExternalContentPEM_LocationToIndexNonExistent, new Object[] { source }));
}
// -include

View file

@ -15,7 +15,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser;
import java.text.MessageFormat;
import java.util.HashMap;
import java.util.Map;
@ -25,6 +24,8 @@ import org.eclipse.cdt.core.dom.ast.IASTNode;
import org.eclipse.cdt.core.dom.ast.IASTProblem;
import org.eclipse.cdt.internal.core.parser.ParserMessages;
import com.ibm.icu.text.MessageFormat;
/**
* Models problems, all problems should derive from this class.
*/
@ -169,7 +170,7 @@ public class ASTProblem extends ASTNode implements IASTProblem {
msg = ""; //$NON-NLS-1$
if (arg != null) {
msg = MessageFormat.format(msg, arg);
msg = MessageFormat.format(msg, new Object[] { arg });
}
if (originalProblem != null) {
msg = MessageFormat.format("{0}: {1}", msg, originalProblem.getMessage()); //$NON-NLS-1$

View file

@ -16,8 +16,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser;
import java.text.MessageFormat;
import org.eclipse.cdt.core.dom.ILinkage;
import org.eclipse.cdt.core.dom.IName;
import org.eclipse.cdt.core.dom.ast.DOMException;
@ -42,6 +40,8 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.EvalFixed;
import org.eclipse.cdt.internal.core.parser.ParserMessages;
import org.eclipse.core.runtime.PlatformObject;
import com.ibm.icu.text.MessageFormat;
/**
* Implementation of problem bindings
*/
@ -142,7 +142,7 @@ public class ProblemBinding extends PlatformObject implements IProblemBinding, I
}
if (arg != null) {
msg = MessageFormat.format(msg, new String(arg));
msg = MessageFormat.format(msg, new Object[] { new String(arg) });
}
return msg;

View file

@ -14,7 +14,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.indexer;
import java.text.MessageFormat;
import java.text.NumberFormat;
import java.util.Collection;
import java.util.Iterator;
@ -28,6 +27,8 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import com.ibm.icu.text.MessageFormat;
/**
* A task for index updates.
*

View file

@ -13,12 +13,13 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.parser;
import java.text.MessageFormat;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
import org.eclipse.cdt.core.dom.ast.ISemanticProblem;
import com.ibm.icu.text.MessageFormat;
public class ParserMessages {
private static final String BUNDLE_NAME = ParserMessages.class.getName();
private static ResourceBundle resourceBundle;
@ -65,7 +66,7 @@ public class ParserMessages {
if (arg == null)
arg = ""; //$NON-NLS-1$
return MessageFormat.format(format, arg);
return MessageFormat.format(format, new Object[] { arg });
}
public static String getProblemPattern(ISemanticProblem problem) {

View file

@ -13,7 +13,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.parser.scanner;
import java.text.DateFormatSymbols;
import java.util.Calendar;
import org.eclipse.cdt.core.dom.ILinkage;
@ -26,6 +25,8 @@ import org.eclipse.cdt.core.parser.OffsetLimitReachedException;
import org.eclipse.cdt.internal.core.dom.Linkage;
import org.eclipse.cdt.internal.core.parser.scanner.Lexer.LexerOptions;
import com.ibm.icu.text.DateFormatSymbols;
/**
* Models macros used by the preprocessor
* @since 5.0

View file

@ -26,8 +26,6 @@ import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.text.MessageFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
@ -119,6 +117,9 @@ import org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChange
import org.eclipse.core.runtime.preferences.IPreferencesService;
import org.eclipse.core.runtime.preferences.InstanceScope;
import com.ibm.icu.text.MessageFormat;
import com.ibm.icu.text.SimpleDateFormat;
/**
* Manages PDOM updates and events associated with them. Provides methods for index access.
*/
@ -1226,8 +1227,8 @@ public class PDOMManager implements IWritableIndexManager, IListener {
}
}
String msg = MessageFormat.format(Messages.PDOMManager_indexMonitorDetail, Integer.valueOf(sourceCount),
Integer.valueOf(sourceEstimate), Integer.valueOf(headerCount));
String msg = MessageFormat.format(Messages.PDOMManager_indexMonitorDetail, new Object[] {
Integer.valueOf(sourceCount), Integer.valueOf(sourceEstimate), Integer.valueOf(headerCount) });
if (detail != null) {
msg += ": " + detail; //$NON-NLS-1$
}

View file

@ -15,13 +15,13 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.pdom.db;
import java.text.MessageFormat;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import com.ibm.icu.text.MessageFormat;
/**
* @author Doug Schaefer
*/
@ -317,7 +317,7 @@ public class BTree {
}
throw new BTreeKeyNotFoundException(
MessageFormat.format(Messages.getString("BTree.DeletionOnAbsentKey"), //$NON-NLS-1$
Long.valueOf(key), Integer.valueOf(mode)));
new Object[] { Long.valueOf(key), Integer.valueOf(mode) }));
}
} else {
if (keyIndexInNode != -1) {
@ -417,7 +417,7 @@ public class BTree {
throw new BTreeKeyNotFoundException(
MessageFormat.format(Messages.getString("BTree.DeletionOnAbsentKey"), //$NON-NLS-1$
Long.valueOf(key), Integer.valueOf(mode)));
new Object[] { Long.valueOf(key), Integer.valueOf(mode) }));
}
}
}
@ -674,8 +674,8 @@ public class BTree {
if (!full && !empty) {
valid = false;
msg += MessageFormat.format(Messages.getString("BTree.IntegrityErrorA"), //$NON-NLS-1$
Long.valueOf(node), Integer.valueOf(indexFirstBlankKey),
Integer.valueOf(indexLastNonBlankKey));
new Object[] { Long.valueOf(node), Integer.valueOf(indexFirstBlankKey),
Integer.valueOf(indexLastNonBlankKey) });
}
}
@ -683,7 +683,7 @@ public class BTree {
if (childCount != 0 && childCount != keyCount + 1) {
valid = false;
msg += MessageFormat.format(Messages.getString("BTree.IntegrityErrorB"), //$NON-NLS-1$
Long.valueOf(node));
new Object[] { Long.valueOf(node) });
}
// The root node is excused from the remaining node constraints.
@ -695,7 +695,7 @@ public class BTree {
if (keyCount < MIN_RECORDS || keyCount > MAX_RECORDS) {
valid = false;
msg += MessageFormat.format(Messages.getString("BTree.IntegrityErrorC"), //$NON-NLS-1$
Long.valueOf(node));
new Object[] { Long.valueOf(node) });
}
// Check: All leaf nodes are at the same depth

View file

@ -28,7 +28,6 @@ import java.nio.ByteBuffer;
import java.nio.channels.ClosedByInterruptException;
import java.nio.channels.ClosedChannelException;
import java.nio.channels.FileChannel;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
@ -39,6 +38,8 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.osgi.util.NLS;
import com.ibm.icu.text.MessageFormat;
/**
* Database encapsulates access to a flat binary format file with a memory-manager-like API for
* obtaining and releasing areas of storage (memory).
@ -318,7 +319,7 @@ public class Database {
private void databaseCorruptionDetected() throws CoreException {
String msg = MessageFormat.format(Messages.getString("Database.CorruptedDatabase"), //$NON-NLS-1$
fLocation.getName());
new Object[] { fLocation.getName() });
throw new CoreException(new DBStatus(msg));
}

View file

@ -13,7 +13,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.pdom.export;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@ -22,6 +21,8 @@ import java.util.Map;
import org.eclipse.cdt.core.index.export.Messages;
import org.eclipse.core.runtime.CoreException;
import com.ibm.icu.text.MessageFormat;
/**
* Helper methods for command-line options
* <br>
@ -42,7 +43,8 @@ public class CLIUtil {
throws CoreException {
List<String> list = arguments.get(opt);
if (list == null || list.size() != number) {
String msg = MessageFormat.format(Messages.CLIUtil_OptionParametersMismatch, opt, "" + number); //$NON-NLS-1$
String msg = MessageFormat.format(Messages.CLIUtil_OptionParametersMismatch,
new Object[] { opt, "" + number }); //$NON-NLS-1$
GeneratePDOMApplication.fail(msg);
}
return list;

View file

@ -16,7 +16,6 @@
package org.eclipse.cdt.internal.core.pdom.export;
import java.io.File;
import java.text.MessageFormat;
import java.util.Map;
import org.eclipse.cdt.core.CCorePlugin;
@ -34,6 +33,8 @@ import org.eclipse.core.runtime.MultiStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Status;
import com.ibm.icu.text.MessageFormat;
/**
* An ISafeRunnable which
* <ul>
@ -90,13 +91,14 @@ public class GeneratePDOM {
final ICProject cproject = pm.createProject();
if (cproject == null) {
fail(MessageFormat.format(Messages.GeneratePDOM_ProjectProviderReturnedNullCProject,
pm.getClass().getName()));
new Object[] { pm.getClass().getName() }));
return null; // Cannot be reached, inform the compiler
}
IIndexLocationConverter converter = pm.getLocationConverter(cproject);
if (converter == null) {
fail(MessageFormat.format(Messages.GeneratePDOM_NullLocationConverter, pm.getClass().getName()));
fail(MessageFormat.format(Messages.GeneratePDOM_NullLocationConverter,
new Object[] { pm.getClass().getName() }));
}
// Index the project
@ -147,7 +149,8 @@ public class GeneratePDOM {
exportedPDOM.releaseWriteLock();
}
} catch (InterruptedException ie) {
String msg = MessageFormat.format(Messages.GeneratePDOM_GenericGenerationFailed, ie.getMessage());
String msg = MessageFormat.format(Messages.GeneratePDOM_GenericGenerationFailed,
new Object[] { ie.getMessage() });
throw new CoreException(CCorePlugin.createStatus(msg, ie));
} finally {
if (deleteOnExit) {

View file

@ -16,7 +16,6 @@ package org.eclipse.cdt.internal.core.pdom.export;
import java.io.File;
import java.io.PrintStream;
import java.text.MessageFormat;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -41,6 +40,8 @@ import org.eclipse.core.runtime.jobs.ProgressProvider;
import org.eclipse.equinox.app.IApplication;
import org.eclipse.equinox.app.IApplicationContext;
import com.ibm.icu.text.MessageFormat;
/**
* An eclipse application for generating PDOM's without starting the Workbench
*/
@ -90,7 +91,7 @@ public class GeneratePDOMApplication implements IApplication {
String pproviderFQN;
if (!arguments.containsKey(OPT_PROJECTPROVIDER)) {
output(MessageFormat.format(Messages.GeneratePDOMApplication_UsingDefaultProjectProvider,
DEFAULT_PROJECT_PROVIDER));
new Object[] { DEFAULT_PROJECT_PROVIDER }));
pproviderFQN = DEFAULT_PROJECT_PROVIDER;
} else {
pproviderFQN = CLIUtil.getArg(arguments, OPT_PROJECTPROVIDER, 1).get(0);
@ -104,7 +105,8 @@ public class GeneratePDOMApplication implements IApplication {
if (indexerIDs.size() == 1) {
indexerID = indexerIDs.get(0);
} else if (indexerIDs.size() > 1) {
fail(MessageFormat.format(Messages.GeneratePDOMApplication_InvalidIndexerID, OPT_INDEXER_ID));
fail(MessageFormat.format(Messages.GeneratePDOMApplication_InvalidIndexerID,
new Object[] { OPT_INDEXER_ID }));
}
}

View file

@ -15,7 +15,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.pdom.indexer;
import java.text.NumberFormat;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Collections;
@ -48,6 +47,8 @@ import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.osgi.util.NLS;
import com.ibm.icu.text.NumberFormat;
/**
* Configures the abstract indexer task suitable for indexing projects.
*/

View file

@ -21,7 +21,6 @@ package org.eclipse.cdt.core;
import java.io.IOException;
import java.net.URL;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
@ -102,6 +101,8 @@ import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import org.osgi.framework.Version;
import com.ibm.icu.text.MessageFormat;
/**
* CCorePlugin is the life-cycle owner of the core plug-in, and starting point
* for access to many core APIs.
@ -336,7 +337,7 @@ public class CCorePlugin extends Plugin {
}
public static String getFormattedString(String key, String arg) {
return MessageFormat.format(getResourceString(key), arg);
return MessageFormat.format(getResourceString(key), new Object[] { arg });
}
public static String getFormattedString(String key, String[] args) {

View file

@ -13,7 +13,6 @@
*******************************************************************************/
package org.eclipse.cdt.core.resources;
import java.text.MessageFormat;
import java.util.Collections;
import java.util.Iterator;
import java.util.LinkedList;
@ -24,6 +23,8 @@ import org.eclipse.cdt.core.settings.model.ICStorageElement;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import com.ibm.icu.text.MessageFormat;
/**
* A RefreshExclusion represents a rule for excluding certain resources from being refreshed.
*

View file

@ -19,7 +19,6 @@ package org.eclipse.cdt.internal.core;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.text.MessageFormat;
import java.util.HashMap;
import java.util.LinkedHashSet;
import java.util.Map;
@ -59,6 +58,8 @@ import org.eclipse.core.runtime.jobs.Job;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import com.ibm.icu.text.MessageFormat;
/**
* Concrete ICDescriptor for a Project.
*
@ -135,7 +136,7 @@ final public class CConfigBasedDescriptor implements ICDescriptor {
if (!getProject().isAccessible())
throw ExceptionFactory.createCoreException(
MessageFormat.format(CCorePlugin.getResourceString("ProjectDescription.ProjectNotAccessible"), //$NON-NLS-1$
getProject().getName()));
new Object[] { getProject().getName() }));
if (fIsDirty) {
ICProjectDescription des = fCfgDes.getProjectDescription();
if (des.isCdtProjectCreating())

View file

@ -22,14 +22,15 @@ import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.io.Writer;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
import com.ibm.icu.text.DateFormat;
import com.ibm.icu.text.SimpleDateFormat;
public class CDTLogWriter {
protected File logFile = null;
protected Writer log = null;

View file

@ -24,7 +24,6 @@ import java.io.IOException;
import java.io.InputStreamReader;
import java.io.RandomAccessFile;
import java.net.URL;
import java.text.MessageFormat;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
@ -33,6 +32,8 @@ import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import com.ibm.icu.text.MessageFormat;
/**
* Acts as helper class for process the processes i.e., copy, replace and append files.
*/

View file

@ -13,12 +13,12 @@
*******************************************************************************/
package org.eclipse.cdt.core.templateengine.process;
import java.text.MessageFormat;
import org.eclipse.cdt.core.templateengine.TemplateCore;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import com.ibm.icu.text.MessageFormat;
/**
* Abstract ProcessRunner class provides the methods to implement for processes.
*/

View file

@ -18,13 +18,14 @@ import java.io.IOException;
import java.io.RandomAccessFile;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel.MapMode;
import java.text.DateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.eclipse.cdt.core.CCorePlugin;
import com.ibm.icu.text.DateFormat;
/**
* @deprecated Deprecated as of CDT 6.9. Use 64 bit version {@link Coff64}.
* This class is planned for removal in next major release.

View file

@ -19,13 +19,14 @@ import java.io.IOException;
import java.io.RandomAccessFile;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel.MapMode;
import java.text.DateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.eclipse.cdt.core.CCorePlugin;
import com.ibm.icu.text.DateFormat;
/**
* @since 6.9
*/

View file

@ -16,13 +16,14 @@ package org.eclipse.cdt.utils.xcoff;
import java.io.EOFException;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.text.DateFormat;
import java.util.ArrayList;
import java.util.Date;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.utils.coff.ReadMemoryAccess;
import com.ibm.icu.text.DateFormat;
/**
* Representation of AIX XCOFF32 binary format
*

View file

@ -34,6 +34,7 @@ Require-Bundle: org.eclipse.jface.text,
org.eclipse.compare,
org.eclipse.ui.console,
org.eclipse.core.expressions,
com.ibm.icu,
org.eclipse.ltk.core.refactoring;bundle-version="3.4.0",
org.eclipse.core.filesystem;bundle-version="1.2.0",
org.eclipse.ltk.ui.refactoring,

View file

@ -13,7 +13,6 @@
*******************************************************************************/
package org.eclipse.cdt.ui.tests.refactoring.includes;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@ -38,6 +37,8 @@ import org.eclipse.cdt.ui.PreferenceConstants;
import org.eclipse.cdt.ui.testplugin.CTestPlugin;
import org.eclipse.jface.preference.IPreferenceStore;
import com.ibm.icu.text.MessageFormat;
import junit.framework.TestSuite;
/**

View file

@ -14,7 +14,7 @@
*******************************************************************************/
package org.eclipse.cdt.ui.tests.text;
import java.text.BreakIterator;
import com.ibm.icu.text.BreakIterator;
import junit.framework.TestCase;

View file

@ -13,7 +13,7 @@
*******************************************************************************/
package org.eclipse.cdt.internal.corext.codemanipulation;
import java.text.Collator;
import com.ibm.icu.text.Collator;
public class IncludeInfo implements Comparable<IncludeInfo> {
private static final Collator COLLATOR = Collator.getInstance();

View file

@ -13,8 +13,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.corext.template.c;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
@ -35,6 +33,9 @@ import org.eclipse.jface.text.templates.TemplateVariableResolver;
import org.eclipse.jface.text.templates.TemplateVariableType;
import org.eclipse.text.templates.ContextTypeRegistry;
import com.ibm.icu.text.DateFormat;
import com.ibm.icu.text.SimpleDateFormat;
/**
* A generic template context type for file resources based on content-type.
*

View file

@ -13,7 +13,7 @@
*******************************************************************************/
package org.eclipse.cdt.internal.corext.util;
import java.text.MessageFormat;
import com.ibm.icu.text.MessageFormat;
/**
* Helper class to format message strings.
@ -22,7 +22,11 @@ import java.text.MessageFormat;
*/
public class Messages {
public static String format(String message, Object... objects) {
public static String format(String message, Object object) {
return MessageFormat.format(message, new Object[] { object });
}
public static String format(String message, Object[] objects) {
return MessageFormat.format(message, objects);
}

View file

@ -13,10 +13,11 @@
*******************************************************************************/
package org.eclipse.cdt.internal.ui.actions;
import java.text.MessageFormat;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
import com.ibm.icu.text.MessageFormat;
/**
* Class that gives access to the folding messages resource bundle.
*/
@ -55,6 +56,19 @@ public class FoldingMessages {
return RESOURCE_BUNDLE;
}
/**
* Returns the formatted resource string associated with the given key in the resource bundle.
* <code>MessageFormat</code> is used to format the message. If there isn't any value
* under the given key, the key is returned.
*
* @param key the resource key
* @param arg the message argument
* @return the string
*/
public static String getFormattedString(String key, Object arg) {
return getFormattedString(key, new Object[] { arg });
}
/**
* Returns the formatted resource string associated with the given key in the resource bundle.
* <code>MessageFormat</code> is used to format the message. If there isn't any value
@ -64,7 +78,7 @@ public class FoldingMessages {
* @param args the message arguments
* @return the string
*/
public static String getFormattedString(String key, Object... args) {
public static String getFormattedString(String key, Object[] args) {
return MessageFormat.format(getString(key), args);
}
}

View file

@ -14,7 +14,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.ui.dialogs;
import java.text.BreakIterator;
import java.util.ArrayList;
import java.util.List;
@ -50,6 +49,8 @@ import org.eclipse.ui.commands.ICommandService;
import org.eclipse.ui.keys.IBindingService;
import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds;
import com.ibm.icu.text.BreakIterator;
/**
* Support for camelCase-aware sub-word navigation in dialog fields.
*/

View file

@ -20,7 +20,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.ui.editor;
import java.text.BreakIterator;
import java.text.CharacterIterator;
import java.util.ArrayDeque;
import java.util.ArrayList;
@ -240,6 +239,8 @@ import org.eclipse.ui.texteditor.link.EditorLinkedModeUI;
import org.eclipse.ui.texteditor.templates.ITemplatesPage;
import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
import com.ibm.icu.text.BreakIterator;
/**
* C/C++ source editor.
*/

View file

@ -13,10 +13,11 @@
*******************************************************************************/
package org.eclipse.cdt.internal.ui.editor;
import java.text.MessageFormat;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
import com.ibm.icu.text.MessageFormat;
public class ConstructedCEditorMessages {
private static final String RESOURCE_BUNDLE = "org.eclipse.cdt.internal.ui.editor.ConstructedCEditorMessages"; //$NON-NLS-1$
@ -49,7 +50,14 @@ public class ConstructedCEditorMessages {
/**
* Gets a string from the resource bundle and formats it with arguments
*/
public static String getFormattedString(String key, Object... args) {
public static String getFormattedString(String key, Object[] args) {
return MessageFormat.format(getString(key), args);
}
/**
* Gets a string from the resource bundle and formats it with arguments
*/
public static String getFormattedString(String key, Object arg) {
return MessageFormat.format(getString(key), new Object[] { arg });
}
}

View file

@ -13,7 +13,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.ui.editor;
import java.text.Collator;
import java.util.Arrays;
import org.eclipse.cdt.core.model.ICProject;
@ -38,6 +37,8 @@ import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.texteditor.ITextEditor;
import org.eclipse.ui.texteditor.TextEditorAction;
import com.ibm.icu.text.Collator;
/**
* Sorts selected lines in alphabetical order. If both, comment and non-comment lines
* are selected, the non-comment lines are sorted, and the comments are moved together

View file

@ -13,7 +13,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.ui.filters;
import java.text.Collator;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
@ -30,6 +29,8 @@ import org.eclipse.jface.util.SafeRunnable;
import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.osgi.util.NLS;
import com.ibm.icu.text.Collator;
/**
* Represents a custom filter which is provided by the
* "org.eclipse.jdt.ui.javaElementFilters" extension point.

View file

@ -18,7 +18,6 @@ package org.eclipse.cdt.internal.ui.preferences;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.text.Collator;
import java.util.ArrayList;
import java.util.List;
@ -77,6 +76,8 @@ import org.eclipse.ui.dialogs.PreferencesUtil;
import org.eclipse.ui.editors.text.EditorsUI;
import org.eclipse.ui.texteditor.ChainedPreferenceStore;
import com.ibm.icu.text.Collator;
/**
* Configures C/C++ Editor code coloring preferences.
*

View file

@ -21,7 +21,6 @@ import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.text.Collator;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
@ -72,6 +71,8 @@ import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.XMLMemento;
import com.ibm.icu.text.Collator;
/**
* Dialog for editing a header file substitution map.
*/

View file

@ -14,12 +14,12 @@
*******************************************************************************/
package org.eclipse.cdt.internal.ui.refactoring.gettersandsetters;
import java.text.Collator;
import org.eclipse.cdt.core.dom.ast.IASTFunctionDefinition;
import org.eclipse.cdt.core.dom.ast.IASTName;
import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclaration;
import com.ibm.icu.text.Collator;
public class AccessorDescriptor implements Comparable<AccessorDescriptor> {
public enum AccessorKind {
GETTER, SETTER;

View file

@ -18,7 +18,6 @@ package org.eclipse.cdt.internal.ui.refactoring.includes;
import static org.eclipse.cdt.core.index.IndexLocationFactory.getAbsolutePath;
import java.text.Collator;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
@ -89,6 +88,8 @@ import org.eclipse.jface.text.ITextSelection;
import org.eclipse.text.edits.InsertEdit;
import org.eclipse.text.edits.MultiTextEdit;
import com.ibm.icu.text.Collator;
/**
* Adds an include statement and, optionally, a 'using' declaration for the currently
* selected name.

View file

@ -17,7 +17,6 @@ package org.eclipse.cdt.internal.ui.refactoring.includes;
import static org.eclipse.cdt.core.index.IndexLocationFactory.getAbsolutePath;
import static org.eclipse.cdt.internal.ui.refactoring.includes.IncludeUtil.isContainedInRegion;
import java.text.Collator;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
@ -81,6 +80,8 @@ import org.eclipse.text.edits.InsertEdit;
import org.eclipse.text.edits.MultiTextEdit;
import org.eclipse.text.edits.ReplaceEdit;
import com.ibm.icu.text.Collator;
/**
* Organizes the include directives and forward declarations of a source or header file.
*/

View file

@ -16,7 +16,6 @@ package org.eclipse.cdt.internal.ui.refactoring.includes;
import java.io.IOException;
import java.io.StringReader;
import java.io.StringWriter;
import java.text.Collator;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
@ -32,6 +31,8 @@ import org.eclipse.ui.IMemento;
import org.eclipse.ui.WorkbenchException;
import org.eclipse.ui.XMLMemento;
import com.ibm.icu.text.Collator;
/**
* A set of header file substitution rules.
*/
@ -71,7 +72,7 @@ public class SymbolExportMap {
/**
* Indicates that the given symbol is exported by the given header.
*
* @param symbol The symbol represented by its fully qualified name.
* @param header The header file exporting the symbol.
*/
@ -88,7 +89,7 @@ public class SymbolExportMap {
/**
* Indicates that the given symbol is exported by the given header.
*
* @param symbol The symbol represented by its fully qualified name.
* @param header The header file exporting the symbol. The header is represented by an include
* name optionally surrounded by double quotes or angle brackets. Angle brackets indicate

View file

@ -14,7 +14,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.ui.search;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
@ -30,6 +29,8 @@ import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.Viewer;
import com.ibm.icu.text.MessageFormat;
/**
* @author Doug Schaefer
*/
@ -92,13 +93,13 @@ public class CSearchListContentProvider implements IStructuredContentProvider, I
private Status createUnindexedProjectWarningElement(ICProject project) {
return new Status(IStatus.WARNING, CUIPlugin.PLUGIN_ID,
MessageFormat.format(CSearchMessages.PDOMSearchListContentProvider_IndexerNotEnabledMessageFormat,
project.getProject().getName()));
new Object[] { project.getProject().getName() }));
}
private Status createClosedProjectWarningElement(ICProject project) {
return new Status(IStatus.WARNING, CUIPlugin.PLUGIN_ID,
MessageFormat.format(CSearchMessages.PDOMSearchListContentProvider_ProjectClosedMessageFormat,
project.getProject().getName()));
new Object[] { project.getProject().getName() }));
}
@Override

View file

@ -17,8 +17,6 @@
package org.eclipse.cdt.internal.ui.search.actions;
import java.text.MessageFormat;
import org.eclipse.cdt.core.model.ITranslationUnit;
import org.eclipse.cdt.internal.ui.search.CSearchMessages;
import org.eclipse.cdt.internal.ui.util.EditorUtility;
@ -33,6 +31,8 @@ import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchSite;
import org.eclipse.ui.texteditor.ITextEditor;
import com.ibm.icu.text.MessageFormat;
/**
* @author aniefer
* Created on Jun 2, 2004
@ -111,8 +111,8 @@ public class SelectionParseAction extends Action {
}
protected void reportSourceFileOpenFailure(IPath path) {
showStatusLineMessage(
MessageFormat.format(CSearchMessages.SelectionParseAction_FileOpenFailure_format, path.toOSString()));
showStatusLineMessage(MessageFormat.format(CSearchMessages.SelectionParseAction_FileOpenFailure_format,
new Object[] { path.toOSString() }));
}
protected void reportSelectionMatchFailure() {
@ -120,12 +120,12 @@ public class SelectionParseAction extends Action {
}
protected void reportSymbolLookupFailure(String symbol) {
showStatusLineMessage(
MessageFormat.format(CSearchMessages.SelectionParseAction_SymbolNotFoundInIndex_format, symbol));
showStatusLineMessage(MessageFormat.format(CSearchMessages.SelectionParseAction_SymbolNotFoundInIndex_format,
new Object[] { symbol }));
}
protected void reportIncludeLookupFailure(String filename) {
showStatusLineMessage(
MessageFormat.format(CSearchMessages.SelectionParseAction_IncludeNotFound_format, filename));
showStatusLineMessage(MessageFormat.format(CSearchMessages.SelectionParseAction_IncludeNotFound_format,
new Object[] { filename }));
}
}

View file

@ -14,11 +14,12 @@
*******************************************************************************/
package org.eclipse.cdt.internal.ui.text;
import java.text.BreakIterator;
import java.text.CharacterIterator;
import org.eclipse.core.runtime.Assert;
import com.ibm.icu.text.BreakIterator;
/**
* A C break iterator. It returns all breaks, including before and after
* whitespace, and it returns all camel case breaks.
@ -376,6 +377,7 @@ public class CBreakIterator extends BreakIterator {
* Creates a break iterator given a char sequence.
* @param newText the new text
*/
@Override
public void setText(CharSequence newText) {
fText = newText;
fIterator.setText(new SequenceCharacterIterator(newText));

View file

@ -14,11 +14,12 @@
*******************************************************************************/
package org.eclipse.cdt.internal.ui.text;
import java.text.BreakIterator;
import java.text.CharacterIterator;
import org.eclipse.core.runtime.Assert;
import com.ibm.icu.text.BreakIterator;
/**
* Breaks C text into word starts, also stops at line start and end. No
* direction dependency.
@ -182,6 +183,7 @@ public class CWordIterator extends BreakIterator {
* Sets the text as <code>CharSequence</code>.
* @param newText the new text
*/
@Override
public void setText(CharSequence newText) {
fIterator.setText(newText);
first();

View file

@ -16,7 +16,6 @@
package org.eclipse.cdt.internal.ui.text.c.hover;
import java.text.MessageFormat;
import java.util.Iterator;
import org.eclipse.cdt.internal.ui.CPluginImages;
@ -86,6 +85,8 @@ import org.eclipse.ui.editors.text.EditorsUI;
import org.eclipse.ui.texteditor.AnnotationPreference;
import org.eclipse.ui.texteditor.DefaultMarkerAnnotationAccess;
import com.ibm.icu.text.MessageFormat;
/**
* AbstractAnnotationHover
* Abstract super class for annotation hovers.
@ -351,7 +352,7 @@ public class AbstractAnnotationHover extends AbstractCEditorTextHover {
text = CHoverMessages.AbstractAnnotationHover_message_singleQuickFix;
} else {
text = MessageFormat.format(CHoverMessages.AbstractAnnotationHover_message_multipleQuickFix,
String.valueOf(proposals.length));
new Object[] { String.valueOf(proposals.length) });
}
quickFixLabel.setText(text);

View file

@ -14,7 +14,6 @@
package org.eclipse.cdt.internal.ui.text.c.hover;
import java.text.Collator;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
@ -35,6 +34,8 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.swt.SWT;
import org.osgi.framework.Bundle;
import com.ibm.icu.text.Collator;
/**
* CEditorTexHoverDescriptor
*/

View file

@ -15,8 +15,6 @@
package org.eclipse.cdt.internal.ui.text.correction.proposals;
import java.text.MessageFormat;
import org.eclipse.cdt.internal.ui.text.correction.CorrectionCommandHandler;
import org.eclipse.cdt.internal.ui.text.correction.CorrectionMessages;
import org.eclipse.cdt.internal.ui.text.correction.ICommandAccess;
@ -43,6 +41,8 @@ import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import org.eclipse.ui.IEditorPart;
import com.ibm.icu.text.MessageFormat;
/**
* Implementation of a C completion proposal to be used for quick fix and quick assist
* proposals that invoke a {@link Change}. The proposal offers a proposal information but no context
@ -177,8 +177,8 @@ public class ChangeCorrectionProposal implements ICCompletionProposal, ICommandA
public String getDisplayString() {
String shortCutString = CorrectionCommandHandler.getShortCutString(getCommandId());
if (shortCutString != null) {
return MessageFormat.format(CorrectionMessages.ChangeCorrectionProposal_name_with_shortcut, getName(),
shortCutString);
return MessageFormat.format(CorrectionMessages.ChangeCorrectionProposal_name_with_shortcut,
new Object[] { getName(), shortCutString });
}
return getName();
}
@ -190,7 +190,7 @@ public class ChangeCorrectionProposal implements ICCompletionProposal, ICommandA
String shortCutString = CorrectionCommandHandler.getShortCutString(getCommandId());
if (shortCutString != null) {
String decorated = MessageFormat.format(CorrectionMessages.ChangeCorrectionProposal_name_with_shortcut,
getName(), shortCutString);
new Object[] { getName(), shortCutString });
return ColoringLabelProvider.decorateStyledString(str, decorated, StyledString.QUALIFIER_STYLER);
}
return str;

View file

@ -15,7 +15,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.ui.text.doctools;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@ -43,6 +42,8 @@ import org.eclipse.core.runtime.preferences.DefaultScope;
import org.eclipse.core.runtime.preferences.InstanceScope;
import org.osgi.service.prefs.Preferences;
import com.ibm.icu.text.MessageFormat;
/**
* This class manages which IDocCommentOwner's are available in the run-time, and how they map to
* resources in projects.
@ -248,7 +249,8 @@ public class DocCommentOwnerManager {
String id = element.getAttribute(ATTRKEY_OWNER_ID);
String name = element.getAttribute(ATTRKEY_OWNER_NAME);
if (result.put(id, new DocCommentOwner(id, name, multi, single)) != null) {
String msg = MessageFormat.format(Messages.DocCommentOwnerManager_DuplicateMapping0, id);
String msg = MessageFormat.format(Messages.DocCommentOwnerManager_DuplicateMapping0,
new Object[] { id });
CUIPlugin.log(new Status(IStatus.WARNING, CUIPlugin.PLUGIN_ID, msg));
}
}

View file

@ -14,7 +14,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.ui.text.spelling;
import java.text.BreakIterator;
import java.util.LinkedList;
import java.util.Locale;
@ -24,6 +23,8 @@ import org.eclipse.cdt.internal.ui.text.spelling.engine.ISpellCheckIterator;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
import com.ibm.icu.text.BreakIterator;
/**
* Iterator to spell check multiline comment regions.
*/

View file

@ -14,7 +14,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.ui.typehierarchy;
import java.text.MessageFormat;
import java.util.Iterator;
import org.eclipse.cdt.core.model.CModelException;
@ -45,6 +44,8 @@ import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeItem;
import org.eclipse.ui.progress.IWorkbenchSiteProgressService;
import com.ibm.icu.text.MessageFormat;
public class THInformationControl extends AbstractInformationControl implements ITHModelPresenter {
private THHierarchyModel fModel;
private THLabelProvider fHierarchyLabelProvider;
@ -253,7 +254,7 @@ public class THInformationControl extends AbstractInformationControl implements
default:
break;
}
return MessageFormat.format(message, keyName);
return MessageFormat.format(message, new Object[] { keyName });
}
@Override

View file

@ -14,7 +14,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.ui.typehierarchy;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
@ -105,6 +104,8 @@ import org.eclipse.ui.part.PageBook;
import org.eclipse.ui.part.ViewPart;
import org.eclipse.ui.progress.IWorkbenchSiteProgressService;
import com.ibm.icu.text.MessageFormat;
/**
* The view part for the include browser.
*/
@ -398,8 +399,8 @@ public class THViewPart extends ViewPart implements ITHModelPresenter {
if (elem != null) {
menu.appendToGroup(IContextMenuConstants.GROUP_OPEN, fOpenElement);
if (hierarchyView && !elem.equals(fModel.getInput())) {
String label = MessageFormat.format(Messages.THViewPart_FocusOn, CElementLabels.getTextLabel(elem,
CElementLabels.ALL_FULLY_QUALIFIED | CElementLabels.M_PARAMETER_TYPES));
String label = MessageFormat.format(Messages.THViewPart_FocusOn, new Object[] { CElementLabels
.getTextLabel(elem, CElementLabels.ALL_FULLY_QUALIFIED | CElementLabels.M_PARAMETER_TYPES) });
menu.appendToGroup(IContextMenuConstants.GROUP_OPEN, new Action(label) {
@Override
public void run() {
@ -909,7 +910,7 @@ public class THViewPart extends ViewPart implements ITHModelPresenter {
message = label;
} else {
String scope = workingSet.getLabel();
message = MessageFormat.format("{0} - {1}", label, scope); //$NON-NLS-1$
message = MessageFormat.format("{0} - {1}", new Object[] { label, scope }); //$NON-NLS-1$
}
label = ""; //$NON-NLS-1$

View file

@ -21,7 +21,6 @@ import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
@ -104,6 +103,8 @@ import org.eclipse.ui.part.MultiEditorInput;
import org.eclipse.ui.texteditor.IDocumentProvider;
import org.eclipse.ui.texteditor.ITextEditor;
import com.ibm.icu.text.MessageFormat;
public class EditorUtility {
/**
* The ID of the default text editor
@ -254,7 +255,7 @@ public class EditorUtility {
MessageBox errorMsg = new MessageBox(CUIPlugin.getActiveWorkbenchShell(), SWT.ICON_ERROR | SWT.OK);
errorMsg.setText(CUIPlugin.getResourceString("EditorUtility.closedproject")); //$NON-NLS-1$
String desc = CUIPlugin.getResourceString("Editorutility.closedproject.description"); //$NON-NLS-1$
errorMsg.setMessage(MessageFormat.format(desc, project.getName()));
errorMsg.setMessage(MessageFormat.format(desc, new Object[] { project.getName() }));
errorMsg.open();
}

View file

@ -14,10 +14,10 @@
*******************************************************************************/
package org.eclipse.cdt.internal.ui.util;
import java.text.MessageFormat;
import org.eclipse.osgi.util.NLS;
import com.ibm.icu.text.MessageFormat;
public class Messages extends NLS {
public static String EditorUtility_calculatingChangedRegions_message;
public static String EditorUtility_error_calculatingChangedRegions;

View file

@ -13,7 +13,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.ui.util;
import java.text.BreakIterator;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@ -21,6 +20,8 @@ import java.util.List;
import org.eclipse.cdt.internal.ui.text.CBreakIterator;
import org.eclipse.cdt.ui.PreferenceConstants;
import com.ibm.icu.text.BreakIterator;
/**
* Composes names according to a particular style. A seed name is split into
* words at non-alphanumeric characters and camel case boundaries. The resulting

View file

@ -14,7 +14,6 @@
package org.eclipse.cdt.internal.ui.workingsets;
import java.text.Collator;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
@ -26,6 +25,8 @@ import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.IWorkingSet;
import org.eclipse.ui.actions.CompoundContributionItem;
import com.ibm.icu.text.Collator;
/**
* Common API of dynamic contribution of items to manipulate configurations of a working set.
*

View file

@ -20,7 +20,6 @@ package org.eclipse.cdt.ui;
import java.io.IOException;
import java.net.URL;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
@ -112,6 +111,8 @@ import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
import org.osgi.framework.ServiceReference;
import com.ibm.icu.text.MessageFormat;
/**
* @noextend This class is not intended to be subclassed by clients.
* @noinstantiate This class is not intended to be instantiated by clients.

View file

@ -14,7 +14,6 @@
*******************************************************************************/
package org.eclipse.cdt.ui.dialogs;
import java.text.Collator;
import java.util.Arrays;
import java.util.Comparator;
import java.util.HashMap;
@ -53,6 +52,8 @@ import org.eclipse.ui.IPluginContribution;
import org.eclipse.ui.activities.WorkbenchActivityHelper;
import org.eclipse.ui.dialogs.PropertyPage;
import com.ibm.icu.text.Collator;
/**
* This <code>IndexerBlock</code> is used in the <code>MakeProjectWizardOptionPage</code> and
* the <code>NewManagedProjectOptionPage</code> to display the indexer options during the creation of

View file

@ -15,7 +15,6 @@
package org.eclipse.cdt.ui.dialogs;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.List;
@ -70,6 +69,8 @@ import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.dialogs.PreferencesUtil;
import org.eclipse.ui.fieldassist.ContentAssistCommandAdapter;
import com.ibm.icu.text.MessageFormat;
/**
* Options page for RegexErrorParser in Error Parsers Tab of properties/preferences.
*
@ -586,7 +587,8 @@ public final class RegexErrorParserOptionPage extends AbstractCOptionPage {
columnViewer.getColumn().setText(DialogsMessages.RegexErrorParserOptionPage_EatColumn);
columnViewer.getColumn().setResizable(true);
String message = MessageFormat.format(DialogsMessages.RegexErrorParserOptionPage_TooltipConsume, EAT_NO);
String message = MessageFormat.format(DialogsMessages.RegexErrorParserOptionPage_TooltipConsume,
new Object[] { EAT_NO });
columnViewer.getColumn().setToolTipText(message);
columnViewer.setLabelProvider(new ColumnLabelProvider() {

View file

@ -14,7 +14,6 @@
*******************************************************************************/
package org.eclipse.cdt.ui.newui;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
@ -72,6 +71,8 @@ import org.eclipse.swt.widgets.TableItem;
import org.eclipse.ui.PlatformUI;
import org.osgi.service.prefs.BackingStoreException;
import com.ibm.icu.text.MessageFormat;
/**
* This class represents Error Parser Tab in Project Properties or workspace Preferences
*
@ -370,7 +371,7 @@ public class ErrorParsTab extends AbstractCPropertyTab {
status.setError(Messages.ErrorParsTab_error_NonEmptyName);
} else if (newText.indexOf(ErrorParserManager.ERROR_PARSER_DELIMITER) >= 0) {
String message = MessageFormat.format(Messages.ErrorParsTab_error_IllegalCharacter,
ErrorParserManager.ERROR_PARSER_DELIMITER);
new Object[] { ErrorParserManager.ERROR_PARSER_DELIMITER });
status.setError(message);
} else if (fAvailableErrorParsers.containsKey(makeId(newText))) {
status.setError(Messages.ErrorParsTab_error_NonUniqueID);
@ -415,7 +416,7 @@ public class ErrorParsTab extends AbstractCPropertyTab {
status.setError(Messages.ErrorParsTab_error_NonEmptyName);
} else if (newText.indexOf(ErrorParserManager.ERROR_PARSER_DELIMITER) >= 0) {
String message = MessageFormat.format(Messages.ErrorParsTab_error_IllegalCharacter,
ErrorParserManager.ERROR_PARSER_DELIMITER);
new Object[] { ErrorParserManager.ERROR_PARSER_DELIMITER });
status.setError(message);
}
return status;

View file

@ -13,10 +13,11 @@
*******************************************************************************/
package org.eclipse.cdt.ui.newui;
import java.text.MessageFormat;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
import com.ibm.icu.text.MessageFormat;
/**
* @since 2.0
* @noextend This class is not intended to be subclassed by clients.
@ -44,7 +45,7 @@ public class UIMessages {
public static String getFormattedString(String key, String arg) {
key = toNlsFormatKey(key);
return MessageFormat.format(getString(key), arg);
return MessageFormat.format(getString(key), new Object[] { arg });
}
public static String getFormattedString(String key, String[] args) {

View file

@ -13,7 +13,6 @@
*******************************************************************************/
package org.eclipse.cdt.ui.text.doctools.generic;
import java.text.BreakIterator;
import java.text.CharacterIterator;
import org.eclipse.jface.text.BadLocationException;
@ -23,6 +22,8 @@ import org.eclipse.jface.text.ITextDoubleClickStrategy;
import org.eclipse.jface.text.ITextViewer;
import org.eclipse.jface.text.Region;
import com.ibm.icu.text.BreakIterator;
/**
* A double-click strategy for words starting with specified tag markers.
* @since 5.0

View file

@ -14,7 +14,6 @@
*******************************************************************************/
package org.eclipse.cdt.ui.templateengine.uitree;
import java.text.MessageFormat;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
@ -37,6 +36,8 @@ import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.ibm.icu.text.MessageFormat;
/**
* UIElementTreeBuilderHelper provides methods to convert an Element (XML) into
* UIElement. The UIElement can be a simple UI Widget or a group.
@ -127,14 +128,14 @@ public class UIElementTreeBuilderHelper implements IUIElementTreeBuilderHelper {
if (label == null || value == null) {
String msg = MessageFormat.format(
Messages.getString("UIElementTreeBuilderHelper.InvalidEmptyLabel"), //$NON-NLS-1$
id);
new Object[] { id });
CUIPlugin.log(TEMPLATE_ENGINE_ERROR,
new CoreException(new Status(IStatus.ERROR, CUIPlugin.PLUGIN_ID, msg)));
} else {
if (value2name.put(value, label) != null) {
String msg = MessageFormat.format(
Messages.getString("UIElementTreeBuilderHelper.InvalidNonUniqueValue"), //$NON-NLS-1$
value, id);
new Object[] { value, id });
CUIPlugin.log(TEMPLATE_ENGINE_ERROR,
new CoreException(new Status(IStatus.ERROR, CUIPlugin.PLUGIN_ID, msg)));
}
@ -161,7 +162,7 @@ public class UIElementTreeBuilderHelper implements IUIElementTreeBuilderHelper {
// for generating UI pages as TABS in a single page.
} else {
String msg = MessageFormat.format(Messages.getString("UIElementTreeBuilderHelper.UnknownWidgetType0"), //$NON-NLS-1$
type);
new Object[] { type });
CUIPlugin.log(TEMPLATE_ENGINE_ERROR,
new CoreException(new Status(IStatus.ERROR, CUIPlugin.PLUGIN_ID, msg)));
}

View file

@ -13,7 +13,6 @@
*******************************************************************************/
package org.eclipse.cdt.ui.templateengine.uitree.uiwidgets;
import java.text.MessageFormat;
import java.util.HashMap;
import java.util.Map;
@ -31,6 +30,8 @@ import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import com.ibm.icu.text.MessageFormat;
/**
* This gives a Label and Combo widget.
*/

View file

@ -14,7 +14,6 @@
package org.eclipse.cdt.ui.templateengine.uitree.uiwidgets;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
@ -35,6 +34,8 @@ import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import com.ibm.icu.text.MessageFormat;
/**
* This gives a Label and StringList Widget.
*

View file

@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.cdt.debug.core; singleton:=true
Bundle-Version: 8.4.100.qualifier
Bundle-Version: 8.4.0.qualifier
Bundle-Activator: org.eclipse.cdt.debug.core.CDebugCorePlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
@ -47,4 +47,5 @@ Require-Bundle: org.eclipse.cdt.core;bundle-version="[5.0.0,7.0.0)",
org.eclipse.launchbar.core;bundle-version="2.0.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Import-Package: com.ibm.icu.text
Automatic-Module-Name: org.eclipse.cdt.debug.core

View file

@ -21,7 +21,6 @@ import java.io.FileNotFoundException;
import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.charset.CharsetDecoder;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@ -65,6 +64,8 @@ import org.eclipse.debug.core.model.IBreakpoint;
import org.osgi.service.prefs.BackingStoreException;
import org.w3c.dom.Document;
import com.ibm.icu.text.MessageFormat;
/**
* Utility methods.
*/
@ -441,7 +442,7 @@ public class CDebugUtils {
if (lineNumber > 0) {
label.append(' ');
label.append(MessageFormat.format(DebugCoreMessages.getString("CDebugUtils.0"), //$NON-NLS-1$
Integer.toString(lineNumber)));
(Object[]) new String[] { Integer.toString(lineNumber) }));
}
return label;
}
@ -451,7 +452,7 @@ public class CDebugUtils {
try {
label.append(' ');
label.append(MessageFormat.format(DebugCoreMessages.getString("CDebugUtils.1"), //$NON-NLS-1$
breakpoint.getAddress()));
(Object[]) new String[] { breakpoint.getAddress() }));
} catch (NumberFormatException e) {
}
return label;
@ -463,7 +464,7 @@ public class CDebugUtils {
if (function != null && function.trim().length() > 0) {
label.append(' ');
label.append(MessageFormat.format(DebugCoreMessages.getString("CDebugUtils.2"), //$NON-NLS-1$
function.trim()));
(Object[]) new String[] { function.trim() }));
}
return label;
}
@ -476,7 +477,7 @@ public class CDebugUtils {
if (printfStr != null && printfStr.length() > 0) {
buffer.append(' ');
buffer.append(MessageFormat.format(DebugCoreMessages.getString("CDebugUtils.printfString"), //$NON-NLS-1$
printfStr));
(Object[]) new String[] { printfStr }));
}
}
@ -485,7 +486,7 @@ public class CDebugUtils {
if (ignoreCount > 0) {
label.append(' ');
label.append(MessageFormat.format(DebugCoreMessages.getString("CDebugUtils.3"), //$NON-NLS-1$
Integer.toString(ignoreCount)));
(Object[]) new String[] { Integer.toString(ignoreCount) }));
}
return label;
}
@ -495,7 +496,7 @@ public class CDebugUtils {
if (condition != null && condition.length() > 0) {
buffer.append(' ');
buffer.append(MessageFormat.format(DebugCoreMessages.getString("CDebugUtils.4"), //$NON-NLS-1$
condition));
(Object[]) new String[] { condition }));
}
}
@ -504,7 +505,7 @@ public class CDebugUtils {
if (expression != null && expression.length() > 0) {
label.append(' ');
label.append(MessageFormat.format(DebugCoreMessages.getString("CDebugUtils.5"), //$NON-NLS-1$
expression));
(Object[]) new String[] { expression }));
}
}
@ -513,7 +514,7 @@ public class CDebugUtils {
if (memorySpace != null && memorySpace.length() > 0) {
label.append(' ');
label.append(MessageFormat.format(DebugCoreMessages.getString("CDebugUtils.6"), //$NON-NLS-1$
memorySpace));
(Object[]) new String[] { memorySpace }));
}
}
@ -522,7 +523,7 @@ public class CDebugUtils {
if (range.length() > 0 && !range.equals("0")) { //$NON-NLS-1$
label.append(' ');
label.append(MessageFormat.format(DebugCoreMessages.getString("CDebugUtils.7"), //$NON-NLS-1$
range));
(Object[]) new String[] { range }));
}
}
@ -556,7 +557,7 @@ public class CDebugUtils {
if (typeString.length() > 0) {
label.append(' ');
label.append(MessageFormat.format(DebugCoreMessages.getString("CDebugUtils.8"), //$NON-NLS-1$
typeString));
(Object[]) new String[] { typeString }));
}
}
return label;

View file

@ -13,10 +13,11 @@
*******************************************************************************/
package org.eclipse.cdt.debug.core;
import java.text.MessageFormat;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
import com.ibm.icu.text.MessageFormat;
public class DebugCoreMessages {
private static final String BUNDLE_NAME = "org.eclipse.cdt.debug.core.DebugCoreMessages";//$NON-NLS-1$
@ -27,7 +28,7 @@ public class DebugCoreMessages {
}
static String getFormattedString(String key, String arg) {
return MessageFormat.format(getString(key), arg);
return MessageFormat.format(getString(key), new Object[] { arg });
}
static String getFormattedString(String key, String[] args) {

View file

@ -14,8 +14,6 @@
*******************************************************************************/
package org.eclipse.cdt.debug.internal.core.breakpoints;
import java.text.MessageFormat;
import org.eclipse.cdt.core.ProblemMarkerInfo;
import org.eclipse.cdt.core.model.ICModelMarker;
import org.eclipse.cdt.debug.core.CDebugCorePlugin;
@ -25,6 +23,8 @@ import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import com.ibm.icu.text.MessageFormat;
public class BreakpointProblems {
/**
@ -44,7 +44,7 @@ public class BreakpointProblems {
public static IMarker reportBreakpointMoved(ICBreakpoint breakpoint, int oldLineNumber, int newLineNumber,
String contextName, String contextID) throws CoreException {
String message = MessageFormat.format(BreakpointMessages.getString("BreakpointProblems_Moved"), //$NON-NLS-1$
Integer.valueOf(oldLineNumber), Integer.valueOf(newLineNumber));
new Object[] { Integer.valueOf(oldLineNumber), Integer.valueOf(newLineNumber) });
IMarker marker = BreakpointProblems.reportBreakpointProblem(breakpoint, message, IMarker.SEVERITY_INFO, MOVED,
true, false, contextName, contextID);
return marker;

View file

@ -13,7 +13,6 @@
*******************************************************************************/
package org.eclipse.cdt.debug.internal.core.breakpoints;
import java.text.MessageFormat;
import java.util.Map;
import org.eclipse.cdt.debug.core.CDebugUtils;
@ -21,6 +20,8 @@ import org.eclipse.cdt.debug.core.model.ICAddressBreakpoint;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import com.ibm.icu.text.MessageFormat;
/**
* A breakpoint that suspend the execution when a particular address is reached.
*/
@ -50,6 +51,6 @@ public class CAddressBreakpoint extends AbstractLineBreakpoint implements ICAddr
@Override
protected String getMarkerMessage() throws CoreException {
return MessageFormat.format(BreakpointMessages.getString("CAddressBreakpoint.0"), //$NON-NLS-1$
CDebugUtils.getBreakpointText(this, false));
(Object[]) new String[] { CDebugUtils.getBreakpointText(this, false) });
}
}

View file

@ -13,7 +13,6 @@
*******************************************************************************/
package org.eclipse.cdt.debug.internal.core.breakpoints;
import java.text.MessageFormat;
import java.util.Map;
import org.eclipse.cdt.debug.core.CDebugUtils;
@ -21,6 +20,8 @@ import org.eclipse.cdt.debug.core.model.ICAddressBreakpoint;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import com.ibm.icu.text.MessageFormat;
/**
* A DynamicPrintf that prints a message when a particular address is reached.
*
@ -46,6 +47,6 @@ public class CAddressDynamicPrintf extends AbstractDynamicPrintf implements ICAd
@Override
protected String getMarkerMessage() throws CoreException {
return MessageFormat.format(BreakpointMessages.getString("CAddressDynamicPrintf.0"), //$NON-NLS-1$
CDebugUtils.getBreakpointText(this, false));
(Object[]) new String[] { CDebugUtils.getBreakpointText(this, false) });
}
}

View file

@ -13,7 +13,6 @@
*******************************************************************************/
package org.eclipse.cdt.debug.internal.core.breakpoints;
import java.text.MessageFormat;
import java.util.Map;
import org.eclipse.cdt.debug.core.CDebugUtils;
@ -21,6 +20,8 @@ import org.eclipse.cdt.debug.core.model.ICAddressBreakpoint;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import com.ibm.icu.text.MessageFormat;
/**
* A tracepoint that collects data when a particular address is reached.
*
@ -52,6 +53,6 @@ public class CAddressTracepoint extends AbstractTracepoint implements ICAddressB
@Override
protected String getMarkerMessage() throws CoreException {
return MessageFormat.format(BreakpointMessages.getString("CAddressTracepoint.0"), //$NON-NLS-1$
CDebugUtils.getBreakpointText(this, false));
(Object[]) new String[] { CDebugUtils.getBreakpointText(this, false) });
}
}

View file

@ -14,7 +14,6 @@
*******************************************************************************/
package org.eclipse.cdt.debug.internal.core.breakpoints;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
@ -45,6 +44,8 @@ import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.IDebugEventSetListener;
import org.eclipse.debug.core.model.Breakpoint;
import com.ibm.icu.text.MessageFormat;
/**
* The base class for all C/C++ specific breakpoints.
*/
@ -236,11 +237,12 @@ public abstract class CBreakpoint extends Breakpoint
StringBuilder sb = new StringBuilder();
int ignoreCount = getIgnoreCount();
if (ignoreCount > 0) {
sb.append(MessageFormat.format(BreakpointMessages.getString("CBreakpoint.1"), ignoreCount)); //$NON-NLS-1$
sb.append(
MessageFormat.format(BreakpointMessages.getString("CBreakpoint.1"), new Object[] { ignoreCount })); //$NON-NLS-1$
}
String condition = getCondition();
if (condition != null && condition.length() > 0) {
sb.append(MessageFormat.format(BreakpointMessages.getString("CBreakpoint.2"), condition)); //$NON-NLS-1$
sb.append(MessageFormat.format(BreakpointMessages.getString("CBreakpoint.2"), new Object[] { condition })); //$NON-NLS-1$
}
return sb.toString();
}

View file

@ -13,7 +13,6 @@
*******************************************************************************/
package org.eclipse.cdt.debug.internal.core.breakpoints;
import java.text.MessageFormat;
import java.util.Map;
import org.eclipse.cdt.debug.core.CDebugUtils;
@ -21,6 +20,8 @@ import org.eclipse.cdt.debug.core.model.ICFunctionBreakpoint;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import com.ibm.icu.text.MessageFormat;
/**
* A breakpoint that suspends the execution when a function is entered.
*/
@ -53,6 +54,6 @@ public class CFunctionBreakpoint extends AbstractLineBreakpoint implements ICFun
@Override
protected String getMarkerMessage() throws CoreException {
return MessageFormat.format(BreakpointMessages.getString("CFunctionBreakpoint.0"), //$NON-NLS-1$
CDebugUtils.getBreakpointText(this, false));
(Object[]) new String[] { CDebugUtils.getBreakpointText(this, false) });
}
}

Some files were not shown because too many files have changed in this diff Show more