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

Bug 560614 - Drop dependency on ICU4J

Straightforward conversion. Still usages left that need deeper
investigation how to be done proper.
Some long time commented code removed as java formatter breaks trailing
whitespaces on save.


Change-Id: If74259bed5735b0d4cc98fc2cfa609c9c53c80c9
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
This commit is contained in:
Alexander Kurtakov 2020-02-27 21:08:16 +02:00 committed by Jonah Graham
parent c68fa24969
commit 87b627bf02
148 changed files with 290 additions and 514 deletions

View file

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

View file

@ -13,11 +13,10 @@
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.make.internal.core; package org.eclipse.cdt.make.internal.core;
import java.text.MessageFormat;
import java.util.MissingResourceException; import java.util.MissingResourceException;
import java.util.ResourceBundle; import java.util.ResourceBundle;
import com.ibm.icu.text.MessageFormat;
public class MakeMessages { public class MakeMessages {
private static final String RESOURCE_BUNDLE = MakeMessages.class.getName(); private static final String RESOURCE_BUNDLE = MakeMessages.class.getName();
@ -43,19 +42,10 @@ 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 * 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); return MessageFormat.format(getString(key), args);
} }
} }

View file

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

View file

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

View file

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

View file

@ -17,11 +17,10 @@
package org.eclipse.cdt.make.internal.ui.actions; package org.eclipse.cdt.make.internal.ui.actions;
import java.text.MessageFormat;
import java.util.MissingResourceException; import java.util.MissingResourceException;
import java.util.ResourceBundle; import java.util.ResourceBundle;
import com.ibm.icu.text.MessageFormat;
/** /**
* Class that gives access to the folding messages resource bundle. * Class that gives access to the folding messages resource bundle.
*/ */
@ -59,19 +58,6 @@ public class FoldingMessages {
return RESOURCE_BUNDLE; 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. * 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 * <code>MessageFormat</code> is used to format the message. If there isn't any value
@ -81,7 +67,7 @@ public class FoldingMessages {
* @param args the message arguments * @param args the message arguments
* @return the string * @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); return MessageFormat.format(getString(key), args);
} }
} }

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -41,6 +41,5 @@ Require-Bundle: org.eclipse.cdt.core;bundle-version="[5.0.0,7.0.0)",
org.eclipse.core.filesystem;bundle-version="1.2.0" org.eclipse.core.filesystem;bundle-version="1.2.0"
Bundle-ActivationPolicy: lazy Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.8 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 Automatic-Module-Name: org.eclipse.cdt.managedbuilder.core

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -13,11 +13,10 @@
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.newmake.internal.core; package org.eclipse.cdt.newmake.internal.core;
import java.text.MessageFormat;
import java.util.MissingResourceException; import java.util.MissingResourceException;
import java.util.ResourceBundle; import java.util.ResourceBundle;
import com.ibm.icu.text.MessageFormat;
public class MakeMessages { public class MakeMessages {
private static final String RESOURCE_BUNDLE = MakeMessages.class.getName(); private static final String RESOURCE_BUNDLE = MakeMessages.class.getName();
@ -43,19 +42,10 @@ 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 * 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); return MessageFormat.format(getString(key), args);
} }
} }

View file

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

View file

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

View file

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

View file

@ -133,7 +133,6 @@ 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.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.osgi.services;bundle-version="[3.8.0,4.0.0)",
org.eclipse.text;bundle-version="[3.9.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, com.google.gson,
org.eclipse.jdt.annotation;bundle-version="[2.0.0,3.0.0)";resolution:=optional org.eclipse.jdt.annotation;bundle-version="[2.0.0,3.0.0)";resolution:=optional
Bundle-ActivationPolicy: lazy Bundle-ActivationPolicy: lazy

View file

