From af9ee1b9c9e8325b73ee9356ea0073cf197bced0 Mon Sep 17 00:00:00 2001 From: Markus Schorn Date: Fri, 23 May 2008 08:47:27 +0000 Subject: [PATCH] Fix broken NLS strings in core-plugin, bug 233308. --- .../internal/core/model/CModelOperation.java | 5 +- .../cdt/internal/core/model/CModelStatus.java | 14 +-- .../core/model/CoreModelMessages.properties | 6 +- .../core/model/CreateFieldOperation.java | 5 +- .../core/model/CreateMethodOperation.java | 5 +- .../core/model/SourceManipulation.java | 5 +- .../core/model/SourceManipulationInfo.java | 7 +- .../model/ExtensionContainerFactory.java | 50 +++++---- .../model/SettingsModelMessages.properties | 3 +- .../internal/core/dom/parser/ASTProblem.java | 6 +- .../core/dom/parser/ProblemBinding.java | 5 - .../core/index/provider/Messages.java | 4 +- .../core/index/provider/messages.properties | 4 +- .../core/parser/ParserMessages.properties | 14 --- .../cdt/internal/core/pdom/Messages.java | 3 - .../internal/core/pdom/messages.properties | 2 - .../org/eclipse/cdt/core/CConventions.java | 71 +++++++------ .../cdt/internal/errorparsers/Messages.java | 7 +- .../internal/errorparsers/messages.properties | 5 +- .../process/processes/messages.properties | 7 +- .../eclipse/cdt/internal/core/Messages.java | 37 ++++++- .../org/eclipse/cdt/internal/core/Util.java | 100 +----------------- .../cdt/internal/core/messages.properties | 71 ++++++------- 23 files changed, 152 insertions(+), 284 deletions(-) diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelOperation.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelOperation.java index 94482e261e7..390541b7a06 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelOperation.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelOperation.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 QNX Software Systems and others. + * Copyright (c) 2000, 2008 QNX Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -8,7 +8,6 @@ * Contributors: * QNX Software Systems - Initial API and implementation *******************************************************************************/ - package org.eclipse.cdt.internal.core.model; import java.io.InputStream; @@ -217,7 +216,7 @@ public abstract class CModelOperation implements IWorkspaceRunnable, IProgressMo */ protected void checkCanceled() { if (isCanceled()) { - throw new OperationCanceledException("operation.canceled"); //$NON-NLS-1$ + throw new OperationCanceledException(CoreModelMessages.getString("operation.canceled")); //$NON-NLS-1$ } } diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelStatus.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelStatus.java index efab2ad5c3f..bd8d639d8e6 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelStatus.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelStatus.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. + * Copyright (c) 2000, 2008 QNX Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -57,7 +57,7 @@ public class CModelStatus extends Status implements ICModelStatus, ICModelStatus /** * Singleton OK object */ - public static final ICModelStatus VERIFIED_OK = new CModelStatus(OK, OK, org.eclipse.cdt.internal.core.Util.bind("status.OK")); //$NON-NLS-1$ + public static final ICModelStatus VERIFIED_OK = new CModelStatus(OK, OK, CoreModelMessages.getString("status.OK")); //$NON-NLS-1$ /** * Constructs an C model status with no corresponding elements. @@ -283,16 +283,6 @@ public class CModelStatus extends Status implements ICModelStatus, ICModelStatus case NO_LOCAL_CONTENTS : return CoreModelMessages.getFormattedString("status.noLocalContents", getPath().toString()); //$NON-NLS-1$ - case INVALID_CONTAINER_ENTRY : - return CoreModelMessages.getFormattedString( - "pathentry.invalidContainer", new String[]{getString(), getFirstElementName()}); //$NON-NLS-1$ - - case VARIABLE_PATH_UNBOUND : - return CoreModelMessages.getFormattedString("pathentry.unboundVariablePath", //$NON-NLS-1$ - new String[]{getPath().makeRelative().toString(), getFirstElementName()}); - - case PATHENTRY_CYCLE : - return CoreModelMessages.getFormattedString("pathentry.cycle", getFirstElementName()); //$NON-NLS-1$ } return getString(); } diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CoreModelMessages.properties b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CoreModelMessages.properties index b1372587431..36d6101e170 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CoreModelMessages.properties +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CoreModelMessages.properties @@ -8,6 +8,7 @@ # Contributors: # QNX Software Systems - Initial API and implementation # Anton Leherbauer (Wind River Systems) +# Markus Schorn (Wind River Systems) ############################################################################### ### CoreModel messages. @@ -21,7 +22,6 @@ operation.needString = Operation requires a String. operation.notSupported = Operation not supported for specified element type(s): operation.canceled = Operation canceled. operation.nullContainer = Container cannot be null. -operation.nullName = Name cannot be null. operation.copyElementProgress = Copying elements... operation.moveElementProgress = Moving elements... operation.renameElementProgress = Renaming elements... @@ -58,7 +58,6 @@ status.noLocalContents = Cannot find local contents for resource: {0} status.OK = OK status.ParserError = Parser error. status.readOnly = {0} is read-only. -status.targetException = Target exception. status.updateConflict = Update conflict. PathEntryManager.0=Missing project folder or file: {0} for {1} @@ -74,6 +73,3 @@ CElementLabels.anonymous=(anonymous) CElementLabels.concat_string=\ -\ CElementLabels.comma_string=,\ CElementLabels.declseparator_string=\ :\ - -CProjectDescriptionManager.startRcChangeHandling=Initiating resource change handling... -CProjectDescriptionManager.serializing=Saving CDT Project settings... diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CreateFieldOperation.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CreateFieldOperation.java index 3eefd304f10..510a5b3f133 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CreateFieldOperation.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CreateFieldOperation.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. + * Copyright (c) 2000, 2008 QNX Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -8,7 +8,6 @@ * Contributors: * QNX Software Systems - Initial API and implementation *******************************************************************************/ - package org.eclipse.cdt.internal.core.model; import org.eclipse.cdt.core.model.CModelException; @@ -49,7 +48,7 @@ public class CreateFieldOperation extends CreateMemberOperation { */ @Override public String getMainTaskName(){ - return "operation.createFieldProgress"; //$NON-NLS-1$ + return CoreModelMessages.getString("operation.createFieldProgress"); //$NON-NLS-1$ } /** diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CreateMethodOperation.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CreateMethodOperation.java index c010c487caa..7bf73d117d7 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CreateMethodOperation.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CreateMethodOperation.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. + * Copyright (c) 2000, 2008 QNX Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -8,7 +8,6 @@ * Contributors: * QNX Software Systems - Initial API and implementation *******************************************************************************/ - package org.eclipse.cdt.internal.core.model; import org.eclipse.cdt.core.model.CModelException; @@ -63,7 +62,7 @@ public class CreateMethodOperation extends CreateMemberOperation { */ @Override public String getMainTaskName(){ - return "operation.createMethodProgress"; //$NON-NLS-1$ + return CoreModelMessages.getString("operation.createMethodProgress"); //$NON-NLS-1$ } /** diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceManipulation.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceManipulation.java index ad23e247ed4..23b93eb4f84 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceManipulation.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceManipulation.java @@ -9,7 +9,6 @@ * QNX Software Systems - Initial API and implementation * Anton Leherbauer (Wind River Systems) *******************************************************************************/ - package org.eclipse.cdt.internal.core.model; import java.util.ArrayList; @@ -53,7 +52,7 @@ public class SourceManipulation extends Parent implements ISourceManipulation, I public void copy(ICElement container, ICElement sibling, String rename, boolean force, IProgressMonitor monitor) throws CModelException { if (container == null) { - throw new IllegalArgumentException("operation.nullContainer"); //$NON-NLS-1$ + throw new IllegalArgumentException(CoreModelMessages.getString("operation.nullContainer")); //$NON-NLS-1$ } ICElement[] elements= new ICElement[] {this}; ICElement[] containers= new ICElement[] {container}; @@ -82,7 +81,7 @@ public class SourceManipulation extends Parent implements ISourceManipulation, I public void move(ICElement container, ICElement sibling, String rename, boolean force, IProgressMonitor monitor) throws CModelException { if (container == null) { - throw new IllegalArgumentException("operation.nullContainer"); //$NON-NLS-1$ + throw new IllegalArgumentException(CoreModelMessages.getString("operation.nullContainer")); //$NON-NLS-1$ } ICElement[] elements= new ICElement[] {this}; ICElement[] containers= new ICElement[] {container}; diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceManipulationInfo.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceManipulationInfo.java index af718deaa01..9b7024337fe 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceManipulationInfo.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceManipulationInfo.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 QNX Software Systems and others. + * Copyright (c) 2000, 2008 QNX Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -8,7 +8,6 @@ * Contributors: * QNX Software Systems - Initial API and implementation *******************************************************************************/ - package org.eclipse.cdt.internal.core.model; import org.eclipse.cdt.core.model.CModelException; @@ -148,7 +147,7 @@ class SourceManipulationInfo extends CElementInfo { public void copy(ICElement container, ICElement sibling, String rename, boolean force, IProgressMonitor monitor) throws CModelException { if (container == null) { - throw new IllegalArgumentException("operation.nullContainer"); //$NON-NLS-1$ + throw new IllegalArgumentException(CoreModelMessages.getString("operation.nullContainer")); //$NON-NLS-1$ } ICElement[] elements= new ICElement[] {getElement()}; ICElement[] containers= new ICElement[] {container}; @@ -177,7 +176,7 @@ class SourceManipulationInfo extends CElementInfo { public void move(ICElement container, ICElement sibling, String rename, boolean force, IProgressMonitor monitor) throws CModelException { if (container == null) { - throw new IllegalArgumentException("operation.nullContainer"); //$NON-NLS-1$ + throw new IllegalArgumentException(CoreModelMessages.getString("operation.nullContainer")); //$NON-NLS-1$ } ICElement[] elements= new ICElement[] {getElement()}; ICElement[] containers= new ICElement[] {container}; diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ExtensionContainerFactory.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ExtensionContainerFactory.java index ba8b22b088e..b389095cc35 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ExtensionContainerFactory.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ExtensionContainerFactory.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007 Intel Corporation and others. + * Copyright (c) 2007, 2008 Intel Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -13,7 +13,6 @@ package org.eclipse.cdt.internal.core.settings.model; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; -import java.util.Iterator; import java.util.Map; import java.util.Set; @@ -35,7 +34,7 @@ public class ExtensionContainerFactory extends CExternalSettingContainerFactoryW private static final String EXTENSION_ID = CCorePlugin.PLUGIN_ID + ".externalSettingsProvider"; //$NON-NLS-1$ private static ExtensionContainerFactory fInstance; - private Map fDescriptorMap; + private Map fDescriptorMap; private static class NullProvider extends CExternalSettingProvider { private static final NullProvider INSTANCE = new NullProvider(); @@ -51,12 +50,12 @@ public class ExtensionContainerFactory extends CExternalSettingContainerFactoryW private CExternalSetting[] fSettings; CESContainer(CExternalSetting[] settings){ - fSettings = (CExternalSetting[])settings.clone(); + fSettings = settings.clone(); } @Override public CExternalSetting[] getExternalSettings() { - return (CExternalSetting[])fSettings.clone(); + return fSettings.clone(); } } @@ -110,9 +109,9 @@ public class ExtensionContainerFactory extends CExternalSettingContainerFactoryW if(obj instanceof CExternalSettingProvider){ return (CExternalSettingProvider)obj; } else - throw ExceptionFactory.createCoreException(SettingsModelMessages.getString(SettingsModelMessages.getString("ExtensionContainerFactory.4"))); //$NON-NLS-1$ + throw ExceptionFactory.createCoreException(SettingsModelMessages.getString("ExtensionContainerFactory.4")); //$NON-NLS-1$ } - throw ExceptionFactory.createCoreException(SettingsModelMessages.getString(SettingsModelMessages.getString("ExtensionContainerFactory.5"))); //$NON-NLS-1$ + throw ExceptionFactory.createCoreException(SettingsModelMessages.getString("ExtensionContainerFactory.5")); //$NON-NLS-1$ } private IConfigurationElement getProviderElement(){ @@ -123,8 +122,7 @@ public class ExtensionContainerFactory extends CExternalSettingContainerFactoryW private static IConfigurationElement getProviderElement(IExtension ext){ IConfigurationElement els[] = ext.getConfigurationElements(); - for(int i = 0; i < els.length; i++){ - IConfigurationElement el = els[i]; + for (IConfigurationElement el : els) { String name = el.getName(); if(PROVIDER.equals(name)) return el; @@ -133,7 +131,7 @@ public class ExtensionContainerFactory extends CExternalSettingContainerFactoryW } } - private Map getProviderDescriptorMap(){ + private Map getProviderDescriptorMap(){ if(fDescriptorMap == null){ initProviderInfoSynch(); } @@ -146,10 +144,10 @@ public class ExtensionContainerFactory extends CExternalSettingContainerFactoryW IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(EXTENSION_ID); IExtension exts[] = extensionPoint.getExtensions(); - fDescriptorMap = new HashMap(); + fDescriptorMap = new HashMap(); - for(int i = 0; i < exts.length; i++){ - CExtensionSettingProviderDescriptor dr = new CExtensionSettingProviderDescriptor(exts[i]); + for (IExtension ext : exts) { + CExtensionSettingProviderDescriptor dr = new CExtensionSettingProviderDescriptor(ext); fDescriptorMap.put(dr.getId(), dr); } } @@ -174,7 +172,7 @@ public class ExtensionContainerFactory extends CExternalSettingContainerFactoryW @Override public CExternalSettingsContainer createContainer(String id, IProject project, ICConfigurationDescription cfgDes) throws CoreException { - CExtensionSettingProviderDescriptor dr = (CExtensionSettingProviderDescriptor)getProviderDescriptorMap().get(id); + CExtensionSettingProviderDescriptor dr = getProviderDescriptorMap().get(id); if(dr != null) return dr.getContainer(project, cfgDes); return CExternalSettingsManager.NullContainer.INSTANCE; @@ -190,21 +188,21 @@ public class ExtensionContainerFactory extends CExternalSettingContainerFactoryW } public static void setReferencedProviderIds(ICConfigurationDescription cfg, String ids[]){ - Set newIdsSet = new HashSet(Arrays.asList(ids)); - Set oldIdsSet = new HashSet(Arrays.asList(getReferencedProviderIds(cfg))); - Set newIdsSetCopy = new HashSet(newIdsSet); + Set newIdsSet = new HashSet(Arrays.asList(ids)); + Set oldIdsSet = new HashSet(Arrays.asList(getReferencedProviderIds(cfg))); + Set newIdsSetCopy = new HashSet(newIdsSet); newIdsSet.removeAll(oldIdsSet); oldIdsSet.removeAll(newIdsSetCopy); if(oldIdsSet.size() != 0){ - for(Iterator iter = oldIdsSet.iterator(); iter.hasNext();){ - removeReference(cfg, (String)iter.next()); + for (String string : oldIdsSet) { + removeReference(cfg, string); } } if(newIdsSet.size() != 0){ - for(Iterator iter = newIdsSet.iterator(); iter.hasNext();){ - createReference(cfg, (String)iter.next()); + for (String string : newIdsSet) { + createReference(cfg, string); } } } @@ -228,15 +226,15 @@ public class ExtensionContainerFactory extends CExternalSettingContainerFactoryW } public static void updateReferencedProviderIds(ICConfigurationDescription cfg, String ids[]){ - Set newIdsSet = new HashSet(Arrays.asList(ids)); - Set oldIdsSet = new HashSet(Arrays.asList(getReferencedProviderIds(cfg))); - Set newIdsSetCopy = new HashSet(newIdsSet); + Set newIdsSet = new HashSet(Arrays.asList(ids)); + Set oldIdsSet = new HashSet(Arrays.asList(getReferencedProviderIds(cfg))); + Set newIdsSetCopy = new HashSet(newIdsSet); newIdsSetCopy.removeAll(oldIdsSet); newIdsSet.removeAll(newIdsSetCopy); if(newIdsSet.size() != 0){ - for(Iterator iter = newIdsSet.iterator(); iter.hasNext();){ - providerChanged(cfg, (String)iter.next()); + for (String string : newIdsSet) { + providerChanged(cfg, string); } } } diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/SettingsModelMessages.properties b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/SettingsModelMessages.properties index fccea1efdf2..b4505ec2e78 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/SettingsModelMessages.properties +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/SettingsModelMessages.properties @@ -1,5 +1,5 @@ ############################################################################### -# Copyright (c) 2007 Intel Corporation and others. +# Copyright (c) 2007, 2008 Intel Corporation and others. # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distribution, and is available at @@ -41,7 +41,6 @@ CFolderDescription.0=data was not created CFolderDescription.1=expected proxy of type ICLanguageSetting, but was CFolderDescription.2=data was not created CFolderDescription.3=expected proxy of type ICLanguageSetting, but was -SetCProjectDescriptionOperation.0=CDT Project settings serialization CExternalSettingsManager.3=writable ref info is requested for the read only config CfgExportSettingContainerFactory.2=invalid id: project name not specified ExtensionContainerFactory.4=invalid setting provider class specified diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ASTProblem.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ASTProblem.java index 75edd5d455a..7b038dd4ae5 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ASTProblem.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ASTProblem.java @@ -67,7 +67,7 @@ public class ASTProblem extends ASTNode implements IASTProblem { char[] file= getOriginatingFileName(); int line= getSourceLineNumber(); Object[] args = new Object[] { msg, new String(file), new Integer(line) }; - return ParserMessages.getFormattedString(PROBLEM_PATTERN, args); + return ParserMessages.getFormattedString("BaseProblemFactory.problemPattern", args); //$NON-NLS-1$ } public static String getMessage(int id, String arg) { @@ -157,9 +157,7 @@ public class ASTProblem extends ASTNode implements IASTProblem { ParserMessages.getString("ParserProblemFactory.error.syntax.syntaxError")); //$NON-NLS-1$ } - protected final static String PROBLEM_PATTERN = "BaseProblemFactory.problemPattern"; //$NON-NLS-1$ - - /* + /* * @see org.eclipse.cdt.core.parser.IProblem#getOriginatingFileName() */ public char[] getOriginatingFileName() { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ProblemBinding.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ProblemBinding.java index ec92e752b24..911398fd5d2 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ProblemBinding.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ProblemBinding.java @@ -10,10 +10,6 @@ * Markus Schorn (Wind River Systems) * Bryan Wilkinson (QNX) *******************************************************************************/ - -/* - * Created on Jan 17, 2005 - */ package org.eclipse.cdt.internal.core.dom.parser; import java.text.MessageFormat; @@ -53,7 +49,6 @@ public class ProblemBinding extends PlatformObject implements IProblemBinding, I return node; } - protected final static String PROBLEM_PATTERN = "BaseProblemFactory.problemPattern"; //$NON-NLS-1$ protected static final String[] errorMessages; static { errorMessages = new String[IProblemBinding.LAST_PROBLEM]; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/provider/Messages.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/provider/Messages.java index f448a387f74..eab66b2282b 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/provider/Messages.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/provider/Messages.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007 Symbian Software Systems and others. + * Copyright (c) 2007, 2008 Symbian Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -16,8 +16,6 @@ public class Messages extends NLS { private static final String BUNDLE_NAME = "org.eclipse.cdt.internal.core.index.provider.messages"; //$NON-NLS-1$ public static String IndexProviderManager_0; public static String IndexProviderManager_NoCompatibleFragmentsAvailable; - public static String OfflinePDOMProviderBridge_UnsupportedUsage; - public static String PDOMCache_VersionTooOld; static { // initialize resource bundle NLS.initializeMessages(BUNDLE_NAME, Messages.class); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/provider/messages.properties b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/provider/messages.properties index 87063621795..a8140b7dc0e 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/provider/messages.properties +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/provider/messages.properties @@ -1,5 +1,5 @@ ############################################################################### -# Copyright (c) 2005, 2007 Symbian Software Limited +# Copyright (c) 2005, 2008 Symbian Software Limited # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distribution, and is available at @@ -9,6 +9,4 @@ # Symbian Software Limited - initial API and implementation ############################################################################### IndexProviderManager_0=Ignoring unrecognized implementation of IIndexProvider contributed by {0} -OfflinePDOMProviderBridge_UnsupportedUsage=Unsupported usage of IOfflinePDOMProvider -PDOMCache_VersionTooOld=External index (PDOM) version is not supported: {0} IndexProviderManager_NoCompatibleFragmentsAvailable=No compatible index fragment found for fragment id: {0} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ParserMessages.properties b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ParserMessages.properties index 8c754004476..590962b796d 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ParserMessages.properties +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ParserMessages.properties @@ -23,8 +23,6 @@ IProblem.symbolName=symbol name IProblem.namespaceName=namespace name IProblem.typeName=type name -QuickParseCallback.exception.constIterator=OffsetableIterator is a const iterator - ScannerProblemFactory.error.preproc.error=#error encountered with text: {0} ScannerProblemFactory.error.preproc.warning=#warning encountered with text: {0} ScannerProblemFactory.error.preproc.inclusionNotFound=Unresolved inclusion: {0} @@ -57,13 +55,8 @@ ScannerProblemFactory.error.scanner.badCharacter=Bad character sequence encounte ParserProblemFactory.error.syntax.syntaxError=Syntax error -ASTProblemFactory.error.semantic.uniqueNamePredefined=Attempt to introduce unique symbol failed : {0} ASTProblemFactory.error.semantic.nameNotFound=Attempt to use symbol failed : {0} -ASTProblemFactory.error.semantic.nameNotProvided=Name not provided. -ASTProblemFactory.error.semantic.invalidConversionType=Invalid arithmetic conversion -ASTProblemFactory.error.semantic.malformedExpression=Malformed expression -LineOffsetReconciler.error.couldNotResetReader=Could not reset Reader BaseProblemFactory.problemPattern={0} in file: {1}:{2, number, integer} @@ -71,14 +64,7 @@ ASTProblemFactory.error.semantic.pst.ambiguousLookup=Ambiguity encountered durin ASTProblemFactory.error.semantic.pst.invalidType=Invalid type encountered in: {0} ASTProblemFactory.error.semantic.pst.circularInheritance=Circular inheritance encountered in: {0} ASTProblemFactory.error.semantic.pst.invalidOverload=Invalid overload of the name: {0} -ASTProblemFactory.error.semantic.pst.invalidTemplate=Invalid template: {0} ASTProblemFactory.error.semantic.pst.invalidUsing=Invalid using directive/declaration: {0} -ASTProblemFactory.error.semantic.pst.badVisibility=Symbol not visible: {0} -ASTProblemFactory.error.semantic.pst.unableToResolveFunction=Unable to resolve function: {0} -ASTProblemFactory.error.semantic.pst.invalidTemplateArgument=Invalid template argument: {0} -ASTProblemFactory.error.semantic.pst.invalidTemplateParameter=Invalid template parameter: {0} -ASTProblemFactory.error.semantic.pst.redeclaredTemplateParameter=Redeclaration of template parameter: {0} -ASTProblemFactory.error.semantic.pst.recursiveTemplateInstantiation=Possible infinite recursive loop encountered while instantiating {0} ASTProblemFactory.error.semantic.dom.definitionNotFound=A definition was not found for {0} ASTProblemFactory.error.semantic.dom.knrParameterDeclarationNotFound=A declaration was not found for the k&r parameter {0} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/Messages.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/Messages.java index c0900c8afd0..d88a5293a50 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/Messages.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/Messages.java @@ -8,7 +8,6 @@ * Contributors: * Markus Schorn - initial API and implementation *******************************************************************************/ - package org.eclipse.cdt.internal.core.pdom; import org.eclipse.osgi.util.NLS; @@ -20,7 +19,6 @@ public class Messages extends NLS { public static String PDOMManager_creationOfIndexInterrupted; public static String PDOMManager_ExistingFileCollides; public static String PDOMManager_indexMonitorDetail; - public static String PDOMManager_JoinIndexerTask; public static String PDOMManager_notifyJob_label; public static String PDOMManager_notifyTask_message; public static String PDOMManager_StartJob_name; @@ -29,7 +27,6 @@ public class Messages extends NLS { public static String TeamPDOMExportOperation_errorCreateArchive; public static String TeamPDOMExportOperation_errorCreatingTempFile; public static String TeamPDOMExportOperation_errorWriteTempFile; - public static String TeamPDOMExportOperation_subtaskCreateDatabase; public static String TeamPDOMExportOperation_taskExportIndex; public static String AbstractIndexerTask_parsingFileTask; public static String AbstractIndexerTask_errorWhileParsing; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/messages.properties b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/messages.properties index 1ca3af025c5..1f4dadeae64 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/messages.properties +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/messages.properties @@ -9,7 +9,6 @@ # Markus Schorn (Wind River Systems) ############################################################################### PDOMManager_notifyJob_label=Notify Index Change Listeners -PDOMManager_JoinIndexerTask=Join Indexer PDOMManager_StartJob_name=Initialize Indexing PDOMManager_ClosePDOMJob=Close database PDOMManager_notifyTask_message=Notify Listeners @@ -21,7 +20,6 @@ PDOMWriter_errorWhileParsing=Error while parsing {0}. Checksums_taskComputeChecksums=Computing checksums TeamPDOMExportOperation_errorCreatingTempFile=Cannot create temp file TeamPDOMExportOperation_taskExportIndex=Export team shared index -TeamPDOMExportOperation_subtaskCreateDatabase=Creating database TeamPDOMExportOperation_errorWriteTempFile=Cannot write to temporary file TeamPDOMExportOperation_errorCreateArchive=Error creating archive AbstractIndexerTask_parsingFileTask=parsing {0} ({1}) diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CConventions.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CConventions.java index f48365106c7..d897a6263f8 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CConventions.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CConventions.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2001, 2007 IBM Corporation and others. + * Copyright (c) 2001, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -15,7 +15,7 @@ import java.util.StringTokenizer; import org.eclipse.cdt.core.model.CoreModel; import org.eclipse.cdt.core.parser.IToken; import org.eclipse.cdt.internal.core.CharOperation; -import org.eclipse.cdt.internal.core.Util; +import org.eclipse.cdt.internal.core.Messages; import org.eclipse.cdt.internal.core.model.CModelStatus; import org.eclipse.cdt.internal.core.parser.scanner.ILexerLog; import org.eclipse.cdt.internal.core.parser.scanner.Lexer; @@ -23,6 +23,7 @@ import org.eclipse.core.resources.IProject; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.Status; +import org.eclipse.osgi.util.NLS; /** * @author hamer @@ -79,11 +80,11 @@ public class CConventions { */ public static IStatus validateClassName(String name) { if (name == null) { - return new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, Util.bind("convention.class.nullName"), null); //$NON-NLS-1$ + return new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, Messages.convention_class_nullName, null); } String trimmed = name.trim(); if ((!name.equals(trimmed)) || (name.indexOf(" ") != -1) ){ //$NON-NLS-1$ - return new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, Util.bind("convention.class.nameWithBlanks"), null); //$NON-NLS-1$ + return new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, Messages.convention_class_nameWithBlanks, null); } int index = name.lastIndexOf(scopeResolutionOperator); char[] scannedID; @@ -112,17 +113,17 @@ public class CConventions { if (scannedID != null) { if (CharOperation.contains('$', scannedID)) { - return new Status(IStatus.WARNING, CCorePlugin.PLUGIN_ID, -1, Util.bind("convention.class.dollarName"), null); //$NON-NLS-1$ + return new Status(IStatus.WARNING, CCorePlugin.PLUGIN_ID, -1, Messages.convention_class_dollarName, null); } if (scannedID.length > 0 && scannedID[0] == '_') { - return new Status(IStatus.WARNING, CCorePlugin.PLUGIN_ID, -1, Util.bind("convention.class.leadingUnderscore"), null); //$NON-NLS-1$ + return new Status(IStatus.WARNING, CCorePlugin.PLUGIN_ID, -1, Messages.convention_class_leadingUnderscore, null); } if (scannedID.length > 0 && Character.isLowerCase(scannedID[0])) { - return new Status(IStatus.WARNING, CCorePlugin.PLUGIN_ID, -1, Util.bind("convention.class.lowercaseName"), null); //$NON-NLS-1$ + return new Status(IStatus.WARNING, CCorePlugin.PLUGIN_ID, -1, Messages.convention_class_lowercaseName, null); } return CModelStatus.VERIFIED_OK; } - return new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, Util.bind("convention.class.invalidName", name), null); //$NON-NLS-1$ + return new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, NLS.bind(Messages.convention_class_invalidName, name), null); } /** @@ -140,11 +141,11 @@ public class CConventions { */ public static IStatus validateNamespaceName(String name) { if (name == null) { - return new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, Util.bind("convention.namespace.nullName"), null); //$NON-NLS-1$ + return new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, Messages.convention_namespace_nullName, null); } String trimmed = name.trim(); if ((!name.equals(trimmed)) || (name.indexOf(" ") != -1) ){ //$NON-NLS-1$ - return new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, Util.bind("convention.namespace.nameWithBlanks"), null); //$NON-NLS-1$ + return new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, Messages.convention_namespace_nameWithBlanks, null); } int index = name.lastIndexOf(scopeResolutionOperator); char[] scannedID; @@ -173,17 +174,17 @@ public class CConventions { if (scannedID != null) { if (CharOperation.contains('$', scannedID)) { - return new Status(IStatus.WARNING, CCorePlugin.PLUGIN_ID, -1, Util.bind("convention.namespace.dollarName"), null); //$NON-NLS-1$ + return new Status(IStatus.WARNING, CCorePlugin.PLUGIN_ID, -1, Messages.convention_namespace_dollarName, null); } if (scannedID.length > 0 && scannedID[0] == '_') { - return new Status(IStatus.WARNING, CCorePlugin.PLUGIN_ID, -1, Util.bind("convention.namespace.leadingUnderscore"), null); //$NON-NLS-1$ + return new Status(IStatus.WARNING, CCorePlugin.PLUGIN_ID, -1, Messages.convention_namespace_leadingUnderscore, null); } // if (scannedID.length > 0 && Character.isLowerCase(scannedID[0])) { -// return new Status(IStatus.WARNING, CCorePlugin.PLUGIN_ID, -1, Util.bind("convention.namespace.lowercaseName"), null); //$NON-NLS-1$ +// return new Status(IStatus.WARNING, CCorePlugin.PLUGIN_ID, -1, Messages.convention.namespace.lowercaseName"), null); //$NON-NLS-1$ // } return CModelStatus.VERIFIED_OK; } - return new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, Util.bind("convention.class.invalidName", name), null); //$NON-NLS-1$ + return new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, NLS.bind(Messages.convention_class_invalidName, name), null); } /** @@ -196,17 +197,17 @@ public class CConventions { public static IStatus validateScopeName(String name) { if (name == null) { - return new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, Util.bind("convention.scope.nullName"), null); //$NON-NLS-1$ + return new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, Messages.convention_scope_nullName, null); } int length; if ((length = name.length()) == 0) { - return new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, Util.bind("convention.scope.emptyName"), null); //$NON-NLS-1$ + return new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, Messages.convention_scope_emptyName, null); } if (name.charAt(0) == fgDot || name.charAt(length-1) == fgDot) { - return new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, Util.bind("convention.scope.dotName"), null); //$NON-NLS-1$ + return new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, Messages.convention_scope_dotName, null); } if (CharOperation.isWhitespace(name.charAt(0)) || CharOperation.isWhitespace(name.charAt(name.length() - 1))) { - return new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, Util.bind("convention.scope.nameWithBlanks"), null); //$NON-NLS-1$ + return new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, Messages.convention_scope_nameWithBlanks, null); } StringTokenizer st = new StringTokenizer(name, scopeResolutionOperator); @@ -216,13 +217,13 @@ public class CConventions { typeName = typeName.trim(); // grammar allows spaces char[] scannedID = typeName.toCharArray(); if (scannedID == null) { - return new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, Util.bind("convention.illegalIdentifier", typeName), null); //$NON-NLS-1$ + return new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, NLS.bind(Messages.convention_illegalIdentifier, typeName), null); } if (firstToken && scannedID.length > 0 && scannedID[0] == '_') { - return new Status(IStatus.WARNING, CCorePlugin.PLUGIN_ID, -1, Util.bind("convention.scope.leadingUnderscore"), null); //$NON-NLS-1$ + return new Status(IStatus.WARNING, CCorePlugin.PLUGIN_ID, -1, Messages.convention_scope_leadingUnderscore, null); } if (firstToken && scannedID.length > 0 && Character.isLowerCase(scannedID[0])) { - return new Status(IStatus.WARNING, CCorePlugin.PLUGIN_ID, -1, Util.bind("convention.scope.lowercaseName"), null); //$NON-NLS-1$ + return new Status(IStatus.WARNING, CCorePlugin.PLUGIN_ID, -1, Messages.convention_scope_lowercaseName, null); } firstToken = false; } @@ -257,11 +258,11 @@ public class CConventions { */ public static IStatus validateIdentifier(String id) { if (!isLegalIdentifier(id)) { - return new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, Util.bind("convention.illegalIdentifier", id), null); //$NON-NLS-1$ + return new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, NLS.bind(Messages.convention_illegalIdentifier, id), null); } if (!isValidIdentifier(id)) { - return new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, Util.bind("convention.invalid", id), null); //$NON-NLS-1$ + return new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, NLS.bind(Messages.convention_invalid, id), null); } return CModelStatus.VERIFIED_OK; @@ -365,17 +366,17 @@ public class CConventions { public static IStatus validateFileName(String name) { //TODO could use a prefs option for file naming conventions if (name == null || name.length() == 0) { - return new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, Util.bind("convention.filename.nullName"), null); //$NON-NLS-1$ + return new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, Messages.convention_filename_nullName, null); } if (!isLegalFilename(name)) { //TODO we need platform-independent validation, see bug#24152 - //return new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, Util.bind("convention.filename.invalid"), null); //$NON-NLS-1$ - return new Status(IStatus.WARNING, CCorePlugin.PLUGIN_ID, -1, Util.bind("convention.filename.possiblyInvalid"), null); //$NON-NLS-1$ + //return new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, Messages.convention.filename.invalid"), null); //$NON-NLS-1$ + return new Status(IStatus.WARNING, CCorePlugin.PLUGIN_ID, -1, Messages.convention_filename_possiblyInvalid, null); } String trimmed = name.trim(); if ((!name.equals(trimmed)) || (name.indexOf(" ") != -1)) { //$NON-NLS-1$ - return new Status(IStatus.WARNING, CCorePlugin.PLUGIN_ID, -1, Util.bind("convention.filename.nameWithBlanks"), null); //$NON-NLS-1$ + return new Status(IStatus.WARNING, CCorePlugin.PLUGIN_ID, -1, Messages.convention_filename_nameWithBlanks, null); } return CModelStatus.VERIFIED_OK; @@ -402,7 +403,7 @@ public class CConventions { } if (!CoreModel.isValidHeaderUnitName(project, name)) { - return new Status(IStatus.WARNING, CCorePlugin.PLUGIN_ID, -1, Util.bind("convention.headerFilename.filetype"), null); //$NON-NLS-1$ + return new Status(IStatus.WARNING, CCorePlugin.PLUGIN_ID, -1, Messages.convention_headerFilename_filetype, null); } return val; @@ -429,7 +430,7 @@ public class CConventions { } if (!CoreModel.isValidSourceUnitName(project, name)) { - return new Status(IStatus.WARNING, CCorePlugin.PLUGIN_ID, -1, Util.bind("convention.sourceFilename.filetype"), null); //$NON-NLS-1$ + return new Status(IStatus.WARNING, CCorePlugin.PLUGIN_ID, -1, Messages.convention_sourceFilename_filetype, null); } return val; @@ -451,11 +452,11 @@ public class CConventions { */ public static IStatus validateEnumName(String name) { if (name == null) { - return new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, Util.bind("convention.enum.nullName"), null); //$NON-NLS-1$ + return new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, Messages.convention_enum_nullName, null); } String trimmed = name.trim(); if ((!name.equals(trimmed)) || (name.indexOf(" ") != -1) ){ //$NON-NLS-1$ - return new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, Util.bind("convention.enum.nameWithBlanks"), null); //$NON-NLS-1$ + return new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, Messages.convention_enum_nameWithBlanks, null); } int index = name.lastIndexOf(scopeResolutionOperator); char[] scannedID; @@ -484,16 +485,16 @@ public class CConventions { if (scannedID != null) { if (CharOperation.contains('$', scannedID)) { - return new Status(IStatus.WARNING, CCorePlugin.PLUGIN_ID, -1, Util.bind("convention.enum.dollarName"), null); //$NON-NLS-1$ + return new Status(IStatus.WARNING, CCorePlugin.PLUGIN_ID, -1, Messages.convention_enum_dollarName, null); } if (scannedID.length > 0 && scannedID[0] == '_') { - return new Status(IStatus.WARNING, CCorePlugin.PLUGIN_ID, -1, Util.bind("convention.enum.leadingUnderscore"), null); //$NON-NLS-1$ + return new Status(IStatus.WARNING, CCorePlugin.PLUGIN_ID, -1, Messages.convention_enum_leadingUnderscore, null); } if (scannedID.length > 0 && Character.isLowerCase(scannedID[0])) { - return new Status(IStatus.WARNING, CCorePlugin.PLUGIN_ID, -1, Util.bind("convention.enum.lowercaseName"), null); //$NON-NLS-1$ + return new Status(IStatus.WARNING, CCorePlugin.PLUGIN_ID, -1, Messages.convention_enum_lowercaseName, null); } return CModelStatus.VERIFIED_OK; } - return new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, Util.bind("convention.enum.invalidName"), null); //$NON-NLS-1$ + return new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, Messages.convention_enum_invalidName, null); } } diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/errorparsers/Messages.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/errorparsers/Messages.java index b90071d5644..4e5e049c782 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/errorparsers/Messages.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/errorparsers/Messages.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006 Siemens AG. + * Copyright (c) 2006, 2008 Siemens AG. * All rights reserved. This content and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -8,8 +8,6 @@ * Contributors: * Norbert Ploett - Initial implementation *******************************************************************************/ - - package org.eclipse.cdt.internal.errorparsers; import org.eclipse.osgi.util.NLS; @@ -28,9 +26,6 @@ public class Messages extends NLS { public static String GLDErrorParser_error_general; public static String GLDErrorParser_error_text; public static String GLDErrorParser_warning_general; - public static String MakeErrorParser_error_entering; - public static String MakeErrorParser_error_general; - public static String MakeErrorParser_error_leaving; static { // initialize resource bundle NLS.initializeMessages(BUNDLE_NAME, Messages.class); diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/errorparsers/messages.properties b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/errorparsers/messages.properties index ab0a3613a0f..5b689d5ac87 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/errorparsers/messages.properties +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/errorparsers/messages.properties @@ -1,5 +1,5 @@ ############################################################################### -# Copyright (c) 2006, 2007 Siemens AG. +# Copyright (c) 2006, 2008 Siemens AG. # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distribution, and is available at @@ -20,6 +20,3 @@ GCCErrorParser_Warnings=(.*?):([0-9]+):([0-9]+:)?(.*[([Ww]arning)([Ee]rror)]:)? GLDErrorParser_error_text=(.*)\\(\\.text\\+.*\\): (.*) GLDErrorParser_warning_general=ld(\\.exe)?: [Ww]arning:? (.*) GLDErrorParser_error_general=ld(\\.exe)?: (.*) -MakeErrorParser_error_entering=make\\[(.*)\\]: Entering directory `(.*)' -MakeErrorParser_error_leaving=make\\[.*\\]: Leaving directory -MakeErrorParser_error_general=(make: \\*\\*\\* \\[.*\\] Error .*) diff --git a/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/process/processes/messages.properties b/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/process/processes/messages.properties index ff751b4f6be..7bb543cff5c 100644 --- a/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/process/processes/messages.properties +++ b/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/process/processes/messages.properties @@ -1,5 +1,5 @@ ############################################################################### -# Copyright (c) 2007 Symbian Software Limited and others. +# Copyright (c) 2007, 2008 Symbian Software Limited and others. # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distribution, and is available at @@ -30,7 +30,7 @@ SetMBSStringListOptionValues.0=SetMBSStringListOptionValues failure: SetMBSStringListOptionValues.3=SetMBSStringListOptionValues failure: No such file exists: NewManagedProject.3=New Project failure: NewManagedProject.4=New Project failure: No Configurations specified for -NewManagedProject.5=New Project failure: project already existing in work space: +#NewManagedProject.5=New Project failure: project already existing in work space: AppendCreate.1=Add File failure: template source not found: AppendCreate.2=Append failure: template source not found: AppendCreate.3=Append failure: cannot read template source: @@ -49,9 +49,6 @@ Copy.1=Copy failure: template source not found: Copy.3=Copy failure: cannot read template source: Copy.4=Copy failure: failed while copying contents. Copy.5=Copy failure: failed while copying contents. -NewProject.7=New Project failure: -NewProject.8=New Project failure: -NewProject.9=New Project failure: project already existing in work space: Append.0=Add File failure: template source not found: Append.1=Copy failure: template source not found: Append.3=Copy failure: cannot read template source: diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/internal/core/Messages.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/internal/core/Messages.java index 471b78580c9..65803d1b7d5 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/internal/core/Messages.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/internal/core/Messages.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006 Wind River Systems, Inc. and others. + * Copyright (c) 2006, 2008 Wind River Systems, Inc. and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -8,7 +8,6 @@ * Contributors: * Markus Schorn - initial API and implementation *******************************************************************************/ - package org.eclipse.cdt.internal.core; import org.eclipse.osgi.util.NLS; @@ -17,6 +16,40 @@ public class Messages extends NLS { private static final String BUNDLE_NAME = "org.eclipse.cdt.internal.core.messages"; //$NON-NLS-1$ public static String Util_unexpectedError; public static String Addr_valueOutOfRange; + public static String convention_illegalIdentifier; + public static String convention_invalid; + public static String convention_scope_leadingUnderscore; + public static String convention_scope_lowercaseName; + public static String convention_scope_nullName; + public static String convention_scope_emptyName; + public static String convention_scope_dotName; + public static String convention_scope_nameWithBlanks; + + public static String convention_class_nullName; + public static String convention_class_nameWithBlanks; + public static String convention_class_dollarName; + public static String convention_class_leadingUnderscore; + public static String convention_class_lowercaseName; + public static String convention_class_invalidName; + + public static String convention_namespace_nullName; + public static String convention_namespace_nameWithBlanks; + public static String convention_namespace_dollarName; + public static String convention_namespace_leadingUnderscore; + + public static String convention_filename_nullName; + public static String convention_filename_possiblyInvalid; + public static String convention_filename_nameWithBlanks; + public static String convention_headerFilename_filetype; + public static String convention_sourceFilename_filetype; + + public static String convention_enum_nullName; + public static String convention_enum_nameWithBlanks; + public static String convention_enum_dollarName; + public static String convention_enum_leadingUnderscore; + public static String convention_enum_lowercaseName; + public static String convention_enum_invalidName; + static { // initialize resource bundle NLS.initializeMessages(BUNDLE_NAME, Messages.class); diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/internal/core/Util.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/internal/core/Util.java index c19f6f0a482..b608e4061f4 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/internal/core/Util.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/internal/core/Util.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -17,9 +17,6 @@ import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.HashSet; -import java.util.Locale; -import java.util.MissingResourceException; -import java.util.ResourceBundle; import org.eclipse.cdt.core.CCorePlugin; import org.eclipse.core.resources.IContainer; @@ -30,97 +27,8 @@ import org.eclipse.core.runtime.Status; public class Util { - private final static char[] DOUBLE_QUOTES = "''".toCharArray(); //$NON-NLS-1$ - private final static char[] SINGLE_QUOTE = "'".toCharArray(); //$NON-NLS-1$ private static final int DEFAULT_READING_SIZE = 8192; - /* Bundle containing messages */ - protected static ResourceBundle bundle; - private final static String bundleName = "org.eclipse.cdt.internal.core.messages"; //$NON-NLS-1$ - static { - relocalize(); - } - /** - * Lookup the message with the given ID in this catalog and bind its - * substitution locations with the given strings. - */ - public static String bind(String id, String binding1, String binding2) { - return bind(id, new String[] {binding1, binding2}); - } - /** - * Lookup the message with the given ID in this catalog and bind its - * substitution locations with the given string. - */ - public static String bind(String id, String binding) { - return bind(id, new String[] {binding}); - } - /** - * Lookup the message with the given ID in this catalog and bind its - * substitution locations with the given string values. - */ - public static String bind(String id, String[] bindings) { - if (id == null) - return "No message available"; //$NON-NLS-1$ - String message = null; - try { - message = bundle.getString(id); - } catch (MissingResourceException e) { - // If we got an exception looking for the message, fail gracefully by just returning - // the id we were looking for. In most cases this is semi-informative so is not too bad. - return "Missing message: " + id + " in: " + bundleName; //$NON-NLS-2$ //$NON-NLS-1$ - } - // for compatibility with MessageFormat which eliminates double quotes in original message - char[] messageWithNoDoubleQuotes = - CharOperation.replace(message.toCharArray(), DOUBLE_QUOTES, SINGLE_QUOTE); - message = new String(messageWithNoDoubleQuotes); - - if (bindings == null) - return message; - int length = message.length(); - int start = -1; - int end = length; - StringBuffer output = new StringBuffer(80); - while (true) { - if ((end = message.indexOf('{', start)) > -1) { - output.append(message.substring(start + 1, end)); - if ((start = message.indexOf('}', end)) > -1) { - int index = -1; - try { - index = Integer.parseInt(message.substring(end + 1, start)); - output.append(bindings[index]); - } catch (NumberFormatException nfe) { - output.append(message.substring(end + 1, start + 1)); - } catch (ArrayIndexOutOfBoundsException e) { - output.append("{missing " + Integer.toString(index) + "}"); //$NON-NLS-2$ //$NON-NLS-1$ - } - } else { - output.append(message.substring(end, length)); - break; - } - } else { - output.append(message.substring(start + 1, length)); - break; - } - } - return output.toString(); - } - /** - * Lookup the message with the given ID in this catalog - */ - public static String bind(String id) { - return bind(id, (String[])null); - } - /** - * Creates a NLS catalog for the given locale. - */ - public static void relocalize() { - try { - bundle = ResourceBundle.getBundle(bundleName, Locale.getDefault()); - } catch(MissingResourceException e) { - System.out.println("Missing resource : " + bundleName.replace('.', '/') + ".properties for locale " + Locale.getDefault()); //$NON-NLS-1$//$NON-NLS-2$ - throw e; - } - } /** * Returns the contents of the given file as a byte array. @@ -339,7 +247,7 @@ public class Util { * are known to be existing. * Note this cache is kept for the whole session. */ - public static HashSet existingExternalFiles = new HashSet(); + public static HashSet existingExternalFiles = new HashSet(); /* * Returns whether the given resource matches one of the exclusion patterns. @@ -363,8 +271,8 @@ public class Util { public final static boolean isExcluded(IPath resourcePath, char[][] exclusionPatterns) { if (exclusionPatterns == null) return false; char[] path = resourcePath.toString().toCharArray(); - for (int i = 0, length = exclusionPatterns.length; i < length; i++) - if (CharOperation.pathMatch(exclusionPatterns[i], path, true, '/')) + for (char[] exclusionPattern : exclusionPatterns) + if (CharOperation.pathMatch(exclusionPattern, path, true, '/')) return true; return false; } diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/internal/core/messages.properties b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/internal/core/messages.properties index a2ae101587b..71c680770f1 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/internal/core/messages.properties +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/internal/core/messages.properties @@ -1,5 +1,5 @@ ############################################################################### -# Copyright (c) 2000, 2006 IBM Corporation and others. +# Copyright (c) 2000, 2008 IBM Corporation and others. # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distribution, and is available at @@ -10,51 +10,40 @@ ############################################################################### ### Eclipse CDT Core Search messages. -engine.searching = Searching... -exception.wrongFormat = Wrong format -process.name = C/C++ Indexer -manager.filesToIndex = {0} files to index -indexerJob = C/C++ Indexer -indexerMarker.prefix= C/C++ Indexer Problem: -indexerMarker.processing= Processing C/C++ Index Markers -indexNotificationJob=Updating C/C++ Indexer clients -convention.illegalIdentifier= Illegal identifier -convention.invalid= Invalid identifier -convention.scope.leadingUnderscore= Scope starts with underscore -convention.scope.lowercaseName= Scope starts with lower case -convention.scope.nullName= Scope name is null -convention.scope.emptyName= Scope name is empty -convention.scope.dotName= Scope name starts or ends with a . -convention.scope.nameWithBlanks= Scope name has blanks +convention_illegalIdentifier= Illegal identifier +convention_invalid= Invalid identifier +convention_scope_leadingUnderscore= Scope starts with underscore +convention_scope_lowercaseName= Scope starts with lower case +convention_scope_nullName= Scope name is null +convention_scope_emptyName= Scope name is empty +convention_scope_dotName= Scope name starts or ends with a . +convention_scope_nameWithBlanks= Scope name has blanks -convention.class.nullName= Class name is null -convention.class.nameWithBlanks= Class name has blanks -convention.class.dollarName= Class name has $ -convention.class.leadingUnderscore= Class name starts with underscore -convention.class.lowercaseName= Class name starts with lower case -convention.class.invalidName= Class name is invalid +convention_class_nullName= Class name is null +convention_class_nameWithBlanks= Class name has blanks +convention_class_dollarName= Class name has $ +convention_class_leadingUnderscore= Class name starts with underscore +convention_class_lowercaseName= Class name starts with lower case +convention_class_invalidName= Class name is invalid -convention.namespace.nullName= Namespace is null -convention.namespace.nameWithBlanks= Namespace has blanks -convention.namespace.dollarName= Namespace has $ -convention.namespace.leadingUnderscore= Namespace starts with underscore -convention.namespace.lowercaseName= Namespace starts with lower case -convention.namespace.invalidName= Namespace is invalid +convention_namespace_nullName= Namespace is null +convention_namespace_nameWithBlanks= Namespace has blanks +convention_namespace_dollarName= Namespace has $ +convention_namespace_leadingUnderscore= Namespace starts with underscore -convention.filename.nullName=File name is blank -convention.filename.invalid=File name contains illegal characters -convention.filename.possiblyInvalid=File name contains non-standard or illegal characters -convention.filename.nameWithBlanks=File name contains spaces -convention.headerFilename.filetype=File extension does not correspond to known header file types -convention.sourceFilename.filetype=File extension does not correspond to known source file types +convention_filename_nullName=File name is blank +convention_filename_possiblyInvalid=File name contains non-standard or illegal characters +convention_filename_nameWithBlanks=File name contains spaces +convention_headerFilename_filetype=File extension does not correspond to known header file types +convention_sourceFilename_filetype=File extension does not correspond to known source file types -convention.enum.nullName= Enum name is null -convention.enum.nameWithBlanks= Enum name has blanks -convention.enum.dollarName= Enum name has $ -convention.enum.leadingUnderscore= Enum name starts with underscore -convention.enum.lowercaseName= Enum name starts with lower case -convention.enum.invalidName= Enum name is invalid +convention_enum_nullName= Enum name is null +convention_enum_nameWithBlanks= Enum name has blanks +convention_enum_dollarName= Enum name has $ +convention_enum_leadingUnderscore= Enum name starts with underscore +convention_enum_lowercaseName= Enum name starts with lower case +convention_enum_invalidName= Enum name is invalid Util_unexpectedError=Unexpected error Addr_valueOutOfRange=Address is outside valid range. \ No newline at end of file