@ -13,11 +13,10 @@
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.internal.core.model; package org.eclipse.cdt.internal.core.model;
import java.text.MessageFormat;
import java.util.MissingResourceException; import java.util.MissingResourceException;
import java.util.ResourceBundle; import java.util.ResourceBundle;
import com.ibm.icu.text.MessageFormat;
/** /**
* @noreference This class is not intended to be referenced by clients. * @noreference This class is not intended to be referenced by clients.
*/ */
@ -54,19 +53,10 @@ public class CoreModelMessages {
return getString(key); 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 * 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); return MessageFormat.format(getString(key), args);
} }
} }

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -24,6 +24,7 @@ import java.io.IOException;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.io.RandomAccessFile; import java.io.RandomAccessFile;
import java.net.URL; import java.net.URL;
import java.text.MessageFormat;
import java.util.HashSet; import java.util.HashSet;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
@ -32,8 +33,6 @@ import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException; 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. * 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; package org.eclipse.cdt.core.templateengine.process;
import java.text.MessageFormat;
import org.eclipse.cdt.core.templateengine.TemplateCore; import org.eclipse.cdt.core.templateengine.TemplateCore;
import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.IStatus;
import com.ibm.icu.text.MessageFormat;
/** /**
* Abstract ProcessRunner class provides the methods to implement for processes. * Abstract ProcessRunner class provides the methods to implement for processes.
*/ */

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -13,6 +13,8 @@
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.internal.corext.template.c; package org.eclipse.cdt.internal.corext.template.c;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -33,9 +35,6 @@ import org.eclipse.jface.text.templates.TemplateVariableResolver;
import org.eclipse.jface.text.templates.TemplateVariableType; import org.eclipse.jface.text.templates.TemplateVariableType;
import org.eclipse.text.templates.ContextTypeRegistry; 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. * 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; package org.eclipse.cdt.internal.corext.util;
import com.ibm.icu.text.MessageFormat; import java.text.MessageFormat;
/** /**
* Helper class to format message strings. * Helper class to format message strings.
@ -22,11 +22,7 @@ import com.ibm.icu.text.MessageFormat;
*/ */
public class Messages { public class Messages {
public static String format(String message, Object object) { public static String format(String message, Object... objects) {
return MessageFormat.format(message, new Object[] { object });
}
public static String format(String message, Object[] objects) {
return MessageFormat.format(message, objects); return MessageFormat.format(message, objects);
} }

View file

@ -13,11 +13,10 @@
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.internal.ui.actions; package org.eclipse.cdt.internal.ui.actions;
import java.text.MessageFormat;
import java.util.MissingResourceException; import java.util.MissingResourceException;
import java.util.ResourceBundle; import java.util.ResourceBundle;
import com.ibm.icu.text.MessageFormat;
/** /**
* Class that gives access to the folding messages resource bundle. * Class that gives access to the folding messages resource bundle.
*/ */
@ -56,19 +55,6 @@ public class FoldingMessages {
return RESOURCE_BUNDLE; 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. * 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 * <code>MessageFormat</code> is used to format the message. If there isn't any value
@ -78,7 +64,7 @@ public class FoldingMessages {
* @param args the message arguments * @param args the message arguments
* @return the string * @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); return MessageFormat.format(getString(key), args);
} }
} }

View file

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

View file

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

View file

@ -13,11 +13,10 @@
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.internal.ui.editor; package org.eclipse.cdt.internal.ui.editor;
import java.text.MessageFormat;
import java.util.MissingResourceException; import java.util.MissingResourceException;
import java.util.ResourceBundle; import java.util.ResourceBundle;
import com.ibm.icu.text.MessageFormat;
public class ConstructedCEditorMessages { public class ConstructedCEditorMessages {
private static final String RESOURCE_BUNDLE = "org.eclipse.cdt.internal.ui.editor.ConstructedCEditorMessages"; //$NON-NLS-1$ private static final String RESOURCE_BUNDLE = "org.eclipse.cdt.internal.ui.editor.ConstructedCEditorMessages"; //$NON-NLS-1$
@ -50,14 +49,7 @@ public class ConstructedCEditorMessages {
/** /**
* Gets a string from the resource bundle and formats it with arguments * 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); 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,6 +13,7 @@
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.internal.ui.editor; package org.eclipse.cdt.internal.ui.editor;
import java.text.Collator;
import java.util.Arrays; import java.util.Arrays;
import org.eclipse.cdt.core.model.ICProject; import org.eclipse.cdt.core.model.ICProject;
@ -37,8 +38,6 @@ import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.texteditor.ITextEditor; import org.eclipse.ui.texteditor.ITextEditor;
import org.eclipse.ui.texteditor.TextEditorAction; 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 * 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 * are selected, the non-comment lines are sorted, and the comments are moved together

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -15,6 +15,8 @@
package org.eclipse.cdt.internal.ui.text.correction.proposals; 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.CorrectionCommandHandler;
import org.eclipse.cdt.internal.ui.text.correction.CorrectionMessages; import org.eclipse.cdt.internal.ui.text.correction.CorrectionMessages;
import org.eclipse.cdt.internal.ui.text.correction.ICommandAccess; import org.eclipse.cdt.internal.ui.text.correction.ICommandAccess;
@ -41,8 +43,6 @@ import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point; import org.eclipse.swt.graphics.Point;
import org.eclipse.ui.IEditorPart; 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 * 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 * 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() { public String getDisplayString() {
String shortCutString = CorrectionCommandHandler.getShortCutString(getCommandId()); String shortCutString = CorrectionCommandHandler.getShortCutString(getCommandId());
if (shortCutString != null) { if (shortCutString != null) {
return MessageFormat.format(CorrectionMessages.ChangeCorrectionProposal_name_with_shortcut, return MessageFormat.format(CorrectionMessages.ChangeCorrectionProposal_name_with_shortcut, getName(),
new Object[] { getName(), shortCutString }); shortCutString);
} }
return getName(); return getName();
} }
@ -190,7 +190,7 @@ public class ChangeCorrectionProposal implements ICCompletionProposal, ICommandA
String shortCutString = CorrectionCommandHandler.getShortCutString(getCommandId()); String shortCutString = CorrectionCommandHandler.getShortCutString(getCommandId());
if (shortCutString != null) { if (shortCutString != null) {
String decorated = MessageFormat.format(CorrectionMessages.ChangeCorrectionProposal_name_with_shortcut, String decorated = MessageFormat.format(CorrectionMessages.ChangeCorrectionProposal_name_with_shortcut,
new Object[] { getName(), shortCutString }); getName(), shortCutString);
return ColoringLabelProvider.decorateStyledString(str, decorated, StyledString.QUALIFIER_STYLER); return ColoringLabelProvider.decorateStyledString(str, decorated, StyledString.QUALIFIER_STYLER);
} }
return str; return str;

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

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