diff options
Diffstat (limited to 'plugins/org.eclipse.emf.cdo/src/org/eclipse')
81 files changed, 503 insertions, 318 deletions
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/CDOResource.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/CDOResource.java index f0858432ae..9cec7bcfd0 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/CDOResource.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/CDOResource.java @@ -48,7 +48,7 @@ public interface CDOResource extends CDOResourceNode, Resource * @generated * @since 2.0 */ - String copyright = "Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) and others.\r\nAll rights reserved. This program and the accompanying materials\r\nare made available under the terms of the Eclipse Public License v1.0\r\nwhich accompanies this distribution, and is available at\r\nhttp://www.eclipse.org/legal/epl-v10.html\r\n\r\nContributors:\r\n Eike Stepper - initial API and implementation"; + String copyright = "Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) and others.\r\nAll rights reserved. This program and the accompanying materials\r\nare made available under the terms of the Eclipse Public License v1.0\r\nwhich accompanies this distribution, and is available at\r\nhttp://www.eclipse.org/legal/epl-v10.html\r\n\r\nContributors:\r\n Eike Stepper - initial API and implementation"; //$NON-NLS-1$ /** * @ADDED diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/CDOResourceFolder.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/CDOResourceFolder.java index 2fabd49262..c04d42dfa1 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/CDOResourceFolder.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/CDOResourceFolder.java @@ -34,7 +34,7 @@ public interface CDOResourceFolder extends CDOResourceNode * * @generated */ - String copyright = "Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) and others.\r\nAll rights reserved. This program and the accompanying materials\r\nare made available under the terms of the Eclipse Public License v1.0\r\nwhich accompanies this distribution, and is available at\r\nhttp://www.eclipse.org/legal/epl-v10.html\r\n\r\nContributors:\r\n Eike Stepper - initial API and implementation"; + String copyright = "Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) and others.\r\nAll rights reserved. This program and the accompanying materials\r\nare made available under the terms of the Eclipse Public License v1.0\r\nwhich accompanies this distribution, and is available at\r\nhttp://www.eclipse.org/legal/epl-v10.html\r\n\r\nContributors:\r\n Eike Stepper - initial API and implementation"; //$NON-NLS-1$ /** * Returns the value of the '<em><b>Nodes</b></em>' containment reference list. The list contents are of type diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/CDOResourceNode.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/CDOResourceNode.java index 0840226f5f..f2e23059dd 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/CDOResourceNode.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/CDOResourceNode.java @@ -43,13 +43,13 @@ public interface CDOResourceNode extends CDOObject * * @generated */ - String copyright = "Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) and others.\r\nAll rights reserved. This program and the accompanying materials\r\nare made available under the terms of the Eclipse Public License v1.0\r\nwhich accompanies this distribution, and is available at\r\nhttp://www.eclipse.org/legal/epl-v10.html\r\n\r\nContributors:\r\n Eike Stepper - initial API and implementation"; + String copyright = "Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) and others.\r\nAll rights reserved. This program and the accompanying materials\r\nare made available under the terms of the Eclipse Public License v1.0\r\nwhich accompanies this distribution, and is available at\r\nhttp://www.eclipse.org/legal/epl-v10.html\r\n\r\nContributors:\r\n Eike Stepper - initial API and implementation"; //$NON-NLS-1$ /** * @ADDED * @since 2.0 */ - public static final String ROOT_PATH = "/"; + public static final String ROOT_PATH = "/"; //$NON-NLS-1$ /** * @ADDED diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/EresourceFactory.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/EresourceFactory.java index ede82dfce5..582dba9cee 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/EresourceFactory.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/EresourceFactory.java @@ -27,7 +27,7 @@ public interface EresourceFactory extends EFactory * @generated * @since 2.0 */ - String copyright = "Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) and others.\r\nAll rights reserved. This program and the accompanying materials\r\nare made available under the terms of the Eclipse Public License v1.0\r\nwhich accompanies this distribution, and is available at\r\nhttp://www.eclipse.org/legal/epl-v10.html\r\n\r\nContributors:\r\n Eike Stepper - initial API and implementation"; + String copyright = "Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) and others.\r\nAll rights reserved. This program and the accompanying materials\r\nare made available under the terms of the Eclipse Public License v1.0\r\nwhich accompanies this distribution, and is available at\r\nhttp://www.eclipse.org/legal/epl-v10.html\r\n\r\nContributors:\r\n Eike Stepper - initial API and implementation"; //$NON-NLS-1$ /** * The singleton instance of the factory. <!-- begin-user-doc --> <!-- end-user-doc --> diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/EresourcePackage.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/EresourcePackage.java index f95041036d..9e36711c22 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/EresourcePackage.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/EresourcePackage.java @@ -38,28 +38,28 @@ public interface EresourcePackage extends EPackage * @generated * @since 2.0 */ - String copyright = "Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) and others.\r\nAll rights reserved. This program and the accompanying materials\r\nare made available under the terms of the Eclipse Public License v1.0\r\nwhich accompanies this distribution, and is available at\r\nhttp://www.eclipse.org/legal/epl-v10.html\r\n\r\nContributors:\r\n Eike Stepper - initial API and implementation"; + String copyright = "Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) and others.\r\nAll rights reserved. This program and the accompanying materials\r\nare made available under the terms of the Eclipse Public License v1.0\r\nwhich accompanies this distribution, and is available at\r\nhttp://www.eclipse.org/legal/epl-v10.html\r\n\r\nContributors:\r\n Eike Stepper - initial API and implementation"; //$NON-NLS-1$ /** * The package name. <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ - String eNAME = "eresource"; + String eNAME = "eresource"; //$NON-NLS-1$ /** * The package namespace URI. <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ - String eNS_URI = "http://www.eclipse.org/emf/CDO/Eresource/2.0.0"; + String eNS_URI = "http://www.eclipse.org/emf/CDO/Eresource/2.0.0"; //$NON-NLS-1$ /** * The package namespace name. <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ - String eNS_PREFIX = "eresource"; + String eNS_PREFIX = "eresource"; //$NON-NLS-1$ /** * The singleton instance of the package. <!-- begin-user-doc --> <!-- end-user-doc --> diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceFactoryImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceFactoryImpl.java index e88abf6c23..05649c1336 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceFactoryImpl.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceFactoryImpl.java @@ -62,7 +62,7 @@ public class CDOResourceFactoryImpl implements Resource.Factory, CDOResourceFact } } - if (inResourceSet && "getResource".equals(element.getMethodName())) + if (inResourceSet && "getResource".equals(element.getMethodName())) //$NON-NLS-1$ { return true; } diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceFolderImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceFolderImpl.java index e0789a5d65..4d4a8d4e12 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceFolderImpl.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceFolderImpl.java @@ -42,7 +42,7 @@ public class CDOResourceFolderImpl extends CDOResourceNodeImpl implements CDORes * * @generated */ - public static final String copyright = "Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) and others.\r\nAll rights reserved. This program and the accompanying materials\r\nare made available under the terms of the Eclipse Public License v1.0\r\nwhich accompanies this distribution, and is available at\r\nhttp://www.eclipse.org/legal/epl-v10.html\r\n\r\nContributors:\r\n Eike Stepper - initial API and implementation"; + public static final String copyright = "Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) and others.\r\nAll rights reserved. This program and the accompanying materials\r\nare made available under the terms of the Eclipse Public License v1.0\r\nwhich accompanies this distribution, and is available at\r\nhttp://www.eclipse.org/legal/epl-v10.html\r\n\r\nContributors:\r\n Eike Stepper - initial API and implementation"; //$NON-NLS-1$ /** * <!-- begin-user-doc --> <!-- end-user-doc --> diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceImpl.java index 6ae20574fb..89d547873d 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceImpl.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceImpl.java @@ -89,7 +89,7 @@ public class CDOResourceImpl extends CDOResourceNodeImpl implements CDOResource, * @generated * @since 2.0 */ - public static final String copyright = "Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) and others.\r\nAll rights reserved. This program and the accompanying materials\r\nare made available under the terms of the Eclipse Public License v1.0\r\nwhich accompanies this distribution, and is available at\r\nhttp://www.eclipse.org/legal/epl-v10.html\r\n\r\nContributors:\r\n Eike Stepper - initial API and implementation"; + public static final String copyright = "Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) and others.\r\nAll rights reserved. This program and the accompanying materials\r\nare made available under the terms of the Eclipse Public License v1.0\r\nwhich accompanies this distribution, and is available at\r\nhttp://www.eclipse.org/legal/epl-v10.html\r\n\r\nContributors:\r\n Eike Stepper - initial API and implementation"; //$NON-NLS-1$ private static final EReference CDO_RESOURCE_CONTENTS = EresourcePackage.eINSTANCE.getCDOResource_Contents(); diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceNodeImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceNodeImpl.java index 4e94381cf7..cc598716e9 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceNodeImpl.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceNodeImpl.java @@ -14,6 +14,7 @@ import org.eclipse.emf.cdo.common.util.CDOException; import org.eclipse.emf.cdo.eresource.CDOResourceFolder; import org.eclipse.emf.cdo.eresource.CDOResourceNode; import org.eclipse.emf.cdo.eresource.EresourcePackage; +import org.eclipse.emf.cdo.messages.Messages; import org.eclipse.emf.cdo.util.CDOURIUtil; import org.eclipse.emf.internal.cdo.CDOObjectImpl; @@ -24,6 +25,7 @@ import org.eclipse.emf.common.util.URI; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.spi.cdo.InternalCDOTransaction; +import java.text.MessageFormat; import java.util.List; /** @@ -48,7 +50,7 @@ public abstract class CDOResourceNodeImpl extends CDOObjectImpl implements CDORe * * @generated */ - public static final String copyright = "Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) and others.\r\nAll rights reserved. This program and the accompanying materials\r\nare made available under the terms of the Eclipse Public License v1.0\r\nwhich accompanies this distribution, and is available at\r\nhttp://www.eclipse.org/legal/epl-v10.html\r\n\r\nContributors:\r\n Eike Stepper - initial API and implementation"; + public static final String copyright = "Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) and others.\r\nAll rights reserved. This program and the accompanying materials\r\nare made available under the terms of the Eclipse Public License v1.0\r\nwhich accompanies this distribution, and is available at\r\nhttp://www.eclipse.org/legal/epl-v10.html\r\n\r\nContributors:\r\n Eike Stepper - initial API and implementation"; //$NON-NLS-1$ /** * <!-- begin-user-doc --> <!-- end-user-doc --> @@ -127,7 +129,7 @@ public abstract class CDOResourceNodeImpl extends CDOObjectImpl implements CDORe String name = getName(); if (name != null) { - String newPath = (newFolder == null ? "" : newFolder.getPath()) + CDOURIUtil.SEGMENT_SEPARATOR + name; + String newPath = (newFolder == null ? "" : newFolder.getPath()) + CDOURIUtil.SEGMENT_SEPARATOR + name; //$NON-NLS-1$ checkDuplicates(newPath); } } @@ -181,7 +183,7 @@ public abstract class CDOResourceNodeImpl extends CDOObjectImpl implements CDORe CDOResourceFolder parent = getFolder(); if (parent != null) { - String newPath = (parent == null ? "" : parent.getPath()) + CDOURIUtil.SEGMENT_SEPARATOR + getName(); + String newPath = (parent == null ? "" : parent.getPath()) + CDOURIUtil.SEGMENT_SEPARATOR + getName(); //$NON-NLS-1$ checkDuplicates(newPath); } } @@ -221,7 +223,7 @@ public abstract class CDOResourceNodeImpl extends CDOObjectImpl implements CDORe InternalCDOTransaction transaction = cdoView().toTransaction(); if (newPath == null) { - throw new CDOException("Null path is not allowed"); + throw new CDOException(Messages.getString("CDOResourceNodeImpl.3")); //$NON-NLS-1$ } String oldPath = getPath(); @@ -231,7 +233,7 @@ public abstract class CDOResourceNodeImpl extends CDOObjectImpl implements CDORe List<String> names = CDOURIUtil.analyzePath(newPath); if (names.isEmpty()) { - throw new CDOException("Root path is not allowed"); + throw new CDOException(Messages.getString("CDOResourceNodeImpl.4")); //$NON-NLS-1$ } String newName = names.remove(names.size() - 1); @@ -293,7 +295,7 @@ public abstract class CDOResourceNodeImpl extends CDOObjectImpl implements CDORe } catch (Exception ex) { - throw new CDOException("Duplicate path: " + newPath); + throw new CDOException(MessageFormat.format(Messages.getString("CDOResourceNodeImpl.5"), newPath)); //$NON-NLS-1$ } } } // CDOResourceNodeImpl diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/EresourceFactoryImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/EresourceFactoryImpl.java index c6bbf57d9c..cec66239fe 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/EresourceFactoryImpl.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/EresourceFactoryImpl.java @@ -14,6 +14,7 @@ import org.eclipse.emf.cdo.eresource.CDOResource; import org.eclipse.emf.cdo.eresource.CDOResourceFolder; import org.eclipse.emf.cdo.eresource.EresourceFactory; import org.eclipse.emf.cdo.eresource.EresourcePackage; +import org.eclipse.emf.cdo.messages.Messages; import org.eclipse.emf.common.util.URI; import org.eclipse.emf.ecore.EClass; @@ -23,6 +24,8 @@ import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.impl.EFactoryImpl; import org.eclipse.emf.ecore.plugin.EcorePlugin; +import java.text.MessageFormat; + /** * <!-- begin-user-doc --> An implementation of the model <b>Factory</b>. <!-- end-user-doc --> * @@ -36,7 +39,9 @@ public class EresourceFactoryImpl extends EFactoryImpl implements EresourceFacto * @generated * @since 2.0 */ - public static final String copyright = "Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) and others.\r\nAll rights reserved. This program and the accompanying materials\r\nare made available under the terms of the Eclipse Public License v1.0\r\nwhich accompanies this distribution, and is available at\r\nhttp://www.eclipse.org/legal/epl-v10.html\r\n\r\nContributors:\r\n Eike Stepper - initial API and implementation"; + public static final String copyright = "Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) and others.\r\nAll rights reserved. This program and the accompanying materials\r\nare made available under the terms of the Eclipse Public License v1.0\r\nwhich accompanies this distribution, and is available at\r\nhttp://www.eclipse.org/legal/epl-v10.html\r\n\r\nContributors:\r\n Eike Stepper - initial API and implementation"; //$NON-NLS-1$ + + private static final String dataTypeError = Messages.getString("EresourceFactoryImpl.1"); //$NON-NLS-1$ /** * Creates the default factory implementation. <!-- begin-user-doc --> <!-- end-user-doc --> @@ -48,7 +53,7 @@ public class EresourceFactoryImpl extends EFactoryImpl implements EresourceFacto try { EresourceFactory theEresourceFactory = (EresourceFactory)EPackage.Registry.INSTANCE - .getEFactory("http://www.eclipse.org/emf/CDO/Eresource/2.0.0"); + .getEFactory("http://www.eclipse.org/emf/CDO/Eresource/2.0.0"); //$NON-NLS-1$ if (theEresourceFactory != null) { return theEresourceFactory; @@ -86,7 +91,8 @@ public class EresourceFactoryImpl extends EFactoryImpl implements EresourceFacto case EresourcePackage.CDO_RESOURCE: return createCDOResource(); default: - throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); + throw new IllegalArgumentException(MessageFormat.format( + Messages.getString("EresourceFactoryImpl.3"), eClass.getName())); //$NON-NLS-1$ } } @@ -103,7 +109,7 @@ public class EresourceFactoryImpl extends EFactoryImpl implements EresourceFacto case EresourcePackage.URI: return createURIFromString(eDataType, initialValue); default: - throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); + throw new IllegalArgumentException(MessageFormat.format(dataTypeError, eDataType.getName())); } } @@ -120,7 +126,7 @@ public class EresourceFactoryImpl extends EFactoryImpl implements EresourceFacto case EresourcePackage.URI: return convertURIToString(eDataType, instanceValue); default: - throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); + throw new IllegalArgumentException(MessageFormat.format(dataTypeError, eDataType.getName())); } } diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/EresourcePackageImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/EresourcePackageImpl.java index a0cc099cb3..e600a915fa 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/EresourcePackageImpl.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/EresourcePackageImpl.java @@ -39,7 +39,7 @@ public class EresourcePackageImpl extends EPackageImpl implements EresourcePacka * @generated * @since 2.0 */ - public static final String copyright = "Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) and others.\r\nAll rights reserved. This program and the accompanying materials\r\nare made available under the terms of the Eclipse Public License v1.0\r\nwhich accompanies this distribution, and is available at\r\nhttp://www.eclipse.org/legal/epl-v10.html\r\n\r\nContributors:\r\n Eike Stepper - initial API and implementation"; + public static final String copyright = "Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) and others.\r\nAll rights reserved. This program and the accompanying materials\r\nare made available under the terms of the Eclipse Public License v1.0\r\nwhich accompanies this distribution, and is available at\r\nhttp://www.eclipse.org/legal/epl-v10.html\r\n\r\nContributors:\r\n Eike Stepper - initial API and implementation"; //$NON-NLS-1$ /** * <!-- begin-user-doc --> <!-- end-user-doc --> @@ -446,51 +446,51 @@ public class EresourcePackageImpl extends EPackageImpl implements EresourcePacka cdoResourceEClass.getESuperTypes().add(getCDOResourceNode()); // Initialize classes and features; add operations and parameters - initEClass(cdoResourceNodeEClass, CDOResourceNode.class, "CDOResourceNode", IS_ABSTRACT, !IS_INTERFACE, + initEClass(cdoResourceNodeEClass, CDOResourceNode.class, "CDOResourceNode", IS_ABSTRACT, !IS_INTERFACE, //$NON-NLS-1$ IS_GENERATED_INSTANCE_CLASS); - initEReference(getCDOResourceNode_Folder(), getCDOResourceFolder(), getCDOResourceFolder_Nodes(), "folder", null, + initEReference(getCDOResourceNode_Folder(), getCDOResourceFolder(), getCDOResourceFolder_Nodes(), "folder", null, //$NON-NLS-1$ 0, 1, CDOResourceNode.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getCDOResourceNode_Name(), ecorePackage.getEString(), "name", null, 0, 1, CDOResourceNode.class, + initEAttribute(getCDOResourceNode_Name(), ecorePackage.getEString(), "name", null, 0, 1, CDOResourceNode.class, //$NON-NLS-1$ !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getCDOResourceNode_Path(), ecorePackage.getEString(), "path", null, 0, 1, CDOResourceNode.class, + initEAttribute(getCDOResourceNode_Path(), ecorePackage.getEString(), "path", null, 0, 1, CDOResourceNode.class, //$NON-NLS-1$ IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED); - initEClass(cdoResourceFolderEClass, CDOResourceFolder.class, "CDOResourceFolder", !IS_ABSTRACT, !IS_INTERFACE, + initEClass(cdoResourceFolderEClass, CDOResourceFolder.class, "CDOResourceFolder", !IS_ABSTRACT, !IS_INTERFACE, //$NON-NLS-1$ IS_GENERATED_INSTANCE_CLASS); - initEReference(getCDOResourceFolder_Nodes(), getCDOResourceNode(), getCDOResourceNode_Folder(), "nodes", null, 0, + initEReference(getCDOResourceFolder_Nodes(), getCDOResourceNode(), getCDOResourceNode_Folder(), "nodes", null, 0, //$NON-NLS-1$ -1, CDOResourceFolder.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(cdoResourceEClass, CDOResource.class, "CDOResource", !IS_ABSTRACT, !IS_INTERFACE, + initEClass(cdoResourceEClass, CDOResource.class, "CDOResource", !IS_ABSTRACT, !IS_INTERFACE, //$NON-NLS-1$ IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getCDOResource_ResourceSet(), getResourceSet(), "resourceSet", null, 0, 1, CDOResource.class, + initEAttribute(getCDOResource_ResourceSet(), getResourceSet(), "resourceSet", null, 0, 1, CDOResource.class, //$NON-NLS-1$ IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getCDOResource_URI(), getURI(), "uRI", null, 0, 1, CDOResource.class, IS_TRANSIENT, IS_VOLATILE, + initEAttribute(getCDOResource_URI(), getURI(), "uRI", null, 0, 1, CDOResource.class, IS_TRANSIENT, IS_VOLATILE, //$NON-NLS-1$ IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED); - initEReference(getCDOResource_Contents(), theEcorePackage.getEObject(), null, "contents", null, 0, -1, + initEReference(getCDOResource_Contents(), theEcorePackage.getEObject(), null, "contents", null, 0, -1, //$NON-NLS-1$ CDOResource.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getCDOResource_Modified(), ecorePackage.getEBoolean(), "modified", null, 0, 1, CDOResource.class, + initEAttribute(getCDOResource_Modified(), ecorePackage.getEBoolean(), "modified", null, 0, 1, CDOResource.class, //$NON-NLS-1$ IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getCDOResource_Loaded(), ecorePackage.getEBoolean(), "loaded", "true", 0, 1, CDOResource.class, + initEAttribute(getCDOResource_Loaded(), ecorePackage.getEBoolean(), "loaded", "true", 0, 1, CDOResource.class, //$NON-NLS-1$ //$NON-NLS-2$ IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED); - initEAttribute(getCDOResource_TrackingModification(), ecorePackage.getEBoolean(), "trackingModification", null, 0, + initEAttribute(getCDOResource_TrackingModification(), ecorePackage.getEBoolean(), "trackingModification", null, 0, //$NON-NLS-1$ 1, CDOResource.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getCDOResource_Errors(), getDiagnostic(), "errors", null, 0, -1, CDOResource.class, IS_TRANSIENT, + initEAttribute(getCDOResource_Errors(), getDiagnostic(), "errors", null, 0, -1, CDOResource.class, IS_TRANSIENT, //$NON-NLS-1$ IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED); - initEAttribute(getCDOResource_Warnings(), getDiagnostic(), "warnings", null, 0, -1, CDOResource.class, + initEAttribute(getCDOResource_Warnings(), getDiagnostic(), "warnings", null, 0, -1, CDOResource.class, //$NON-NLS-1$ IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED); - initEAttribute(getCDOResource_TimeStamp(), theEcorePackage.getELong(), "timeStamp", null, 0, 1, CDOResource.class, + initEAttribute(getCDOResource_TimeStamp(), theEcorePackage.getELong(), "timeStamp", null, 0, 1, CDOResource.class, //$NON-NLS-1$ IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); // Initialize data types - initEDataType(resourceSetEDataType, ResourceSet.class, "ResourceSet", !IS_SERIALIZABLE, + initEDataType(resourceSetEDataType, ResourceSet.class, "ResourceSet", !IS_SERIALIZABLE, //$NON-NLS-1$ !IS_GENERATED_INSTANCE_CLASS); - initEDataType(uriEDataType, org.eclipse.emf.common.util.URI.class, "URI", IS_SERIALIZABLE, + initEDataType(uriEDataType, org.eclipse.emf.common.util.URI.class, "URI", IS_SERIALIZABLE, //$NON-NLS-1$ !IS_GENERATED_INSTANCE_CLASS); - initEDataType(diagnosticEDataType, Diagnostic.class, "Diagnostic", !IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); + initEDataType(diagnosticEDataType, Diagnostic.class, "Diagnostic", !IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ // Create resource createResource(eNS_URI); diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/util/EresourceAdapterFactory.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/util/EresourceAdapterFactory.java index 2056996b29..f3bb71c895 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/util/EresourceAdapterFactory.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/util/EresourceAdapterFactory.java @@ -35,7 +35,7 @@ public class EresourceAdapterFactory extends AdapterFactoryImpl * @generated * @since 2.0 */ - public static final String copyright = "Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) and others.\r\nAll rights reserved. This program and the accompanying materials\r\nare made available under the terms of the Eclipse Public License v1.0\r\nwhich accompanies this distribution, and is available at\r\nhttp://www.eclipse.org/legal/epl-v10.html\r\n\r\nContributors:\r\n Eike Stepper - initial API and implementation"; + public static final String copyright = "Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) and others.\r\nAll rights reserved. This program and the accompanying materials\r\nare made available under the terms of the Eclipse Public License v1.0\r\nwhich accompanies this distribution, and is available at\r\nhttp://www.eclipse.org/legal/epl-v10.html\r\n\r\nContributors:\r\n Eike Stepper - initial API and implementation"; //$NON-NLS-1$ /** * The cached model package. <!-- begin-user-doc --> <!-- end-user-doc --> diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/util/EresourceSwitch.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/util/EresourceSwitch.java index c28a215e90..45d15a392b 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/util/EresourceSwitch.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/util/EresourceSwitch.java @@ -37,7 +37,7 @@ public class EresourceSwitch<T> * @generated * @since 2.0 */ - public static final String copyright = "Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) and others.\r\nAll rights reserved. This program and the accompanying materials\r\nare made available under the terms of the Eclipse Public License v1.0\r\nwhich accompanies this distribution, and is available at\r\nhttp://www.eclipse.org/legal/epl-v10.html\r\n\r\nContributors:\r\n Eike Stepper - initial API and implementation"; + public static final String copyright = "Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) and others.\r\nAll rights reserved. This program and the accompanying materials\r\nare made available under the terms of the Eclipse Public License v1.0\r\nwhich accompanies this distribution, and is available at\r\nhttp://www.eclipse.org/legal/epl-v10.html\r\n\r\nContributors:\r\n Eike Stepper - initial API and implementation"; //$NON-NLS-1$ /** * The cached model package <!-- begin-user-doc --> <!-- end-user-doc --> diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/messages/Messages.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/messages/Messages.java new file mode 100644 index 0000000000..ef72dd73aa --- /dev/null +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/messages/Messages.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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 + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Victor Roldan Betancort - initial API and implementation + * Eike Stepper - maintenance + */ +package org.eclipse.emf.cdo.messages; + +import java.util.MissingResourceException; +import java.util.ResourceBundle; + +/** + * @author Victor Roldan Betancort + */ +public class Messages +{ + private static final String BUNDLE_NAME = "org.eclipse.emf.cdo.messages.messages"; //$NON-NLS-1$ + + private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME); + + private Messages() + { + } + + public static String getString(String key) + { + try + { + return RESOURCE_BUNDLE.getString(key); + } + catch (MissingResourceException e) + { + return '!' + key + '!'; + } + } +} diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/messages/messages.properties b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/messages/messages.properties new file mode 100644 index 0000000000..374dd5f7a3 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/messages/messages.properties @@ -0,0 +1,76 @@ +AbstractObjectConflictResolver.0=Object has feature-level conflicts +CDOAdapterPolicy.0=CDO +CDOAdapterPolicy.1=NONE +CDOAdapterPolicy.2=ALL +CDOClientProtocol.0=No session +CDOObjectImpl.8=Resource needs to be an instanceof CDOResourceImpl +CDOQueryImpl.0=Object not persisted +CDOResourceNodeImpl.3=Null path is not allowed +CDOResourceNodeImpl.4=Root path is not allowed +CDOResourceNodeImpl.5=Duplicate path: {0} +CDOSessionConfigurationImpl.0=Session is already open +CDOSessionFactory.1=Query is empty: {0} +CDOSessionImpl.0=Generated packages locally not available: {0} +CDOTransactionImpl.0=Not a ResourceFolder: {0} +CDOTransactionImpl.1=Root resource node {0} does not exist +CDOTransactionImpl.10=Duplicate ID: {0} +CDOTransactionImpl.11=No package unit for {0} +CDOTransactionImpl.17=New conflict resolver is already associated with a transaction +CDOTransactionImpl.2=This transaction has conflicts +CDOTransactionImpl.3=Save point is null +CDOTransactionImpl.4=Save point to roll-back does not belong to this transaction: {0} +CDOTransactionImpl.6=Save point is not valid: {0} +CDOUtil.0=Auditing not supported by repository +CDOViewImpl.0=CDO view is read-only: {0} +CDOViewImpl.1=path is empty +CDOViewImpl.11=Object is contained in a different session: {0} +CDOViewImpl.14=Not a ResourceFolder: {0} +CDOViewImpl.16=Unable to provideCDOID: {0} +CDOViewImpl.17=ID not registered: {0} +CDOViewImpl.18=CDO view is read-only: {0} +CDOViewImpl.2=Can not find {0} +CDOViewImpl.20=Duplicate ID: {0} +CDOViewImpl.26=Invalid view type: {0} +CDOViewImpl.27=Object {0} does not belong to this view +CDOViewImpl.29=Unknown referenceType +CDOViewImpl.3=name == null +CDOViewImpl.4=Expected folder for id = {0} +CDOViewImpl.5=Node {0} not found +CDOViewImpl.6=No root ResourceNode +CDOViewImpl.7=No top level ResourceNode with the name {0} +CDOViewImpl.8=Duplicate top-level ResourceNodes +CDOViewImpl.9=Cannot find revision with ID {0} +CDOViewProviderRegistryImpl.4=class not defined for extension {0} +CDOViewProviderRegistryImpl.6=regex not defined for extension {0} +CDOViewSetImpl.0=Cannot find associated CDOView for repository {0} +CDOViewSetImpl.1=Do not know which CDOView to take since no authority has been specified +CDOViewSetImpl.2=Only one view per repository can be open for the same resource set +CDOViewSetImpl.3=Unsupported target: {0} +CDOViewSetImpl.4=Cannot associate more than 1 resource set with this view set +CDOXACommitContextImpl.0=Object should be an EObject: {0} +CDOXATransactionImpl.0=XATransaction is already attached to this viewSet +CDOXATransactionImpl.1=ViewSet is not attached to this XATransaction +CDOXATransactionImpl.4=Committing XA transaction +CDOXATransactionImpl.5=Save point is null +CDOXATransactionImpl.6=Save point to rollback does not belong to this transaction: +CDOXATransactionImpl.7=Save point is not valid: {0} +CDOXATransactionImpl.8=Commit from CDOTransaction is not allowed +CommitTransactionPhase2Request.1=Missing informations. {0} is not involved in the commit +CommitTransactionPhase2Request.2=Missing informations. {0} is not mapped in the commit +CompletePackageClosure.0=Package == null for {0} +DanglingReferenceException.0=The object '{0}({1})' is not contained in a resource +EresourceFactoryImpl.1=The datatype '{0}' is not a valid classifier +EresourceFactoryImpl.3=The class '{0}' is not a valid classifier +FailOverStrategyInjector.0=Malformed URI, couldn't find scheme separator :// +FailOverStrategyInjector.1=factoryType not defined +FailOverStrategyInjector.2=connectorDescription not defined +FSMUtil.0=View closed +FSMUtil.1=object == null +FSMUtil.2=view == null +FSMUtil.3=Legacy models not supported +InvalidObjectException.0=Object {0} isn't valid anymore +InvalidURIException.0=Invalid URI '{0}': {1} +ObjectNotFoundException.0=Object {0} not found (temporary = {1}) +OpenSessionRequest.0=Repository {0} not found +OpenSessionRequest.3=Failed to open session for repository {0} +SyncRevisionsRequest.2=Did not expect to receive object with id '{0}' diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOURIUtil.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOURIUtil.java index 5022a994be..cc04b194b0 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOURIUtil.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOURIUtil.java @@ -105,11 +105,11 @@ public class CDOURIUtil { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append(CDOProtocolConstants.PROTOCOL_NAME); - stringBuilder.append(":"); + stringBuilder.append(":"); //$NON-NLS-1$ if (repositoryUUID != null) { - stringBuilder.append("//"); + stringBuilder.append("//"); //$NON-NLS-1$ stringBuilder.append(repositoryUUID); } diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOUtil.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOUtil.java index e20b3bc99e..c3132a47f1 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOUtil.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOUtil.java @@ -15,6 +15,7 @@ package org.eclipse.emf.cdo.util; import org.eclipse.emf.cdo.CDOObject; import org.eclipse.emf.cdo.common.revision.CDORevision; import org.eclipse.emf.cdo.eresource.CDOResource; +import org.eclipse.emf.cdo.messages.Messages; import org.eclipse.emf.cdo.net4j.CDONet4jUtil; import org.eclipse.emf.cdo.net4j.CDOSessionConfiguration; import org.eclipse.emf.cdo.session.CDOCollectionLoadingPolicy; @@ -240,7 +241,7 @@ public final class CDOUtil CDOSession session = object.cdoView().getSession(); if (session.repository().isSupportingAudits()) { - throw new IllegalStateException("Auditing not supported by repository"); + throw new IllegalStateException(Messages.getString("CDOUtil.0")); //$NON-NLS-1$ } return session.getRevisionManager().getRevisionByVersion(object.cdoID(), 0, version); diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/DanglingReferenceException.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/DanglingReferenceException.java index d579db353e..07aba0f926 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/DanglingReferenceException.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/DanglingReferenceException.java @@ -12,9 +12,12 @@ package org.eclipse.emf.cdo.util; import org.eclipse.emf.cdo.common.util.CDOException; +import org.eclipse.emf.cdo.messages.Messages; import org.eclipse.emf.ecore.EObject; +import java.text.MessageFormat; + /** * @author Simon McDuff * @since 2.0 @@ -27,7 +30,7 @@ public class DanglingReferenceException extends CDOException public DanglingReferenceException(EObject object) { - super("The object '" + object + "(" + object.getClass().getName() + ")' is not contained in a resource."); + super(MessageFormat.format(Messages.getString("DanglingReferenceException.0"), object, object.getClass().getName())); //$NON-NLS-1$ target = object; } diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/InvalidObjectException.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/InvalidObjectException.java index 1953d2cf4d..3c300d5738 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/InvalidObjectException.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/InvalidObjectException.java @@ -13,8 +13,11 @@ package org.eclipse.emf.cdo.util; import org.eclipse.emf.cdo.common.id.CDOID; import org.eclipse.emf.cdo.common.util.CDOException; +import org.eclipse.emf.cdo.messages.Messages; import org.eclipse.emf.cdo.transaction.CDOTransaction; +import java.text.MessageFormat; + /** * Exception occurs when an object isn't valid anymore. It was valid when we create it, but not anymore. The cause could * be that another {@link CDOTransaction} removed it. @@ -28,6 +31,6 @@ public class InvalidObjectException extends CDOException public InvalidObjectException(CDOID id) { - super("Object " + id + " isn't valid anymore."); + super(MessageFormat.format(Messages.getString("InvalidObjectException.0"), id)); //$NON-NLS-1$ } } diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/InvalidURIException.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/InvalidURIException.java index 937ce1dc7a..f9dc8579d2 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/InvalidURIException.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/InvalidURIException.java @@ -11,9 +11,12 @@ package org.eclipse.emf.cdo.util; import org.eclipse.emf.cdo.common.util.CDOException; +import org.eclipse.emf.cdo.messages.Messages; import org.eclipse.emf.common.util.URI; +import java.text.MessageFormat; + /** * @author Eike Stepper * @since 2.0 @@ -26,7 +29,7 @@ public class InvalidURIException extends CDOException public InvalidURIException(URI uri, Throwable cause) { - super("Invalid URI: " + uri, cause); + super(MessageFormat.format(Messages.getString("InvalidURIException.0"), uri, cause)); //$NON-NLS-1$ this.uri = uri; } diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/ObjectNotFoundException.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/ObjectNotFoundException.java index 6484625e25..2a948f0aa1 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/ObjectNotFoundException.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/ObjectNotFoundException.java @@ -13,6 +13,9 @@ package org.eclipse.emf.cdo.util; import org.eclipse.emf.cdo.common.id.CDOID; import org.eclipse.emf.cdo.common.util.CDOException; +import org.eclipse.emf.cdo.messages.Messages; + +import java.text.MessageFormat; /** * Exception occurs when an id doesn't exist on the server. @@ -26,6 +29,6 @@ public class ObjectNotFoundException extends CDOException public ObjectNotFoundException(CDOID id) { - super("Object " + id + " not found (temporary = " + id.isTemporary() + ")."); + super(MessageFormat.format(Messages.getString("ObjectNotFoundException.0"), id, id.isTemporary())); //$NON-NLS-1$ } } diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/view/CDOAdapterPolicy.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/view/CDOAdapterPolicy.java index a1e39eb287..021c3c53d0 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/view/CDOAdapterPolicy.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/view/CDOAdapterPolicy.java @@ -13,6 +13,7 @@ package org.eclipse.emf.cdo.view; import org.eclipse.emf.cdo.CDOAdapter; import org.eclipse.emf.cdo.CDOInvalidationNotification; +import org.eclipse.emf.cdo.messages.Messages; import org.eclipse.emf.cdo.session.CDOSessionInvalidationEvent; import org.eclipse.emf.cdo.transaction.CDOTransaction; @@ -70,7 +71,7 @@ public interface CDOAdapterPolicy @Override public String toString() { - return "NONE"; + return Messages.getString("CDOAdapterPolicy.1"); //$NON-NLS-1$ } }; @@ -91,7 +92,7 @@ public interface CDOAdapterPolicy @Override public String toString() { - return "CDO"; + return Messages.getString("CDOAdapterPolicy.0"); //$NON-NLS-1$ } }; @@ -111,7 +112,7 @@ public interface CDOAdapterPolicy @Override public String toString() { - return "ALL"; + return Messages.getString("CDOAdapterPolicy.2"); //$NON-NLS-1$ } }; diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOLegacyWrapper.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOLegacyWrapper.java index e8f00e51e3..2ca0033187 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOLegacyWrapper.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOLegacyWrapper.java @@ -73,10 +73,10 @@ public final class CDOLegacyWrapper extends CDOObjectWrapper { private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG_OBJECT, CDOLegacyWrapper.class); - private static final Method eSetDirectResourceMethod = ReflectUtil.getMethod(EObjectImpl.class, "eSetDirectResource", + private static final Method eSetDirectResourceMethod = ReflectUtil.getMethod(EObjectImpl.class, "eSetDirectResource", //$NON-NLS-1$ Resource.Internal.class); - private static final Method eBasicSetContainerMethod = ReflectUtil.getMethod(EObjectImpl.class, "eBasicSetContainer", + private static final Method eBasicSetContainerMethod = ReflectUtil.getMethod(EObjectImpl.class, "eBasicSetContainer", //$NON-NLS-1$ InternalEObject.class, int.class); private CDOState state; @@ -115,7 +115,7 @@ public final class CDOLegacyWrapper extends CDOObjectWrapper { if (TRACER.isEnabled()) { - TRACER.format("Setting state {0} for {1}", state, this); + TRACER.format("Setting state {0} for {1}", state, this); //$NON-NLS-1$ } CDOState tmp = this.state; @@ -132,7 +132,7 @@ public final class CDOLegacyWrapper extends CDOObjectWrapper { if (TRACER.isEnabled()) { - TRACER.format("Setting revision: {0}", revision); + TRACER.format("Setting revision: {0}", revision); //$NON-NLS-1$ } this.revision = (InternalCDORevision)revision; @@ -244,14 +244,14 @@ public final class CDOLegacyWrapper extends CDOObjectWrapper @Override public String toString() { - return "CDOLegacyWrapper[" + id + "]"; + return "CDOLegacyWrapper[" + id + "]"; //$NON-NLS-1$ //$NON-NLS-2$ } private void instanceToRevision() { if (TRACER.isEnabled()) { - TRACER.format("Transfering instance to revision: {0} --> {1}", instance, revision); + TRACER.format("Transfering instance to revision: {0} --> {1}", instance, revision); //$NON-NLS-1$ } // Handle containment @@ -329,7 +329,7 @@ public final class CDOLegacyWrapper extends CDOObjectWrapper { if (TRACER.isEnabled()) { - TRACER.format("Transfering revision to instance: {0} --> {1}", revision, instance); + TRACER.format("Transfering revision to instance: {0} --> {1}", revision, instance); //$NON-NLS-1$ } boolean deliver = instance.eDeliver(); @@ -485,10 +485,10 @@ public final class CDOLegacyWrapper extends CDOObjectWrapper // UNIQUE_EFLAG = 1 << 9; // ******************************************* - String flagName = GenUtil.getFeatureUpperName(featureName) + "_EFLAG"; + String flagName = GenUtil.getFeatureUpperName(featureName) + "_EFLAG"; //$NON-NLS-1$ int flagsMask = getEFlagMask(instanceClass, flagName); - field = ReflectUtil.getField(instanceClass, "eFlags"); + field = ReflectUtil.getField(instanceClass, "eFlags"); //$NON-NLS-1$ int flags = (Integer)ReflectUtil.getValue(field, instance); boolean on = (Boolean)value; if (on) @@ -507,7 +507,7 @@ public final class CDOLegacyWrapper extends CDOObjectWrapper if (field == null) { - throw new ImplementationError("Field not found: " + fieldName); + throw new ImplementationError("Field not found: " + fieldName); //$NON-NLS-1$ } ReflectUtil.setValue(field, instance, value); @@ -655,10 +655,10 @@ public final class CDOLegacyWrapper extends CDOObjectWrapper { if (!instance.eIsProxy()) { - URI uri = URI.createURI(CDOProtocolConstants.PROTOCOL_NAME + ":proxy#" + id); + URI uri = URI.createURI(CDOProtocolConstants.PROTOCOL_NAME + ":proxy#" + id); //$NON-NLS-1$ if (TRACER.isEnabled()) { - TRACER.format("Setting proxyURI {0} for {1}", uri, instance); + TRACER.format("Setting proxyURI {0} for {1}", uri, instance); //$NON-NLS-1$ } instance.eSetProxyURI(uri); @@ -670,7 +670,7 @@ public final class CDOLegacyWrapper extends CDOObjectWrapper { if (TRACER.isEnabled()) { - TRACER.format("Unsetting proxyURI for {0}", instance); + TRACER.format("Unsetting proxyURI for {0}", instance); //$NON-NLS-1$ } instance.eSetProxyURI(null); @@ -726,11 +726,11 @@ public final class CDOLegacyWrapper extends CDOObjectWrapper */ private static final class LegacyProxyInvocationHandler implements InvocationHandler, LegacyProxy { - private static final Method getIDMethod = ReflectUtil.getMethod(LegacyProxy.class, "getID"); + private static final Method getIDMethod = ReflectUtil.getMethod(LegacyProxy.class, "getID"); //$NON-NLS-1$ - private static final Method eIsProxyMethod = ReflectUtil.getMethod(EObject.class, "eIsProxy"); + private static final Method eIsProxyMethod = ReflectUtil.getMethod(EObject.class, "eIsProxy"); //$NON-NLS-1$ - private static final Method eProxyURIMethod = ReflectUtil.getMethod(InternalEObject.class, "eProxyURI"); + private static final Method eProxyURIMethod = ReflectUtil.getMethod(InternalEObject.class, "eProxyURI"); //$NON-NLS-1$ private CDOLegacyWrapper wrapper; diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOMetaWrapper.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOMetaWrapper.java index fdda3570b9..e91ce718d1 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOMetaWrapper.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOMetaWrapper.java @@ -120,9 +120,9 @@ public class CDOMetaWrapper extends CDOObjectWrapper { if (cdoID() == null) { - return instance.eClass().getName() + "?"; + return instance.eClass().getName() + "?"; //$NON-NLS-1$ } - return instance.eClass().getName() + "@" + cdoID(); + return instance.eClass().getName() + "@" + cdoID(); //$NON-NLS-1$ } } diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java index ee5a9612f7..9678af3194 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java @@ -17,6 +17,7 @@ import org.eclipse.emf.cdo.common.id.CDOID; import org.eclipse.emf.cdo.common.revision.CDORevision; import org.eclipse.emf.cdo.eresource.CDOResource; import org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl; +import org.eclipse.emf.cdo.messages.Messages; import org.eclipse.emf.cdo.spi.common.revision.InternalCDORevision; import org.eclipse.emf.cdo.util.CDOUtil; import org.eclipse.emf.cdo.view.CDOView; @@ -193,7 +194,7 @@ public class CDOObjectImpl extends EStoreEObjectImpl implements InternalCDOObjec { if (TRACER.isEnabled()) { - TRACER.format("Setting ID: {0}", id); + TRACER.format("Setting ID: {0}", id); //$NON-NLS-1$ } this.id = id; @@ -205,7 +206,7 @@ public class CDOObjectImpl extends EStoreEObjectImpl implements InternalCDOObjec { if (TRACER.isEnabled()) { - TRACER.format("Setting state {0} for {1}", state, this); + TRACER.format("Setting state {0} for {1}", state, this); //$NON-NLS-1$ } try @@ -229,7 +230,7 @@ public class CDOObjectImpl extends EStoreEObjectImpl implements InternalCDOObjec { if (TRACER.isEnabled()) { - TRACER.format("Setting revision: {0}", revision); + TRACER.format("Setting revision: {0}", revision); //$NON-NLS-1$ } this.revision = (InternalCDORevision)revision; @@ -303,7 +304,7 @@ public class CDOObjectImpl extends EStoreEObjectImpl implements InternalCDOObjec { if (TRACER.isEnabled()) { - TRACER.format("Populating revision for {0}", this); + TRACER.format("Populating revision for {0}", this); //$NON-NLS-1$ } InternalCDOView view = cdoView(); @@ -364,7 +365,7 @@ public class CDOObjectImpl extends EStoreEObjectImpl implements InternalCDOObjec { if (TRACER.isEnabled()) { - TRACER.format("Populating feature {0}", feature); + TRACER.format("Populating feature {0}", feature); //$NON-NLS-1$ } Object setting = cdoBasicSettings() != null ? cdoSettings()[i] : null; @@ -398,7 +399,7 @@ public class CDOObjectImpl extends EStoreEObjectImpl implements InternalCDOObjec { if (TRACER.isEnabled()) { - TRACER.format("Depopulating revision for {0}", this); + TRACER.format("Depopulating revision for {0}", this); //$NON-NLS-1$ } InternalCDOView view = cdoView(); @@ -437,7 +438,7 @@ public class CDOObjectImpl extends EStoreEObjectImpl implements InternalCDOObjec { if (TRACER.isEnabled()) { - TRACER.format("Depopulating feature {0}", eFeature); + TRACER.format("Depopulating feature {0}", eFeature); //$NON-NLS-1$ } EStructuralFeature.Internal internalFeature = (EStructuralFeature.Internal)eFeature; @@ -591,7 +592,7 @@ public class CDOObjectImpl extends EStoreEObjectImpl implements InternalCDOObjec // Answer from Christian Damus // Java ensures that string constants are interned, so this is actually // more efficient than .equals() and it's correct - if (eType.getInstanceClassName() == "java.util.Map$Entry") + if (eType.getInstanceClassName() == "java.util.Map$Entry") //$NON-NLS-1$ { class EStoreEcoreEMap extends EcoreEMap<Object, Object> implements InternalCDOLoadable { @@ -736,7 +737,7 @@ public class CDOObjectImpl extends EStoreEObjectImpl implements InternalCDOObjec } else { - throw new IllegalArgumentException("Resource needs to be an instanceof CDOResourceImpl"); + throw new IllegalArgumentException(Messages.getString("CDOObjectImpl.8")); //$NON-NLS-1$ } } @@ -997,7 +998,7 @@ public class CDOObjectImpl extends EStoreEObjectImpl implements InternalCDOObjec { if (TRACER.isEnabled()) { - TRACER.format("Setting container: {0}, featureID={1}", newEContainer, newContainerFeatureID); + TRACER.format("Setting container: {0}, featureID={1}", newEContainer, newContainerFeatureID); //$NON-NLS-1$ } if (FSMUtil.isTransient(this)) @@ -1024,10 +1025,10 @@ public class CDOObjectImpl extends EStoreEObjectImpl implements InternalCDOObjec { if (id == null) { - return eClass().getName() + "?"; + return eClass().getName() + "?"; //$NON-NLS-1$ } - return eClass().getName() + "@" + id; + return eClass().getName() + "@" + id; //$NON-NLS-1$ } private CDOStore cdoStore() @@ -1465,18 +1466,18 @@ public class CDOObjectImpl extends EStoreEObjectImpl implements InternalCDOObjec protected String delegateToString() { StringBuffer stringBuffer = new StringBuffer(); - stringBuffer.append("["); + stringBuffer.append("["); //$NON-NLS-1$ for (int i = 0, size = size(); i < size;) { Object value = delegateGet(i); stringBuffer.append(String.valueOf(value)); if (++i < size) { - stringBuffer.append(", "); + stringBuffer.append(", "); //$NON-NLS-1$ } } - stringBuffer.append("]"); + stringBuffer.append("]"); //$NON-NLS-1$ return stringBuffer.toString(); } } diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectWrapper.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectWrapper.java index de667d2525..04388dc5fb 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectWrapper.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectWrapper.java @@ -94,12 +94,12 @@ public abstract class CDOObjectWrapper implements InternalCDOObject { if (id == null) { - throw new IllegalArgumentException("id == null"); + throw new IllegalArgumentException("id == null"); //$NON-NLS-1$ } if (TRACER.isEnabled()) { - TRACER.format("Setting ID: {0} for {1}", id, instance); + TRACER.format("Setting ID: {0} for {1}", id, instance); //$NON-NLS-1$ } this.id = id; @@ -109,7 +109,7 @@ public abstract class CDOObjectWrapper implements InternalCDOObject { if (TRACER.isEnabled()) { - TRACER.format("Setting view: {0} for {1}", view, instance); + TRACER.format("Setting view: {0} for {1}", view, instance); //$NON-NLS-1$ } this.view = (InternalCDOView)view; @@ -139,7 +139,7 @@ public abstract class CDOObjectWrapper implements InternalCDOObject public EStructuralFeature cdoInternalDynamicFeature(int dynamicFeatureID) { // TODO Implement method CDOWrapperImpl.cdoInternalDynamicFeature() - throw new UnsupportedOperationException("Not yet implemented"); + throw new UnsupportedOperationException("Not yet implemented"); //$NON-NLS-1$ } /** diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStateMachine.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStateMachine.java index 9e2a8ed1b0..1b7272155c 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStateMachine.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStateMachine.java @@ -205,7 +205,7 @@ public final class CDOStateMachine extends FiniteStateMachine<CDOState, CDOEvent { if (TRACER.isEnabled()) { - TRACER.format("PREPARE: {0} --> {1}", object, transactionAndMapOfContents.getElement1()); + TRACER.format("PREPARE: {0} --> {1}", object, transactionAndMapOfContents.getElement1()); //$NON-NLS-1$ } process(object, CDOEvent.PREPARE, transactionAndMapOfContents); @@ -218,7 +218,7 @@ public final class CDOStateMachine extends FiniteStateMachine<CDOState, CDOEvent { if (TRACER.isEnabled()) { - TRACER.format("ATTACH: {0}", object); + TRACER.format("ATTACH: {0}", object); //$NON-NLS-1$ } process(object, CDOEvent.ATTACH, null); @@ -522,7 +522,7 @@ public final class CDOStateMachine extends FiniteStateMachine<CDOState, CDOEvent CDOState state = object.cdoState(); if (lastTracedObject != object || lastTracedState != state || lastTracedEvent != event) { - TRACER.format("{0}: {1}", event, object.getClass().getName()); + TRACER.format("{0}: {1}", event, object.getClass().getName()); //$NON-NLS-1$ lastTracedObject = object; lastTracedState = state; lastTracedEvent = event; diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStore.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStore.java index 682f25d712..91c1d3d3d5 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStore.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStore.java @@ -101,7 +101,7 @@ public final class CDOStore implements EStore InternalCDOObject cdoObject = getCDOObject(eObject); if (TRACER.isEnabled()) { - TRACER.format("setContainer({0}, {1}, {2}, {3})", cdoObject, newResource, newEContainer, newContainerFeatureID); + TRACER.format("setContainer({0}, {1}, {2}, {3})", cdoObject, newResource, newEContainer, newContainerFeatureID); //$NON-NLS-1$ } Object newContainerID = newEContainer == null ? CDOID.NULL : cdoObject.cdoView().convertObjectToID(newEContainer, @@ -120,7 +120,7 @@ public final class CDOStore implements EStore InternalCDOObject cdoObject = getCDOObject(eObject); if (TRACER.isEnabled()) { - TRACER.format("getContainer({0})", cdoObject); + TRACER.format("getContainer({0})", cdoObject); //$NON-NLS-1$ } InternalCDORevision revision = getRevisionForReading(cdoObject); @@ -132,7 +132,7 @@ public final class CDOStore implements EStore InternalCDOObject cdoObject = getCDOObject(eObject); if (TRACER.isEnabled()) { - TRACER.format("getContainingFeatureID({0})", cdoObject); + TRACER.format("getContainingFeatureID({0})", cdoObject); //$NON-NLS-1$ } InternalCDORevision revision = getRevisionForReading(cdoObject); @@ -147,7 +147,7 @@ public final class CDOStore implements EStore InternalCDOObject cdoObject = getCDOObject(eObject); if (TRACER.isEnabled()) { - TRACER.format("getResource({0})", cdoObject); + TRACER.format("getResource({0})", cdoObject); //$NON-NLS-1$ } InternalCDORevision revision = getRevisionForReading(cdoObject); @@ -157,7 +157,7 @@ public final class CDOStore implements EStore @Deprecated public EStructuralFeature getContainingFeature(InternalEObject eObject) { - throw new UnsupportedOperationException("Use getContainingFeatureID() instead"); + throw new UnsupportedOperationException("Use getContainingFeatureID() instead"); //$NON-NLS-1$ } public Object get(InternalEObject eObject, EStructuralFeature feature, int index) @@ -165,7 +165,7 @@ public final class CDOStore implements EStore InternalCDOObject cdoObject = getCDOObject(eObject); if (TRACER.isEnabled()) { - TRACER.format("get({0}, {1}, {2})", cdoObject, feature, index); + TRACER.format("get({0}, {1}, {2})", cdoObject, feature, index); //$NON-NLS-1$ } view.getFeatureAnalyzer().preTraverseFeature(cdoObject, feature, index); @@ -190,7 +190,7 @@ public final class CDOStore implements EStore InternalCDOObject cdoObject = getCDOObject(eObject); if (TRACER.isEnabled()) { - TRACER.format("size({0}, {1})", cdoObject, feature); + TRACER.format("size({0}, {1})", cdoObject, feature); //$NON-NLS-1$ } InternalCDORevision revision = getRevisionForReading(cdoObject); @@ -202,7 +202,7 @@ public final class CDOStore implements EStore InternalCDOObject cdoObject = getCDOObject(eObject); if (TRACER.isEnabled()) { - TRACER.format("isEmpty({0}, {1})", cdoObject, feature); + TRACER.format("isEmpty({0}, {1})", cdoObject, feature); //$NON-NLS-1$ } InternalCDORevision revision = getRevisionForReading(cdoObject); @@ -214,7 +214,7 @@ public final class CDOStore implements EStore InternalCDOObject cdoObject = getCDOObject(eObject); if (TRACER.isEnabled()) { - TRACER.format("contains({0}, {1}, {2})", cdoObject, feature, value); + TRACER.format("contains({0}, {1}, {2})", cdoObject, feature, value); //$NON-NLS-1$ } if (feature instanceof EReference) @@ -231,7 +231,7 @@ public final class CDOStore implements EStore InternalCDOObject cdoObject = getCDOObject(eObject); if (TRACER.isEnabled()) { - TRACER.format("indexOf({0}, {1}, {2})", cdoObject, feature, value); + TRACER.format("indexOf({0}, {1}, {2})", cdoObject, feature, value); //$NON-NLS-1$ } if (feature instanceof EReference) @@ -248,7 +248,7 @@ public final class CDOStore implements EStore InternalCDOObject cdoObject = getCDOObject(eObject); if (TRACER.isEnabled()) { - TRACER.format("lastIndexOf({0}, {1}, {2})", cdoObject, feature, value); + TRACER.format("lastIndexOf({0}, {1}, {2})", cdoObject, feature, value); //$NON-NLS-1$ } if (feature instanceof EReference) @@ -265,7 +265,7 @@ public final class CDOStore implements EStore InternalCDOObject cdoObject = getCDOObject(eObject); if (TRACER.isEnabled()) { - TRACER.format("hashCode({0}, {1})", cdoObject, feature); + TRACER.format("hashCode({0}, {1})", cdoObject, feature); //$NON-NLS-1$ } InternalCDORevision revision = getRevisionForReading(cdoObject); @@ -277,7 +277,7 @@ public final class CDOStore implements EStore InternalCDOObject cdoObject = getCDOObject(eObject); if (TRACER.isEnabled()) { - TRACER.format("toArray({0}, {1})", cdoObject, feature); + TRACER.format("toArray({0}, {1})", cdoObject, feature); //$NON-NLS-1$ } InternalCDORevision revision = getRevisionForReading(cdoObject); @@ -319,7 +319,7 @@ public final class CDOStore implements EStore InternalCDOObject cdoObject = getCDOObject(eObject); if (TRACER.isEnabled()) { - TRACER.format("set({0}, {1}, {2}, {3})", cdoObject, feature, index, value); + TRACER.format("set({0}, {1}, {2}, {3})", cdoObject, feature, index, value); //$NON-NLS-1$ } value = convertToCDO(getView(), feature, value); @@ -383,7 +383,7 @@ public final class CDOStore implements EStore // Object object = view.convertIDToObject(entry.getObject()); // value = FeatureMapUtil.createEntry(feature, object); throw new UnsupportedOperationException( - "Feature maps currently not supported. See https://bugs.eclipse.org/249436"); + "Feature maps currently not supported. See https://bugs.eclipse.org/249436"); //$NON-NLS-1$ } else { @@ -422,7 +422,7 @@ public final class CDOStore implements EStore // String uri = EcoreUtil.getURI(entry.getEStructuralFeature()).toString(); // value = CDORevisionUtil.createFeatureMapEntry(uri, entry.getValue()); throw new UnsupportedOperationException( - "Feature maps currently not supported. See https://bugs.eclipse.org/249436"); + "Feature maps currently not supported. See https://bugs.eclipse.org/249436"); //$NON-NLS-1$ } else { @@ -442,7 +442,7 @@ public final class CDOStore implements EStore InternalCDOObject cdoObject = getCDOObject(eObject); if (TRACER.isEnabled()) { - TRACER.format("unset({0}, {1})", cdoObject, feature); + TRACER.format("unset({0}, {1})", cdoObject, feature); //$NON-NLS-1$ } CDOFeatureDelta delta = new CDOUnsetFeatureDeltaImpl(feature); @@ -457,7 +457,7 @@ public final class CDOStore implements EStore InternalCDOObject cdoObject = getCDOObject(eObject); if (TRACER.isEnabled()) { - TRACER.format("add({0}, {1}, {2}, {3})", cdoObject, feature, index, value); + TRACER.format("add({0}, {1}, {2}, {3})", cdoObject, feature, index, value); //$NON-NLS-1$ } value = convertToCDO(cdoObject.cdoView(), feature, value); @@ -472,7 +472,7 @@ public final class CDOStore implements EStore InternalCDOObject cdoObject = getCDOObject(eObject); if (TRACER.isEnabled()) { - TRACER.format("remove({0}, {1}, {2})", cdoObject, feature, index); + TRACER.format("remove({0}, {1}, {2})", cdoObject, feature, index); //$NON-NLS-1$ } CDOFeatureDelta delta = new CDORemoveFeatureDeltaImpl(feature, index); @@ -489,7 +489,7 @@ public final class CDOStore implements EStore InternalCDOObject cdoObject = getCDOObject(eObject); if (TRACER.isEnabled()) { - TRACER.format("clear({0}, {1})", cdoObject, feature); + TRACER.format("clear({0}, {1})", cdoObject, feature); //$NON-NLS-1$ } CDOFeatureDelta delta = new CDOClearFeatureDeltaImpl(feature); @@ -503,7 +503,7 @@ public final class CDOStore implements EStore InternalCDOObject cdoObject = getCDOObject(eObject); if (TRACER.isEnabled()) { - TRACER.format("move({0}, {1}, {2}, {3})", cdoObject, feature, target, source); + TRACER.format("move({0}, {1}, {2}, {3})", cdoObject, feature, target, source); //$NON-NLS-1$ } CDOFeatureDelta delta = new CDOMoveFeatureDeltaImpl(feature, target, source); @@ -516,13 +516,13 @@ public final class CDOStore implements EStore public EObject create(EClass eClass) { - throw new UnsupportedOperationException("Use the generated factory to create objects"); + throw new UnsupportedOperationException("Use the generated factory to create objects"); //$NON-NLS-1$ } @Override public String toString() { - return MessageFormat.format("CDOStore[{0}]", view); + return MessageFormat.format("CDOStore[{0}]", view); //$NON-NLS-1$ } private InternalCDOObject getCDOObject(Object object) @@ -598,7 +598,7 @@ public final class CDOStore implements EStore InternalCDORevision revision = cdoObject.cdoRevision(); if (revision == null) { - throw new IllegalStateException("revision == null"); + throw new IllegalStateException("revision == null"); //$NON-NLS-1$ } return revision; diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOURIHandler.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOURIHandler.java index debb677ffb..ef8cb8884a 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOURIHandler.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOURIHandler.java @@ -39,7 +39,7 @@ import java.util.Set; */ public class CDOURIHandler implements URIHandler { - private static final String CDO_URI_SCHEME = "cdo"; + private static final String CDO_URI_SCHEME = "cdo"; //$NON-NLS-1$ private InternalCDOView view; diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/analyzer/CDOAbstractFeatureRuleAnalyzer.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/analyzer/CDOAbstractFeatureRuleAnalyzer.java index 310ceec434..c173ac87d2 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/analyzer/CDOAbstractFeatureRuleAnalyzer.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/analyzer/CDOAbstractFeatureRuleAnalyzer.java @@ -65,7 +65,7 @@ public abstract class CDOAbstractFeatureRuleAnalyzer implements CDOFeatureAnalyz { if (TRACER.isEnabled()) { - TRACER.format("preTraverseFeature : {0}.{1}", cdoObject.eClass(), feature.getName()); + TRACER.format("preTraverseFeature : {0}.{1}", cdoObject.eClass(), feature.getName()); //$NON-NLS-1$ } loadCollectionPolicy = cdoObject.cdoView().getSession().options().getCollectionLoadingPolicy(); @@ -84,7 +84,7 @@ public abstract class CDOAbstractFeatureRuleAnalyzer implements CDOFeatureAnalyz { if (TRACER.isEnabled()) { - TRACER.format("postTraverseFeature : {0}.{1}", cdoObject.eClass(), feature.getName()); + TRACER.format("postTraverseFeature : {0}.{1}", cdoObject.eClass(), feature.getName()); //$NON-NLS-1$ } try diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/analyzer/CDOAnalyzerFeatureInfo.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/analyzer/CDOAnalyzerFeatureInfo.java index d42e5e30a5..7ebd1eea34 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/analyzer/CDOAnalyzerFeatureInfo.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/analyzer/CDOAnalyzerFeatureInfo.java @@ -89,7 +89,7 @@ public class CDOAnalyzerFeatureInfo { if (TRACER.isEnabled()) { - TRACER.format("Adding rule : {0}.{1}", eClass.getName(), feature.getName()); + TRACER.format("Adding rule : {0}.{1}", eClass.getName(), feature.getName()); //$NON-NLS-1$ } CDOFetchRule fetchRule = fetchRules.get(eClass); @@ -106,7 +106,7 @@ public class CDOAnalyzerFeatureInfo { if (TRACER.isEnabled()) { - TRACER.format("Removing rule : {0}.{1}", eClass.getName(), feature.getName()); + TRACER.format("Removing rule : {0}.{1}", eClass.getName(), feature.getName()); //$NON-NLS-1$ } CDOFetchRule fetchRule = fetchRules.get(eClass); diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/analyzer/NOOPFetchRuleManager.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/analyzer/NOOPFetchRuleManager.java index 2bedf202b8..edf7e2a9f4 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/analyzer/NOOPFetchRuleManager.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/analyzer/NOOPFetchRuleManager.java @@ -46,6 +46,6 @@ public class NOOPFetchRuleManager implements CDOFetchRuleManager @Override public String toString() { - return "NOOP"; + return "NOOP"; //$NON-NLS-1$ } } diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/bundle/Activator.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/bundle/Activator.java index 52ea29e181..24d1e8a2c9 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/bundle/Activator.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/bundle/Activator.java @@ -61,7 +61,7 @@ public final class Activator extends EMFPlugin OSGiActivator.traceStart(context); if (OM.BUNDLE == null) { - throw new IllegalStateException("bundle == null"); + throw new IllegalStateException("bundle == null"); //$NON-NLS-1$ } try @@ -89,7 +89,7 @@ public final class Activator extends EMFPlugin OSGiActivator.traceStop(context); if (OM.BUNDLE == null) { - throw new IllegalStateException("bundle == null"); + throw new IllegalStateException("bundle == null"); //$NON-NLS-1$ } try diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/CDONet4jSessionConfigurationImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/CDONet4jSessionConfigurationImpl.java index 829a4baf9e..698c6309dc 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/CDONet4jSessionConfigurationImpl.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/CDONet4jSessionConfigurationImpl.java @@ -68,7 +68,7 @@ public class CDONet4jSessionConfigurationImpl extends CDOSessionConfigurationImp if (isActivateOnOpen()) { CheckUtil.checkState(connector != null ^ failOverStrategy != null, - "Specify exactly one of connector or failOverStrategy"); + "Specify exactly one of connector or failOverStrategy"); //$NON-NLS-1$ } CDONet4jSessionImpl session = new CDONet4jSessionImpl(); diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/CDONet4jSessionFactory.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/CDONet4jSessionFactory.java index eb58a21aa4..5a00217d1c 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/CDONet4jSessionFactory.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/CDONet4jSessionFactory.java @@ -26,7 +26,7 @@ import org.eclipse.emf.spi.cdo.InternalCDOSession; public class CDONet4jSessionFactory extends CDOSessionFactory { - public static final String TYPE = "cdo"; + public static final String TYPE = "cdo"; //$NON-NLS-1$ public CDONet4jSessionFactory() { diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/FailOverStrategyInjector.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/FailOverStrategyInjector.java index d647246a3b..4f87b4a266 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/FailOverStrategyInjector.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/FailOverStrategyInjector.java @@ -10,6 +10,8 @@ **************************************************************************/ package org.eclipse.emf.internal.cdo.net4j; +import org.eclipse.emf.cdo.messages.Messages; + import org.eclipse.net4j.connector.IConnector; import org.eclipse.net4j.signal.failover.NOOPFailOverStrategy; import org.eclipse.net4j.util.StringUtil; @@ -18,12 +20,16 @@ import org.eclipse.net4j.util.container.IManagedContainer; import org.eclipse.spi.net4j.ConnectorFactory; +import java.text.MessageFormat; + /** * @author Eike Stepper */ public class FailOverStrategyInjector implements IElementProcessor { - private static final String SCHEME_SEPARATOR = "://"; + private static final String INVALID_URI_MESSAGE = Messages.getString("InvalidURIException.0"); //$NON-NLS-1$ + + private static final String SCHEME_SEPARATOR = "://"; //$NON-NLS-1$ public FailOverStrategyInjector() { @@ -46,19 +52,22 @@ public class FailOverStrategyInjector implements IElementProcessor int pos = description.indexOf(SCHEME_SEPARATOR); if (pos == -1) { - throw new IllegalArgumentException("Invalid URI: " + description); + throw new IllegalArgumentException(MessageFormat.format(INVALID_URI_MESSAGE, description, + Messages.getString("FailOverStrategyInjector.0"))); //$NON-NLS-1$ } String factoryType = description.substring(0, pos); if (StringUtil.isEmpty(factoryType)) { - throw new IllegalArgumentException("Invalid URI: " + description); + throw new IllegalArgumentException(MessageFormat.format(INVALID_URI_MESSAGE, description, + Messages.getString("FailOverStrategyInjector.1"))); //$NON-NLS-1$ } String connectorDescription = description.substring(pos + SCHEME_SEPARATOR.length()); if (StringUtil.isEmpty(connectorDescription)) { - throw new IllegalArgumentException("Invalid URI: " + description); + throw new IllegalArgumentException(MessageFormat.format(INVALID_URI_MESSAGE, description, + Messages.getString("FailOverStrategyInjector.2"))); //$NON-NLS-1$ } pos = connectorDescription.indexOf('?'); diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CDOClientProtocol.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CDOClientProtocol.java index c08f8bb5a2..5dab60355d 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CDOClientProtocol.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CDOClientProtocol.java @@ -17,6 +17,7 @@ import org.eclipse.emf.cdo.common.model.CDOPackageUnit; import org.eclipse.emf.cdo.common.protocol.CDOProtocolConstants; import org.eclipse.emf.cdo.common.util.TransportException; import org.eclipse.emf.cdo.internal.common.protocol.CDOProtocolImpl; +import org.eclipse.emf.cdo.messages.Messages; import org.eclipse.emf.cdo.session.CDOSession; import org.eclipse.emf.cdo.session.remote.CDORemoteSession; import org.eclipse.emf.cdo.spi.common.model.InternalCDOPackageUnit; @@ -270,7 +271,7 @@ public class CDOClientProtocol extends CDOProtocolImpl implements CDOSessionProt super.doBeforeActivate(); if (!(getInfraStructure() instanceof CDOSession)) { - throw new IllegalStateException("No session"); + throw new IllegalStateException(Messages.getString("CDOClientProtocol.0")); //$NON-NLS-1$ } } diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CDOTimeRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CDOTimeRequest.java index 45b0528921..6622eb78b5 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CDOTimeRequest.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CDOTimeRequest.java @@ -46,7 +46,7 @@ public abstract class CDOTimeRequest<RESULT> extends CDOClientRequest<RESULT> repositoryTimeResult.setRequested(System.currentTimeMillis()); if (TRACER.isEnabled()) { - TRACER.format("Requested: {0,date} {0,time}", repositoryTimeResult.getRequested()); + TRACER.format("Requested: {0,date} {0,time}", repositoryTimeResult.getRequested()); //$NON-NLS-1$ } } @@ -56,19 +56,19 @@ public abstract class CDOTimeRequest<RESULT> extends CDOClientRequest<RESULT> repositoryTimeResult.setConfirmed(System.currentTimeMillis()); if (TRACER.isEnabled()) { - TRACER.format("Confirmed: {0,date} {0,time}", repositoryTimeResult.getConfirmed()); + TRACER.format("Confirmed: {0,date} {0,time}", repositoryTimeResult.getConfirmed()); //$NON-NLS-1$ } repositoryTimeResult.setIndicated(in.readLong()); if (TRACER.isEnabled()) { - TRACER.format("Read indicated: {0,date} {0,time}", repositoryTimeResult.getIndicated()); + TRACER.format("Read indicated: {0,date} {0,time}", repositoryTimeResult.getIndicated()); //$NON-NLS-1$ } repositoryTimeResult.setResponded(in.readLong()); if (TRACER.isEnabled()) { - TRACER.format("Read responded: {0,date} {0,time}", repositoryTimeResult.getResponded()); + TRACER.format("Read responded: {0,date} {0,time}", repositoryTimeResult.getResponded()); //$NON-NLS-1$ } return null; diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/ChangeSubscriptionRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/ChangeSubscriptionRequest.java index 1c6e60c08a..969c31b8ba 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/ChangeSubscriptionRequest.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/ChangeSubscriptionRequest.java @@ -58,7 +58,7 @@ public class ChangeSubscriptionRequest extends CDOClientRequest<Boolean> { if (TRACER.isEnabled()) { - TRACER.trace("View " + viewID + " subscribing to " + cdoIDs.size()); + TRACER.trace("View " + viewID + " subscribing to " + cdoIDs.size()); //$NON-NLS-1$ //$NON-NLS-2$ } out.writeInt(viewID); diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitNotificationIndication.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitNotificationIndication.java index a47030a1e3..02e39744e0 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitNotificationIndication.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitNotificationIndication.java @@ -51,7 +51,7 @@ public class CommitNotificationIndication extends CDOClientIndication long timeStamp = in.readLong(); if (TRACER.isEnabled()) { - TRACER.format("Read timeStamp: {0,date} {0,time}", timeStamp); + TRACER.format("Read timeStamp: {0,date} {0,time}", timeStamp); //$NON-NLS-1$ } CDOPackageUnit[] packageUnits = in.readCDOPackageUnits(null); @@ -64,7 +64,7 @@ public class CommitNotificationIndication extends CDOClientIndication int size = in.readInt(); if (TRACER.isEnabled()) { - TRACER.format("Reading {0} dirty IDs", size); + TRACER.format("Reading {0} dirty IDs", size); //$NON-NLS-1$ } InternalCDOSession session = getSession(); @@ -74,7 +74,7 @@ public class CommitNotificationIndication extends CDOClientIndication CDOIDAndVersion dirtyOID = in.readCDOIDAndVersion(); if (TRACER.isEnabled()) { - TRACER.format("Read dirty ID: {0}", dirtyOID); + TRACER.format("Read dirty ID: {0}", dirtyOID); //$NON-NLS-1$ } dirtyOIDs.add(dirtyOID); @@ -83,7 +83,7 @@ public class CommitNotificationIndication extends CDOClientIndication size = in.readInt(); if (TRACER.isEnabled()) { - TRACER.format("Reading {0} Deltas", size); + TRACER.format("Reading {0} Deltas", size); //$NON-NLS-1$ } List<CDORevisionDelta> deltas = new ArrayList<CDORevisionDelta>(); @@ -96,7 +96,7 @@ public class CommitNotificationIndication extends CDOClientIndication size = in.readInt(); if (TRACER.isEnabled()) { - TRACER.format("Reading {0} Detach Objects", size); + TRACER.format("Reading {0} Detach Objects", size); //$NON-NLS-1$ } List<CDOID> detachedObjects = new ArrayList<CDOID>(); diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitTransactionPhase2Request.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitTransactionPhase2Request.java index a79313e2c2..786d389df8 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitTransactionPhase2Request.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitTransactionPhase2Request.java @@ -16,6 +16,7 @@ import org.eclipse.emf.cdo.common.io.CDODataInput; import org.eclipse.emf.cdo.common.io.CDODataOutput; import org.eclipse.emf.cdo.common.protocol.CDOProtocolConstants; import org.eclipse.emf.cdo.internal.common.id.CDOIDExternalTempImpl; +import org.eclipse.emf.cdo.messages.Messages; import org.eclipse.emf.cdo.util.CDOURIUtil; import org.eclipse.emf.internal.cdo.bundle.OM; @@ -29,6 +30,7 @@ import org.eclipse.emf.spi.cdo.CDOSessionProtocol.CommitTransactionResult; import org.eclipse.emf.spi.cdo.InternalCDOXATransaction.InternalCDOXACommitContext; import java.io.IOException; +import java.text.MessageFormat; import java.util.Map; import java.util.Map.Entry; @@ -80,7 +82,7 @@ public class CommitTransactionPhase2Request extends CommitTransactionRequest out.writeInt(size); if (PROTOCOL.isEnabled()) { - PROTOCOL.format("Number of ids requested: {0}", size); + PROTOCOL.format("Number of ids requested: {0}", size); //$NON-NLS-1$ } for (Entry<CDOIDExternalTempImpl, InternalCDOTransaction> entry : requestedIDs.entrySet()) @@ -92,20 +94,23 @@ public class CommitTransactionPhase2Request extends CommitTransactionRequest InternalCDOXACommitContext commitContext = context.getTransactionManager().getCommitContext(entry.getValue()); if (commitContext == null) { - throw new IllegalStateException("Missing informations. " + entry.getValue() + " isn't involved in the commit."); + throw new IllegalStateException(MessageFormat.format( + Messages.getString("CommitTransactionPhase2Request.1"), entry //$NON-NLS-1$ + .getValue())); } CDOID newID = commitContext.getResult().getIDMappings().get(oldCDOID); if (newID == null) { - throw new IllegalStateException("Missing informations. " + oldCDOID.toURIFragment() - + " isn't mapped in the commit."); + throw new IllegalStateException(MessageFormat.format( + Messages.getString("CommitTransactionPhase2Request.2"), oldCDOID //$NON-NLS-1$ + .toURIFragment())); } CDOID newIDExternal = CDOURIUtil.convertExternalCDOID(oldURIExternal, newID); if (PROTOCOL.isEnabled()) { - PROTOCOL.format("ID mapping: {0} --> {1}", tempID.toURIFragment(), newIDExternal.toURIFragment()); + PROTOCOL.format("ID mapping: {0} --> {1}", tempID.toURIFragment(), newIDExternal.toURIFragment()); //$NON-NLS-1$ } out.writeCDOID(tempID); out.writeCDOID(newIDExternal); diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitTransactionRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitTransactionRequest.java index 876fa6e56b..78c90c378e 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitTransactionRequest.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitTransactionRequest.java @@ -192,7 +192,7 @@ public class CommitTransactionRequest extends RequestWithMonitoring<CommitTransa if (TRACER.isEnabled()) { - TRACER.format("Writing {0} new package units", newPackageUnits.size()); + TRACER.format("Writing {0} new package units", newPackageUnits.size()); //$NON-NLS-1$ } for (CDOPackageUnit newPackageUnit : newPackageUnits) @@ -202,7 +202,7 @@ public class CommitTransactionRequest extends RequestWithMonitoring<CommitTransa if (TRACER.isEnabled()) { - TRACER.format("Writing {0} new objects", newResources.size() + newObjects.size()); + TRACER.format("Writing {0} new objects", newResources.size() + newObjects.size()); //$NON-NLS-1$ } writeRevisions(out, newResources); @@ -210,7 +210,7 @@ public class CommitTransactionRequest extends RequestWithMonitoring<CommitTransa if (TRACER.isEnabled()) { - TRACER.format("Writing {0} dirty objects", revisionDeltas.size()); + TRACER.format("Writing {0} dirty objects", revisionDeltas.size()); //$NON-NLS-1$ } for (CDORevisionDelta revisionDelta : revisionDeltas) diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/GetRemoteSessionsRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/GetRemoteSessionsRequest.java index 7656b44c91..c3753dfe28 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/GetRemoteSessionsRequest.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/GetRemoteSessionsRequest.java @@ -48,7 +48,7 @@ public class GetRemoteSessionsRequest extends CDOClientRequest<List<CDORemoteSes { if (TRACER.isEnabled()) { - TRACER.format("Writing subscribe: {0}", subscribe); + TRACER.format("Writing subscribe: {0}", subscribe); //$NON-NLS-1$ } out.writeBoolean(subscribe); diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadChunkRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadChunkRequest.java index 50b30dfb5d..4e293822b9 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadChunkRequest.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadChunkRequest.java @@ -64,7 +64,7 @@ public class LoadChunkRequest extends CDOClientRequest<Object> CDOID id = revision.getID(); if (TRACER.isEnabled()) { - TRACER.format("Writing revision ID: {0}", id); + TRACER.format("Writing revision ID: {0}", id); //$NON-NLS-1$ } out.writeCDOID(id); @@ -76,26 +76,26 @@ public class LoadChunkRequest extends CDOClientRequest<Object> if (TRACER.isEnabled()) { - TRACER.format("Writing revision version: {0}", version); + TRACER.format("Writing revision version: {0}", version); //$NON-NLS-1$ } out.writeInt(version); if (TRACER.isEnabled()) { - TRACER.format("Writing feature: {0}", feature); + TRACER.format("Writing feature: {0}", feature); //$NON-NLS-1$ } out.writeCDOClassifierRef(feature.getEContainingClass()); out.writeInt(feature.getFeatureID()); if (TRACER.isEnabled()) { - TRACER.format("Writing fromIndex: {0}", fromIndex); + TRACER.format("Writing fromIndex: {0}", fromIndex); //$NON-NLS-1$ } int diffIndex = accessIndex - fetchIndex; out.writeInt(fromIndex - diffIndex); if (TRACER.isEnabled()) { - TRACER.format("Writing toIndex: {0}", toIndex); + TRACER.format("Writing toIndex: {0}", toIndex); //$NON-NLS-1$ } out.writeInt(toIndex - diffIndex); diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadLibrariesRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadLibrariesRequest.java index 162bbec6a8..4db958e6d9 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadLibrariesRequest.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadLibrariesRequest.java @@ -48,7 +48,7 @@ public class LoadLibrariesRequest extends RequestWithConfirmation<Integer> int size = libraryNames.size(); if (TRACER.isEnabled()) { - TRACER.format("Writing {0} library names", size); + TRACER.format("Writing {0} library names", size); //$NON-NLS-1$ } out.writeInt(size); @@ -56,7 +56,7 @@ public class LoadLibrariesRequest extends RequestWithConfirmation<Integer> { if (TRACER.isEnabled()) { - TRACER.format("Writing library name: {0}", libraryName); + TRACER.format("Writing library name: {0}", libraryName); //$NON-NLS-1$ } out.writeString(libraryName); @@ -73,7 +73,7 @@ public class LoadLibrariesRequest extends RequestWithConfirmation<Integer> int size = in.readInt(); if (TRACER.isEnabled()) { - TRACER.format("Reading library {0}: {1} bytes", libraryName, size); + TRACER.format("Reading library {0}: {1} bytes", libraryName, size); //$NON-NLS-1$ } File file = new File(cacheFolder, libraryName); diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadPackagesRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadPackagesRequest.java index e3eee6a65b..710eb488f8 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadPackagesRequest.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadPackagesRequest.java @@ -46,7 +46,7 @@ public class LoadPackagesRequest extends CDOClientRequest<EPackage[]> String packageUnitID = packageUnit.getID(); if (TRACER.isEnabled()) { - TRACER.format("Writing packageUnitID: {0}", packageUnitID); + TRACER.format("Writing packageUnitID: {0}", packageUnitID); //$NON-NLS-1$ } out.writeCDOPackageURI(packageUnitID); diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadRevisionByTimeRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadRevisionByTimeRequest.java index ccfcacf6ba..92c49d391e 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadRevisionByTimeRequest.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadRevisionByTimeRequest.java @@ -43,7 +43,7 @@ public class LoadRevisionByTimeRequest extends LoadRevisionRequest super.requesting(out); if (TRACER.isEnabled()) { - TRACER.format("Writing timeStamp: {0}", timeStamp); + TRACER.format("Writing timeStamp: {0}", timeStamp); //$NON-NLS-1$ } out.writeLong(timeStamp); @@ -52,7 +52,7 @@ public class LoadRevisionByTimeRequest extends LoadRevisionRequest @Override public String toString() { - return MessageFormat.format("{0}(ids={1}, referenceChunk={2}, timeStamp={3})", getClass().getSimpleName(), + return MessageFormat.format("{0}(ids={1}, referenceChunk={2}, timeStamp={3})", getClass().getSimpleName(), //$NON-NLS-1$ getIds(), getReferenceChunk(), timeStamp); } } diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadRevisionByVersionRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadRevisionByVersionRequest.java index 16dfcbc779..ddea39b4c8 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadRevisionByVersionRequest.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadRevisionByVersionRequest.java @@ -43,7 +43,7 @@ public class LoadRevisionByVersionRequest extends LoadRevisionRequest super.requesting(out); if (TRACER.isEnabled()) { - TRACER.format("Writing version: {0}", version); + TRACER.format("Writing version: {0}", version); //$NON-NLS-1$ } out.writeInt(version); @@ -52,7 +52,7 @@ public class LoadRevisionByVersionRequest extends LoadRevisionRequest @Override public String toString() { - return MessageFormat.format("{0}(ids={1}, referenceChunk={2}, version={3})", getClass().getSimpleName(), getIds(), + return MessageFormat.format("{0}(ids={1}, referenceChunk={2}, version={3})", getClass().getSimpleName(), getIds(), //$NON-NLS-1$ getReferenceChunk(), version); } } diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadRevisionRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadRevisionRequest.java index 69638a96df..853dde03a2 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadRevisionRequest.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadRevisionRequest.java @@ -57,13 +57,13 @@ public class LoadRevisionRequest extends CDOClientRequest<List<InternalCDORevisi { if (TRACER.isEnabled()) { - TRACER.format("Writing referenceChunk: {0}", referenceChunk); + TRACER.format("Writing referenceChunk: {0}", referenceChunk); //$NON-NLS-1$ } out.writeInt(referenceChunk); if (TRACER.isEnabled()) { - TRACER.format("Writing {0} IDs", ids.size()); + TRACER.format("Writing {0} IDs", ids.size()); //$NON-NLS-1$ } out.writeInt(ids.size()); @@ -71,7 +71,7 @@ public class LoadRevisionRequest extends CDOClientRequest<List<InternalCDORevisi { if (TRACER.isEnabled()) { - TRACER.format("Writing ID: {0}", id); + TRACER.format("Writing ID: {0}", id); //$NON-NLS-1$ } out.writeCDOID(id); @@ -108,7 +108,7 @@ public class LoadRevisionRequest extends CDOClientRequest<List<InternalCDORevisi ArrayList<InternalCDORevision> revisions = new ArrayList<InternalCDORevision>(idSize); if (TRACER.isEnabled()) { - TRACER.format("Reading {0} revisions", idSize); + TRACER.format("Reading {0} revisions", idSize); //$NON-NLS-1$ } for (int i = 0; i < idSize; i++) @@ -122,7 +122,7 @@ public class LoadRevisionRequest extends CDOClientRequest<List<InternalCDORevisi { if (TRACER.isEnabled()) { - TRACER.format("Reading {0} additional revisions", additionalSize); + TRACER.format("Reading {0} additional revisions", additionalSize); //$NON-NLS-1$ } CDORevisionManagerImpl revisionManager = (CDORevisionManagerImpl)getSession().getRevisionManager(); @@ -152,6 +152,6 @@ public class LoadRevisionRequest extends CDOClientRequest<List<InternalCDORevisi @Override public String toString() { - return MessageFormat.format("{0}(ids={1}, referenceChunk={2})", getClass().getSimpleName(), ids, referenceChunk); + return MessageFormat.format("{0}(ids={1}, referenceChunk={2})", getClass().getSimpleName(), ids, referenceChunk); //$NON-NLS-1$ } } diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LockObjectsRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LockObjectsRequest.java index 93dab154e6..2002179965 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LockObjectsRequest.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LockObjectsRequest.java @@ -58,8 +58,8 @@ public class LockObjectsRequest extends CDOClientRequest<Object> if (TRACER.isEnabled()) { - TRACER.format("Locking of type {0} requested for view {1} with timeout {2}", - lockType == RWLockManager.LockType.READ ? "read" : "write", view.getViewID(), timeout); + TRACER.format("Locking of type {0} requested for view {1} with timeout {2}", //$NON-NLS-1$ + lockType == RWLockManager.LockType.READ ? "read" : "write", view.getViewID(), timeout); //$NON-NLS-1$ //$NON-NLS-2$ } out.writeInt(objects.size()); @@ -67,7 +67,7 @@ public class LockObjectsRequest extends CDOClientRequest<Object> { if (TRACER.isEnabled()) { - TRACER.format("Locking requested for objects {0}", object.cdoID()); + TRACER.format("Locking requested for objects {0}", object.cdoID()); //$NON-NLS-1$ } out.writeCDOID(object.cdoID()); diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/ObjectLockedRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/ObjectLockedRequest.java index e49ef644dd..3863b357c9 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/ObjectLockedRequest.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/ObjectLockedRequest.java @@ -53,8 +53,8 @@ public class ObjectLockedRequest extends CDOClientRequest<Boolean> { if (TRACER.isEnabled()) { - TRACER.format("Requesting if object {0} has of lock for object {1}", object.cdoID(), - lockType == RWLockManager.LockType.READ ? "read" : "write"); + TRACER.format("Requesting if object {0} has of lock for object {1}", object.cdoID(), //$NON-NLS-1$ + lockType == RWLockManager.LockType.READ ? "read" : "write"); //$NON-NLS-1$ //$NON-NLS-2$ } out.writeInt(view.getViewID()); diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/OpenSessionRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/OpenSessionRequest.java index 3ca4a4814e..5a5b610b1b 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/OpenSessionRequest.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/OpenSessionRequest.java @@ -17,6 +17,7 @@ import org.eclipse.emf.cdo.common.io.CDODataInput; import org.eclipse.emf.cdo.common.io.CDODataOutput; import org.eclipse.emf.cdo.common.model.CDOPackageUnit; import org.eclipse.emf.cdo.common.protocol.CDOProtocolConstants; +import org.eclipse.emf.cdo.messages.Messages; import org.eclipse.emf.cdo.spi.common.model.InternalCDOPackageUnit; import org.eclipse.emf.cdo.util.ServerException; @@ -55,14 +56,14 @@ public class OpenSessionRequest extends CDOTimeRequest<OpenSessionResult> super.requesting(out); if (TRACER.isEnabled()) { - TRACER.format("Writing repositoryName: {0}", repositoryName); + TRACER.format("Writing repositoryName: {0}", repositoryName); //$NON-NLS-1$ } out.writeString(repositoryName); if (TRACER.isEnabled()) { - TRACER.format("Writing passiveUpdateEnabled: {0}", passiveUpdateEnabled); + TRACER.format("Writing passiveUpdateEnabled: {0}", passiveUpdateEnabled); //$NON-NLS-1$ } out.writeBoolean(passiveUpdateEnabled); @@ -74,43 +75,43 @@ public class OpenSessionRequest extends CDOTimeRequest<OpenSessionResult> int sessionID = in.readInt(); if (sessionID == CDOProtocolConstants.ERROR_REPOSITORY_NOT_FOUND) { - String msg = MessageFormat.format("Repository {0} not found", repositoryName); + String msg = MessageFormat.format(Messages.getString("OpenSessionRequest.0"), repositoryName); //$NON-NLS-1$ throw new ServerException(msg); } if (sessionID == CDOProtocolConstants.ERROR_NO_SESSION) { - String msg = MessageFormat.format("Failed to open session for repository {0}", repositoryName); + String msg = MessageFormat.format(Messages.getString("OpenSessionRequest.3"), repositoryName); //$NON-NLS-1$ throw new ServerException(msg); } if (TRACER.isEnabled()) { - TRACER.format("Read sessionID: {0}", sessionID); + TRACER.format("Read sessionID: {0}", sessionID); //$NON-NLS-1$ } String repositoryUUID = in.readString(); if (TRACER.isEnabled()) { - TRACER.format("Read repositoryUUID: {0}", repositoryUUID); + TRACER.format("Read repositoryUUID: {0}", repositoryUUID); //$NON-NLS-1$ } long repositoryCreationTime = in.readLong(); if (TRACER.isEnabled()) { - TRACER.format("Read repositoryCreationTime: {0,date} {0,time}", repositoryCreationTime); + TRACER.format("Read repositoryCreationTime: {0,date} {0,time}", repositoryCreationTime); //$NON-NLS-1$ } boolean repositorySupportingAudits = in.readBoolean(); if (TRACER.isEnabled()) { - TRACER.format("Read repositorySupportingAudits: {0}", repositorySupportingAudits); + TRACER.format("Read repositorySupportingAudits: {0}", repositorySupportingAudits); //$NON-NLS-1$ } CDOIDLibraryDescriptor libraryDescriptor = CDOIDUtil.readLibraryDescriptor(in); if (TRACER.isEnabled()) { - TRACER.format("Read libraryDescriptor: {0}", libraryDescriptor); + TRACER.format("Read libraryDescriptor: {0}", libraryDescriptor); //$NON-NLS-1$ } result = new OpenSessionResult(sessionID, repositoryUUID, repositoryCreationTime, repositorySupportingAudits, diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/QueryCancelRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/QueryCancelRequest.java index aa77ff354f..b3bf7caf5c 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/QueryCancelRequest.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/QueryCancelRequest.java @@ -41,7 +41,7 @@ public class QueryCancelRequest extends CDOClientRequest<Boolean> { if (TRACER.isEnabled()) { - TRACER.trace("Cancel query " + queryID); + TRACER.trace("Cancel query " + queryID); //$NON-NLS-1$ } out.writeInt(queryID); diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/QueryRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/QueryRequest.java index d9752e46d1..a62e821899 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/QueryRequest.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/QueryRequest.java @@ -75,7 +75,7 @@ public class QueryRequest extends CDOClientRequest<List<Object>> if (TRACER.isEnabled()) { - TRACER.format("Query executed [{0} elements received]", numberOfObjectsReceived); + TRACER.format("Query executed [{0} elements received]", numberOfObjectsReceived); //$NON-NLS-1$ } } catch (RuntimeException ex) diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/ResourceIDRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/ResourceIDRequest.java index 42d5ae513f..1937f58974 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/ResourceIDRequest.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/ResourceIDRequest.java @@ -44,13 +44,13 @@ public class ResourceIDRequest extends CDOClientRequest<CDOID> { if (TRACER.isEnabled()) { - TRACER.format("Writing viewID: {0}", viewID); + TRACER.format("Writing viewID: {0}", viewID); //$NON-NLS-1$ } out.writeInt(viewID); if (TRACER.isEnabled()) { - TRACER.format("Writing path: {0}", path); + TRACER.format("Writing path: {0}", path); //$NON-NLS-1$ } out.writeString(path); @@ -62,7 +62,7 @@ public class ResourceIDRequest extends CDOClientRequest<CDOID> CDOID id = in.readCDOID(); if (TRACER.isEnabled()) { - TRACER.format("Read ID: {0}", id); + TRACER.format("Read ID: {0}", id); //$NON-NLS-1$ } return id; diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/SetAuditRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/SetAuditRequest.java index 9095430692..178c22ef74 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/SetAuditRequest.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/SetAuditRequest.java @@ -49,13 +49,13 @@ public class SetAuditRequest extends CDOClientRequest<boolean[]> { if (TRACER.isEnabled()) { - TRACER.format("Writing viewID: {0}", viewID); + TRACER.format("Writing viewID: {0}", viewID); //$NON-NLS-1$ } out.writeInt(viewID); if (TRACER.isEnabled()) { - TRACER.format("Writing timeStamp: {0,date} {0,time}", timeStamp); + TRACER.format("Writing timeStamp: {0,date} {0,time}", timeStamp); //$NON-NLS-1$ } out.writeLong(timeStamp); @@ -63,7 +63,7 @@ public class SetAuditRequest extends CDOClientRequest<boolean[]> int size = invalidObjects.size(); if (TRACER.isEnabled()) { - TRACER.format("Writing {0} IDs", size); + TRACER.format("Writing {0} IDs", size); //$NON-NLS-1$ } out.writeInt(size); @@ -71,7 +71,7 @@ public class SetAuditRequest extends CDOClientRequest<boolean[]> { if (TRACER.isEnabled()) { - TRACER.format("Writing ID: {0}", object.cdoID()); + TRACER.format("Writing ID: {0}", object.cdoID()); //$NON-NLS-1$ } out.writeCDOID(object.cdoID()); @@ -84,7 +84,7 @@ public class SetAuditRequest extends CDOClientRequest<boolean[]> int size = in.readInt(); if (TRACER.isEnabled()) { - TRACER.format("Reading {0} existanceFlags", size); + TRACER.format("Reading {0} existanceFlags", size); //$NON-NLS-1$ } boolean[] existanceFlags = new boolean[size]; @@ -94,7 +94,7 @@ public class SetAuditRequest extends CDOClientRequest<boolean[]> existanceFlags[i] = existanceFlag; if (TRACER.isEnabled()) { - TRACER.format("Read existanceFlag: {0}", existanceFlag); + TRACER.format("Read existanceFlag: {0}", existanceFlag); //$NON-NLS-1$ } } diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/SetPassiveUpdateRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/SetPassiveUpdateRequest.java index 16dc05575a..18545f7ff0 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/SetPassiveUpdateRequest.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/SetPassiveUpdateRequest.java @@ -45,7 +45,7 @@ public class SetPassiveUpdateRequest extends SyncRevisionsRequest { if (TRACER.isEnabled()) { - TRACER.trace("Turning " + (passiveUpdateEnabled ? "on" : "off") + " passive update"); + TRACER.trace("Turning " + (passiveUpdateEnabled ? "on" : "off") + " passive update"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ } super.requesting(out); diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/SyncRevisionsRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/SyncRevisionsRequest.java index 80277cc685..ef75bc11c9 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/SyncRevisionsRequest.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/SyncRevisionsRequest.java @@ -19,6 +19,7 @@ import org.eclipse.emf.cdo.common.io.CDODataOutput; import org.eclipse.emf.cdo.common.model.CDOPackageUnit; import org.eclipse.emf.cdo.common.protocol.CDOProtocolConstants; import org.eclipse.emf.cdo.common.revision.CDORevision; +import org.eclipse.emf.cdo.messages.Messages; import org.eclipse.emf.cdo.spi.common.revision.InternalCDORevision; import org.eclipse.emf.cdo.transaction.CDOTimeStampContext; @@ -29,6 +30,7 @@ import org.eclipse.emf.internal.cdo.transaction.CDOTimeStampContextImpl; import org.eclipse.net4j.util.om.trace.ContextTracer; import java.io.IOException; +import java.text.MessageFormat; import java.util.Collection; import java.util.Collections; import java.util.Map; @@ -65,7 +67,7 @@ public class SyncRevisionsRequest extends CDOClientRequest<Collection<CDOTimeSta { if (TRACER.isEnabled()) { - TRACER.trace("Synchronization " + idAndVersions.size() + " objects"); + TRACER.trace("Synchronization " + idAndVersions.size() + " objects"); //$NON-NLS-1$ //$NON-NLS-2$ } out.writeInt(referenceChunk); @@ -92,7 +94,8 @@ public class SyncRevisionsRequest extends CDOClientRequest<Collection<CDOTimeSta CDOIDAndVersion idAndVersion = idAndVersions.get(revision.getID()); if (idAndVersion == null) { - throw new IllegalStateException("Didn't expect to receive object with id '" + revision.getID() + "'"); + throw new IllegalStateException(MessageFormat.format( + Messages.getString("SyncRevisionsRequest.2"), revision.getID())); //$NON-NLS-1$ } Set<CDOIDAndVersion> dirtyObjects = getMap(mapofContext, revised).getDirtyObjects(); @@ -102,7 +105,7 @@ public class SyncRevisionsRequest extends CDOClientRequest<Collection<CDOTimeSta if (TRACER.isEnabled()) { - TRACER.trace("Synchronization received " + size + " dirty objects"); + TRACER.trace("Synchronization received " + size + " dirty objects"); //$NON-NLS-1$ //$NON-NLS-2$ } size = in.readInt(); diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/UnlockObjectsRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/UnlockObjectsRequest.java index 5fc6e4ecd1..abe74b88bd 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/UnlockObjectsRequest.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/UnlockObjectsRequest.java @@ -55,7 +55,7 @@ public class UnlockObjectsRequest extends CDOClientRequest<Boolean> { if (TRACER.isEnabled()) { - TRACER.format("Unlocking all objects for view {0}", view.getViewID()); + TRACER.format("Unlocking all objects for view {0}", view.getViewID()); //$NON-NLS-1$ } out.writeInt(CDOProtocolConstants.RELEASE_ALL_LOCKS); @@ -64,8 +64,8 @@ public class UnlockObjectsRequest extends CDOClientRequest<Boolean> { if (TRACER.isEnabled()) { - TRACER.format("Unlocking of type {0} requested for view {1}", lockType == RWLockManager.LockType.READ ? "read" - : "write", view.getViewID()); + TRACER.format("Unlocking of type {0} requested for view {1}", lockType == RWLockManager.LockType.READ ? "read" //$NON-NLS-1$ //$NON-NLS-2$ + : "write", view.getViewID()); //$NON-NLS-1$ } out.writeInt(objects.size()); @@ -73,7 +73,7 @@ public class UnlockObjectsRequest extends CDOClientRequest<Boolean> { if (TRACER.isEnabled()) { - TRACER.format("Unlocking requested for objects {0}", object.cdoID()); + TRACER.format("Unlocking requested for objects {0}", object.cdoID()); //$NON-NLS-1$ } out.writeCDOID(object.cdoID()); diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/UnsubscribeRemoteSessionsRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/UnsubscribeRemoteSessionsRequest.java index 17722b2ec2..cdb38e098f 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/UnsubscribeRemoteSessionsRequest.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/UnsubscribeRemoteSessionsRequest.java @@ -38,7 +38,7 @@ public class UnsubscribeRemoteSessionsRequest extends CDOClientRequest<Boolean> { if (TRACER.isEnabled()) { - TRACER.trace("Unsubscribing"); + TRACER.trace("Unsubscribing"); //$NON-NLS-1$ } } diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/VerifyRevisionRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/VerifyRevisionRequest.java index 71f9471490..93c1bfb49a 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/VerifyRevisionRequest.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/VerifyRevisionRequest.java @@ -52,7 +52,7 @@ public class VerifyRevisionRequest extends CDOClientRequest<List<InternalCDORevi { if (TRACER.isEnabled()) { - TRACER.format("Writing {0} IDs and versions", revisions.size()); + TRACER.format("Writing {0} IDs and versions", revisions.size()); //$NON-NLS-1$ } out.writeInt(revisions.size()); @@ -62,7 +62,7 @@ public class VerifyRevisionRequest extends CDOClientRequest<List<InternalCDORevi int version = revision.getVersion(); if (TRACER.isEnabled()) { - TRACER.format("Writing ID and version: {0}v{1}", id, version); + TRACER.format("Writing ID and version: {0}v{1}", id, version); //$NON-NLS-1$ } out.writeCDOID(id); @@ -76,7 +76,7 @@ public class VerifyRevisionRequest extends CDOClientRequest<List<InternalCDORevi ArrayList<InternalCDORevision> result = new ArrayList<InternalCDORevision>(); if (TRACER.isEnabled()) { - TRACER.format("Reading {0} timeStamps", revisions.size()); + TRACER.format("Reading {0} timeStamps", revisions.size()); //$NON-NLS-1$ } for (InternalCDORevision revision : revisions) @@ -84,7 +84,7 @@ public class VerifyRevisionRequest extends CDOClientRequest<List<InternalCDORevi long revised = in.readLong(); if (TRACER.isEnabled()) { - TRACER.format("Reading timeStamp: {0}", revised); + TRACER.format("Reading timeStamp: {0}", revised); //$NON-NLS-1$ } if (revised != CDORevision.UNSPECIFIED_DATE) diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/query/CDOQueryImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/query/CDOQueryImpl.java index afbbbe1cf0..9616aa2ce5 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/query/CDOQueryImpl.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/query/CDOQueryImpl.java @@ -14,6 +14,7 @@ package org.eclipse.emf.internal.cdo.query; import org.eclipse.emf.cdo.common.id.CDOID; import org.eclipse.emf.cdo.common.util.BlockingCloseableIterator; import org.eclipse.emf.cdo.internal.common.CDOQueryInfoImpl; +import org.eclipse.emf.cdo.messages.Messages; import org.eclipse.emf.cdo.view.CDOQuery; import org.eclipse.emf.internal.cdo.util.FSMUtil; @@ -32,6 +33,7 @@ import java.util.Map.Entry; */ public class CDOQueryImpl extends CDOQueryInfoImpl implements CDOQuery { + private static final String OBJECT_NOT_PERSISTED_MESSAGE = Messages.getString("CDOQueryImpl.0"); //$NON-NLS-1$ private InternalCDOView view; public CDOQueryImpl(InternalCDOView view, String queryLanguage, String queryString) @@ -138,12 +140,12 @@ public class CDOQueryImpl extends CDOQueryInfoImpl implements CDOQuery InternalCDOObject internalCDOObject = FSMUtil.adapt(object, view); if (internalCDOObject.cdoID() == null) { - throw new UnsupportedOperationException("Object not persisted"); + throw new UnsupportedOperationException(OBJECT_NOT_PERSISTED_MESSAGE); } if (internalCDOObject.cdoID().isTemporary()) { - throw new UnsupportedOperationException("Object not persisted"); + throw new UnsupportedOperationException(OBJECT_NOT_PERSISTED_MESSAGE); } return internalCDOObject.cdoID(); diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/revision/CDOElementProxyImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/revision/CDOElementProxyImpl.java index 3f61de4900..622a9de61d 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/revision/CDOElementProxyImpl.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/revision/CDOElementProxyImpl.java @@ -51,6 +51,6 @@ public final class CDOElementProxyImpl implements CDOElementProxy @Override public String toString() { - return MessageFormat.format("CDOElementProxy[{0}]", index); + return MessageFormat.format("CDOElementProxy[{0}]", index); //$NON-NLS-1$ } } diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionConfigurationImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionConfigurationImpl.java index e932e31c9c..ee9676451a 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionConfigurationImpl.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionConfigurationImpl.java @@ -12,6 +12,7 @@ package org.eclipse.emf.internal.cdo.session; import org.eclipse.emf.cdo.common.model.CDOPackageRegistry; import org.eclipse.emf.cdo.common.revision.cache.CDORevisionCache; +import org.eclipse.emf.cdo.messages.Messages; import org.eclipse.emf.cdo.session.CDOSession; import org.eclipse.emf.cdo.session.CDOSessionConfiguration; import org.eclipse.emf.cdo.spi.common.model.InternalCDOPackageRegistry; @@ -134,7 +135,7 @@ public abstract class CDOSessionConfigurationImpl implements CDOSessionConfigura { if (isSessionOpen()) { - throw new IllegalStateException("Session is already open"); + throw new IllegalStateException(Messages.getString("CDOSessionConfigurationImpl.0")); //$NON-NLS-1$ } } diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionFactory.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionFactory.java index 990ac35e1b..ef9c87cef0 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionFactory.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionFactory.java @@ -10,6 +10,7 @@ */ package org.eclipse.emf.internal.cdo.session; +import org.eclipse.emf.cdo.messages.Messages; import org.eclipse.emf.cdo.session.CDOSession; import org.eclipse.net4j.util.StringUtil; @@ -19,6 +20,7 @@ import org.eclipse.emf.spi.cdo.InternalCDOSession; import java.net.URI; import java.net.URISyntaxException; +import java.text.MessageFormat; import java.util.HashMap; import java.util.Map; import java.util.StringTokenizer; @@ -28,7 +30,7 @@ import java.util.StringTokenizer; */ public abstract class CDOSessionFactory extends Factory { - public static final String PRODUCT_GROUP = "org.eclipse.emf.cdo.sessions"; + public static final String PRODUCT_GROUP = "org.eclipse.emf.cdo.sessions"; //$NON-NLS-1$ private static final String TRUE = Boolean.TRUE.toString(); @@ -45,11 +47,11 @@ public abstract class CDOSessionFactory extends Factory String query = uri.getQuery(); if (StringUtil.isEmpty(query)) { - throw new IllegalArgumentException("Query is empty: " + description); + throw new IllegalArgumentException(MessageFormat.format(Messages.getString("CDOSessionFactory.1"), description)); //$NON-NLS-1$ } Map<String, String> result = new HashMap<String, String>(); - StringTokenizer tokenizer = new StringTokenizer(query, "&"); + StringTokenizer tokenizer = new StringTokenizer(query, "&"); //$NON-NLS-1$ while (tokenizer.hasMoreTokens()) { String parameter = tokenizer.nextToken(); @@ -59,7 +61,7 @@ public abstract class CDOSessionFactory extends Factory if (pos == -1) { String key = parameter.trim(); - result.put(key, ""); + result.put(key, ""); //$NON-NLS-1$ } else { @@ -70,8 +72,8 @@ public abstract class CDOSessionFactory extends Factory } } - String repositoryName = result.get("repositoryName"); - boolean automaticPackageRegistry = TRUE.equals(result.get("automaticPackageRegistry")); + String repositoryName = result.get("repositoryName"); //$NON-NLS-1$ + boolean automaticPackageRegistry = TRUE.equals(result.get("automaticPackageRegistry")); //$NON-NLS-1$ return createSession(repositoryName, automaticPackageRegistry); } catch (URISyntaxException ex) diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java index 120e91510e..176dacb19c 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java @@ -32,6 +32,7 @@ import org.eclipse.emf.cdo.common.revision.delta.CDORevisionDelta; import org.eclipse.emf.cdo.common.util.CDOException; import org.eclipse.emf.cdo.eresource.EresourcePackage; import org.eclipse.emf.cdo.internal.common.model.CDOPackageRegistryImpl; +import org.eclipse.emf.cdo.messages.Messages; import org.eclipse.emf.cdo.session.CDOCollectionLoadingPolicy; import org.eclipse.emf.cdo.session.CDOSession; import org.eclipse.emf.cdo.session.CDOSessionInvalidationEvent; @@ -222,7 +223,7 @@ public abstract class CDOSessionImpl extends Container<CDOView> implements Inter { if (!options().isGeneratedPackageEmulationEnabled()) { - throw new CDOException("Generated packages locally not available: " + packageUnit); + throw new CDOException(MessageFormat.format(Messages.getString("CDOSessionImpl.0"), packageUnit)); //$NON-NLS-1$ } } @@ -532,7 +533,7 @@ public abstract class CDOSessionImpl extends Container<CDOView> implements Inter @Override public String toString() { - return MessageFormat.format("CDOSession[{0}, {1}]", repository().getName(), sessionID); + return MessageFormat.format("CDOSession[{0}, {1}]", repository().getName(), sessionID); //$NON-NLS-1$ } /** @@ -596,8 +597,8 @@ public abstract class CDOSessionImpl extends Container<CDOView> implements Inter protected void doBeforeActivate() throws Exception { super.doBeforeActivate(); - checkState(getSessionProtocol(), "sessionProtocol"); - checkState(repository().getName(), "repository().getName()"); + checkState(getSessionProtocol(), "sessionProtocol"); //$NON-NLS-1$ + checkState(repository().getName(), "repository().getName()"); //$NON-NLS-1$ } @Override @@ -678,7 +679,7 @@ public abstract class CDOSessionImpl extends Container<CDOView> implements Inter String factoryName = libraryDescriptor.getFactoryName(); if (TRACER.isEnabled()) { - TRACER.format("Using CDOID factory: {0}", factoryName); + TRACER.format("Using CDOID factory: {0}", factoryName); //$NON-NLS-1$ } File cacheFolder = getCacheFolder(); @@ -705,10 +706,10 @@ public abstract class CDOSessionImpl extends Container<CDOView> implements Inter File lib = new File(cacheFolder, neededLibrary); if (TRACER.isEnabled()) { - TRACER.format("Using CDOID library: {0}", lib.getAbsolutePath()); + TRACER.format("Using CDOID library: {0}", lib.getAbsolutePath()); //$NON-NLS-1$ } - urls[i++] = new URL("file:///" + lib.getAbsolutePath()); + urls[i++] = new URL("file:///" + lib.getAbsolutePath()); //$NON-NLS-1$ } classLoader = new URLClassLoader(urls, classLoader); @@ -719,7 +720,7 @@ public abstract class CDOSessionImpl extends Container<CDOView> implements Inter private File getCacheFolder() { String stateLocation = OM.BUNDLE.getStateLocation(); - File repos = new File(stateLocation, "repos"); + File repos = new File(stateLocation, "repos"); //$NON-NLS-1$ return new File(repos, repository().getUUID()); } @@ -728,7 +729,7 @@ public abstract class CDOSessionImpl extends Container<CDOView> implements Inter Set<String> set = new HashSet<String>(); for (String fileName : fileNames) { - if (fileName.endsWith(".jar")) + if (fileName.endsWith(".jar")) //$NON-NLS-1$ { set.add(fileName); } @@ -759,7 +760,7 @@ public abstract class CDOSessionImpl extends Container<CDOView> implements Inter version = delta.getOriginVersion(); } } - + uniqueObjects.put(cdoId, CDOIDUtil.createIDAndVersion(cdoId, version)); } } @@ -911,7 +912,7 @@ public abstract class CDOSessionImpl extends Container<CDOView> implements Inter @Override public String toString() { - return "DefaultRevisionFactory"; + return "DefaultRevisionFactory"; //$NON-NLS-1$ } }; } @@ -1156,7 +1157,7 @@ public abstract class CDOSessionImpl extends Container<CDOView> implements Inter @Override public String toString() { - return "CDOSessionInvalidationEvent: " + dirtyOIDs; + return "CDOSessionInvalidationEvent: " + dirtyOIDs; //$NON-NLS-1$ } } } diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/remote/CDORemoteSessionImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/remote/CDORemoteSessionImpl.java index 4c7d71c41b..5ae1a5f204 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/remote/CDORemoteSessionImpl.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/remote/CDORemoteSessionImpl.java @@ -98,6 +98,6 @@ public class CDORemoteSessionImpl implements CDORemoteSession @Override public String toString() { - return MessageFormat.format("{0} ({1}", userID, sessionID); + return MessageFormat.format("{0} ({1}", userID, sessionID); //$NON-NLS-1$ } } diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOSingleTransactionStrategyImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOSingleTransactionStrategyImpl.java index b0a4a81e46..e6a957feaa 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOSingleTransactionStrategyImpl.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOSingleTransactionStrategyImpl.java @@ -46,7 +46,7 @@ public class CDOSingleTransactionStrategyImpl implements CDOTransactionStrategy InternalCDOCommitContext commitContext = transaction.createCommitContext(); if (TRACER.isEnabled()) { - TRACER.format("CDOCommitContext.preCommit"); + TRACER.format("CDOCommitContext.preCommit"); //$NON-NLS-1$ } commitContext.preCommit(); @@ -66,7 +66,7 @@ public class CDOSingleTransactionStrategyImpl implements CDOTransactionStrategy if (TRACER.isEnabled()) { - TRACER.format("CDOCommitContext.postCommit"); + TRACER.format("CDOCommitContext.postCommit"); //$NON-NLS-1$ } commitContext.postCommit(result); diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java index 0a6ba100f6..901728748d 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java @@ -33,6 +33,7 @@ import org.eclipse.emf.cdo.eresource.CDOResourceNode; import org.eclipse.emf.cdo.eresource.EresourceFactory; import org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl; import org.eclipse.emf.cdo.eresource.impl.CDOResourceNodeImpl; +import org.eclipse.emf.cdo.messages.Messages; import org.eclipse.emf.cdo.spi.common.model.InternalCDOPackageUnit; import org.eclipse.emf.cdo.spi.common.revision.InternalCDORevisionDelta; import org.eclipse.emf.cdo.transaction.CDOConflictResolver; @@ -388,7 +389,7 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa } else { - throw new CDOException("Not a ResourceFolder: " + node); + throw new CDOException(MessageFormat.format(Messages.getString("CDOTransactionImpl.0"), node)); //$NON-NLS-1$ } } @@ -495,7 +496,7 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa CDOID id = super.getRootOrTopLevelResourceNodeID(name); if (getLastSavepoint().getAllDetachedObjects().containsKey(id) || getDirtyObjects().containsKey(id)) { - throw new CDOException("Root resource node " + name + " doesn't exist"); + throw new CDOException(MessageFormat.format(Messages.getString("CDOTransactionImpl.1"), name)); //$NON-NLS-1$ } return id; @@ -559,7 +560,7 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa checkActive(); if (hasConflict()) { - throw new TransactionException("This transaction has conflicts"); + throw new TransactionException(Messages.getString("CDOTransactionImpl.2")); //$NON-NLS-1$ } if (progressMonitor == null) @@ -823,24 +824,24 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa { if (savepoint == null) { - throw new IllegalArgumentException("Save point is null"); + throw new IllegalArgumentException(Messages.getString("CDOTransactionImpl.3")); //$NON-NLS-1$ } if (savepoint.getUserTransaction() != this) { - throw new IllegalArgumentException("Save point to rollback doesn't belong to this transaction: " + savepoint); + throw new IllegalArgumentException(MessageFormat.format(Messages.getString("CDOTransactionImpl.4"), savepoint)); //$NON-NLS-1$ } if (TRACER.isEnabled()) { - TRACER.trace("handleRollback()"); + TRACER.trace("handleRollback()"); //$NON-NLS-1$ } try { if (!savepoint.isValid()) { - throw new IllegalArgumentException("Savepoint isn't valid : " + savepoint); + throw new IllegalArgumentException(MessageFormat.format(Messages.getString("CDOTransactionImpl.6"), savepoint)); //$NON-NLS-1$ } // Use the state lock since rollback mechanism is playing with EObject and CDORevisions. We do not want to @@ -931,14 +932,14 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa @Override public String toString() { - return MessageFormat.format("CDOTransaction({0})", getViewID()); + return MessageFormat.format("CDOTransaction({0})", getViewID()); //$NON-NLS-1$ } public void registerNew(InternalCDOObject object) { if (TRACER.isEnabled()) { - TRACER.format("Registering new object {0}", object); + TRACER.format("Registering new object {0}", object); //$NON-NLS-1$ } registerNewPackage(object.eClass().getEPackage()); @@ -1015,7 +1016,7 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa { if (TRACER.isEnabled()) { - TRACER.format("Registering dirty object {0}", object); + TRACER.format("Registering dirty object {0}", object); //$NON-NLS-1$ } if (featureDelta != null) @@ -1035,7 +1036,7 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa Object old = map.put(object.cdoID(), object); if (old != null) { - throw new ImplementationError("Duplicate ID: " + object); + throw new ImplementationError(MessageFormat.format(Messages.getString("CDOTransactionImpl.10"), object)); //$NON-NLS-1$ } if (!dirty) @@ -1101,7 +1102,7 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa CDOPackageUnit packageUnit = packageRegistry.getPackageUnit(usedPackage); if (packageUnit == null) { - throw new CDOException("No package unit for " + usedPackage); + throw new CDOException(MessageFormat.format(Messages.getString("CDOTransactionImpl.11"), usedPackage)); //$NON-NLS-1$ } if (packageUnit.getState() == CDOPackageUnit.State.NEW) @@ -1249,7 +1250,7 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa { if (TRACER.isEnabled()) { - TRACER.trace("commit()"); + TRACER.trace("commit()"); //$NON-NLS-1$ } for (CDOTransactionHandler handler : getHandlers()) @@ -1393,7 +1394,7 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa @Override public String toString() { - return MessageFormat.format("CDOTransactionStartedEvent[source={0}]", getSource()); + return MessageFormat.format("CDOTransactionStartedEvent[source={0}]", getSource()); //$NON-NLS-1$ } } @@ -1427,7 +1428,7 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa @Override public String toString() { - return MessageFormat.format("CDOTransactionFinishedEvent[source={0}, type={1}, idMappings={2}]", getSource(), + return MessageFormat.format("CDOTransactionFinishedEvent[source={0}, type={1}, idMappings={2}]", getSource(), //$NON-NLS-1$ getType(), idMappings == null ? 0 : idMappings.size()); } } @@ -1462,7 +1463,7 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa @Override public String toString() { - return MessageFormat.format("CDOTransactionConflictEvent[source={0}, conflictingObject={1}, firstConflict={2}]", + return MessageFormat.format("CDOTransactionConflictEvent[source={0}, conflictingObject={1}, firstConflict={2}]", //$NON-NLS-1$ getSource(), getConflictingObject(), isFirstConflict()); } } @@ -1497,7 +1498,7 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa @Override public String toString() { - return MessageFormat.format("CDOViewResourcesEvent[source={0}, {1}={2}]", getSource(), resourcePath, kind); + return MessageFormat.format("CDOViewResourcesEvent[source={0}, {1}={2}]", getSource(), resourcePath, kind); //$NON-NLS-1$ } } @@ -1601,7 +1602,7 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa { if (resolver.getTransaction() != null) { - throw new IllegalArgumentException("New conflict resolver is already associated with a transaction"); + throw new IllegalArgumentException(Messages.getString("CDOTransactionImpl.17")); //$NON-NLS-1$ } resolver.setTransaction(CDOTransactionImpl.this); diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOXACommitContextImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOXACommitContextImpl.java index 636fc9b1ad..b3d08602d8 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOXACommitContextImpl.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOXACommitContextImpl.java @@ -17,6 +17,7 @@ import org.eclipse.emf.cdo.common.revision.CDOReferenceAdjuster; import org.eclipse.emf.cdo.common.revision.delta.CDORevisionDelta; import org.eclipse.emf.cdo.eresource.CDOResource; import org.eclipse.emf.cdo.internal.common.id.CDOIDExternalTempImpl; +import org.eclipse.emf.cdo.messages.Messages; import org.eclipse.emf.cdo.util.CDOUtil; import org.eclipse.emf.internal.cdo.transaction.CDOXATransactionImpl.CDOXAState; @@ -32,6 +33,7 @@ import org.eclipse.emf.spi.cdo.InternalCDOXATransaction.InternalCDOXACommitConte import org.eclipse.core.runtime.IProgressMonitor; +import java.text.MessageFormat; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -158,7 +160,7 @@ public class CDOXACommitContextImpl implements InternalCDOXACommitContext } else { - throw new ImplementationError("Object should be an EObject " + idOrObject); + throw new ImplementationError(MessageFormat.format(Messages.getString("CDOXACommitContextImpl.0"), idOrObject)); //$NON-NLS-1$ } } diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOXATransactionImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOXATransactionImpl.java index a289e23416..e27c4189ca 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOXATransactionImpl.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOXATransactionImpl.java @@ -12,6 +12,7 @@ package org.eclipse.emf.internal.cdo.transaction; import org.eclipse.emf.cdo.common.id.CDOID; +import org.eclipse.emf.cdo.messages.Messages; import org.eclipse.emf.cdo.transaction.CDOSavepoint; import org.eclipse.emf.cdo.transaction.CDOTransaction; import org.eclipse.emf.cdo.transaction.CDOXATransaction; @@ -39,6 +40,7 @@ import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.core.runtime.SubProgressMonitor; +import java.text.MessageFormat; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; @@ -131,7 +133,7 @@ public class CDOXATransactionImpl implements InternalCDOXATransaction CDOXATransaction transSet = CDOUtil.getXATransaction(viewSet); if (transSet != null) { - throw new IllegalArgumentException("XATransaction is already attached to this viewSet"); + throw new IllegalArgumentException(Messages.getString("CDOXATransactionImpl.0")); //$NON-NLS-1$ } viewSet.eAdapters().add(internalAdapter); @@ -147,7 +149,7 @@ public class CDOXATransactionImpl implements InternalCDOXATransaction CDOXATransaction transSet = CDOUtil.getXATransaction(viewSet); if (transSet != this) { - throw new IllegalArgumentException("ViewSet isn't attached to this XATransaction"); + throw new IllegalArgumentException(Messages.getString("CDOXATransactionImpl.1")); //$NON-NLS-1$ } for (InternalCDOTransaction transaction : getTransactions(viewSet)) @@ -187,7 +189,7 @@ public class CDOXATransactionImpl implements InternalCDOXATransaction private void send(Collection<CDOXACommitContextImpl> xaContexts, final IProgressMonitor progressMonitor) throws InterruptedException, ExecutionException { - progressMonitor.beginTask("", xaContexts.size()); + progressMonitor.beginTask("", xaContexts.size()); //$NON-NLS-1$ try { @@ -252,8 +254,8 @@ public class CDOXATransactionImpl implements InternalCDOXATransaction public void commit(IProgressMonitor progressMonitor) throws TransactionException { - CheckUtil.checkArg(progressMonitor, "progressMonitor"); - progressMonitor.beginTask("Committing XA transaction", 3); + CheckUtil.checkArg(progressMonitor, "progressMonitor"); //$NON-NLS-1$ + progressMonitor.beginTask(Messages.getString("CDOXATransactionImpl.4"), 3); //$NON-NLS-1$ int phase = 0; for (InternalCDOTransaction transaction : transactions) @@ -318,17 +320,17 @@ public class CDOXATransactionImpl implements InternalCDOXATransaction { if (savepoint == null) { - throw new IllegalArgumentException("Save point is null"); + throw new IllegalArgumentException(Messages.getString("CDOXATransactionImpl.5")); //$NON-NLS-1$ } if (savepoint.getUserTransaction() != this) { - throw new IllegalArgumentException("Save point to rollback doesn't belong to this transaction: " + savepoint); + throw new IllegalArgumentException(MessageFormat.format(Messages.getString("CDOXATransactionImpl.6"), savepoint)); //$NON-NLS-1$ } if (!savepoint.isValid()) { - throw new IllegalArgumentException("Savepoint isn't valid : " + savepoint); + throw new IllegalArgumentException(Messages.getString("CDOXATransactionImpl.7") + savepoint); //$NON-NLS-1$ } CDOXASavepointImpl savepointSet = (CDOXASavepointImpl)savepoint; @@ -406,7 +408,7 @@ public class CDOXATransactionImpl implements InternalCDOXATransaction { if (!allRequestEnabled) { - throw new IllegalStateException("Commit from CDOTransaction is not allowed."); + throw new IllegalStateException(Messages.getString("CDOXATransactionImpl.8")); //$NON-NLS-1$ } } diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/CompletePackageClosure.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/CompletePackageClosure.java index 01bc3fbeb7..07123f48cd 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/CompletePackageClosure.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/CompletePackageClosure.java @@ -11,6 +11,8 @@ */ package org.eclipse.emf.internal.cdo.util; +import org.eclipse.emf.cdo.messages.Messages; + import org.eclipse.emf.internal.cdo.bundle.OM; import org.eclipse.net4j.util.om.trace.ContextTracer; @@ -26,6 +28,7 @@ import org.eclipse.emf.ecore.EStructuralFeature; import org.eclipse.emf.ecore.ETypeParameter; import org.eclipse.emf.ecore.EcorePackage; +import java.text.MessageFormat; import java.util.HashSet; import java.util.List; import java.util.Set; @@ -76,13 +79,13 @@ public class CompletePackageClosure extends PackageClosure { if (TRACER.isEnabled()) { - TRACER.trace("Found package " + p.getNsURI()); + TRACER.trace("Found package " + p.getNsURI()); //$NON-NLS-1$ } } } else { - OM.LOG.warn("Package == null for " + eClass.getName()); + OM.LOG.warn(MessageFormat.format(Messages.getString("CompletePackageClosure.0"), eClass.getName())); //$NON-NLS-1$ } } } @@ -126,7 +129,7 @@ public class CompletePackageClosure extends PackageClosure { if (TRACER.isEnabled()) { - TRACER.trace("Found class " + eClass.getName()); + TRACER.trace("Found class " + eClass.getName()); //$NON-NLS-1$ } handleEStructuralFeatures(eClass.getEStructuralFeatures(), visited); diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/FSMUtil.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/FSMUtil.java index d4515e90bd..cea170ccb0 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/FSMUtil.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/FSMUtil.java @@ -15,6 +15,7 @@ import org.eclipse.emf.cdo.CDOObject; import org.eclipse.emf.cdo.CDOState; import org.eclipse.emf.cdo.common.id.CDOID; import org.eclipse.emf.cdo.common.revision.CDORevision; +import org.eclipse.emf.cdo.messages.Messages; import org.eclipse.emf.cdo.spi.common.model.InternalCDOPackageRegistry; import org.eclipse.emf.cdo.util.InvalidObjectException; import org.eclipse.emf.cdo.util.ObjectNotFoundException; @@ -96,7 +97,7 @@ public final class FSMUtil { if (view.isClosed()) { - throw new IllegalStateException("View closed"); + throw new IllegalStateException(Messages.getString("FSMUtil.0")); //$NON-NLS-1$ } if (object instanceof InternalCDOObject) @@ -106,7 +107,7 @@ public final class FSMUtil if (object == null) { - throw new IllegalArgumentException("object == null"); + throw new IllegalArgumentException(Messages.getString("FSMUtil.1")); //$NON-NLS-1$ } if (isMeta(object)) @@ -126,7 +127,7 @@ public final class FSMUtil { if (view == null) { - throw new IllegalArgumentException("view == null"); + throw new IllegalArgumentException(Messages.getString("FSMUtil.2")); //$NON-NLS-1$ } if (object.eIsProxy()) @@ -153,7 +154,7 @@ public final class FSMUtil public static InternalCDOObject adaptLegacy(InternalEObject object) { // TODO LEGACY - throw new UnsupportedOperationException("Legacy models not supported"); + throw new UnsupportedOperationException(Messages.getString("FSMUtil.3")); //$NON-NLS-1$ // EList<InternalEObject.EReadListener> readListeners = object.eReadListeners(); // CDOLegacyWrapper wrapper = getLegacyWrapper(readListeners); // if (wrapper == null) diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/PackageClosure.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/PackageClosure.java index 2ad5eb566f..a5acf0dbe2 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/PackageClosure.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/PackageClosure.java @@ -59,7 +59,7 @@ public abstract class PackageClosure implements IPackageClosure { if (TRACER.isEnabled()) { - TRACER.trace("Package closure for " + ePackage.getNsURI()); + TRACER.trace("Package closure for " + ePackage.getNsURI()); //$NON-NLS-1$ } collectContents(ePackage, visited); for (EPackage subPackage : ePackage.getESubpackages()) diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOAuditImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOAuditImpl.java index d7429993c6..397ed699a4 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOAuditImpl.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOAuditImpl.java @@ -95,6 +95,6 @@ public class CDOAuditImpl extends CDOViewImpl implements CDOAudit @Override public String toString() { - return MessageFormat.format("CDOAudit({0})", getViewID()); + return MessageFormat.format("CDOAudit({0})", getViewID()); //$NON-NLS-1$ } } diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java index 6a5a40a1c5..20a65bfbb7 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java @@ -30,6 +30,7 @@ import org.eclipse.emf.cdo.eresource.CDOResourceFolder; import org.eclipse.emf.cdo.eresource.CDOResourceNode; import org.eclipse.emf.cdo.eresource.EresourcePackage; import org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl; +import org.eclipse.emf.cdo.messages.Messages; import org.eclipse.emf.cdo.spi.common.model.InternalCDOPackageRegistry; import org.eclipse.emf.cdo.spi.common.revision.InternalCDORevision; import org.eclipse.emf.cdo.transaction.CDOCommitContext; @@ -351,7 +352,7 @@ public class CDOViewImpl extends Lifecycle implements InternalCDOView return (InternalCDOTransaction)this; } - throw new ReadOnlyException("CDO view is read-only: " + this); + throw new ReadOnlyException(MessageFormat.format(Messages.getString("CDOViewImpl.0"), this)); //$NON-NLS-1$ } public boolean hasResource(String path) @@ -406,7 +407,7 @@ public class CDOViewImpl extends Lifecycle implements InternalCDOView { if (StringUtil.isEmpty(path)) { - throw new IllegalArgumentException("path"); + throw new IllegalArgumentException(Messages.getString("CDOViewImpl.1")); //$NON-NLS-1$ } CDOID folderID = null; @@ -434,7 +435,7 @@ public class CDOViewImpl extends Lifecycle implements InternalCDOView folderID = getResourceNodeID(folderID, name); if (folderID == null) { - throw new CDOException("Can not find " + name); + throw new CDOException(MessageFormat.format(Messages.getString("CDOViewImpl.2"), name)); //$NON-NLS-1$ } return folderID; @@ -473,14 +474,14 @@ public class CDOViewImpl extends Lifecycle implements InternalCDOView if (name == null) { - throw new IllegalArgumentException("name"); + throw new IllegalArgumentException(Messages.getString("CDOViewImpl.3")); //$NON-NLS-1$ } InternalCDORevision folderRevision = getLocalRevision(folderID); EClass resourceFolderClass = EresourcePackage.eINSTANCE.getCDOResourceFolder(); if (folderRevision.getEClass() != resourceFolderClass) { - throw new CDOException("Expected folder for id = " + folderID); + throw new CDOException(MessageFormat.format(Messages.getString("CDOViewImpl.4"), folderID)); //$NON-NLS-1$ } EReference nodesFeature = EresourcePackage.eINSTANCE.getCDOResourceFolder_Nodes(); @@ -499,7 +500,7 @@ public class CDOViewImpl extends Lifecycle implements InternalCDOView } } - throw new CDOException("Node " + name + " not found"); + throw new CDOException(MessageFormat.format(Messages.getString("CDOViewImpl.5"), name)); //$NON-NLS-1$ } /** @@ -514,18 +515,18 @@ public class CDOViewImpl extends Lifecycle implements InternalCDOView { if (name == null) { - throw new CDOException("No root ResourceNode"); + throw new CDOException(Messages.getString("CDOViewImpl.6")); //$NON-NLS-1$ } else { - throw new CDOException("No top level ResourceNode with the name " + name); + throw new CDOException(MessageFormat.format(Messages.getString("CDOViewImpl.7"), name)); //$NON-NLS-1$ } } if (ids.size() > 1) { // TODO is this still needed since the is resourceQuery.setMaxResults(1) ?? - throw new ImplementationError("Duplicate top-level ResourceNodes"); + throw new ImplementationError(Messages.getString("CDOViewImpl.8")); //$NON-NLS-1$ } return ids.get(0); @@ -550,7 +551,7 @@ public class CDOViewImpl extends Lifecycle implements InternalCDOView if (revision == null) { - throw new CDOException("Cannot find revision with ID " + id); + throw new CDOException(MessageFormat.format(Messages.getString("CDOViewImpl.9"), id)); //$NON-NLS-1$ } return revision; @@ -651,7 +652,7 @@ public class CDOViewImpl extends Lifecycle implements InternalCDOView { if (CDOIDUtil.isNull(resourceID)) { - throw new IllegalArgumentException("resourceID: " + resourceID); + throw new IllegalArgumentException("resourceID: " + resourceID); //$NON-NLS-1$ } return (CDOResourceImpl)getObject(resourceID); @@ -741,7 +742,8 @@ public class CDOViewImpl extends Lifecycle implements InternalCDOView { if (view.getSession() != session) { - throw new IllegalArgumentException("Object is contaiuned in a different session: " + objectFromDifferentView); + throw new IllegalArgumentException(MessageFormat.format( + Messages.getString("CDOViewImpl.11"), objectFromDifferentView)); //$NON-NLS-1$ } CDOID id = object.cdoID(); @@ -787,7 +789,7 @@ public class CDOViewImpl extends Lifecycle implements InternalCDOView { if (TRACER.isEnabled()) { - TRACER.trace("Creating meta object for " + id); + TRACER.trace("Creating meta object for " + id); //$NON-NLS-1$ } InternalCDOPackageRegistry packageRegistry = session.getPackageRegistry(); @@ -802,7 +804,7 @@ public class CDOViewImpl extends Lifecycle implements InternalCDOView { if (TRACER.isEnabled()) { - TRACER.trace("Creating object for " + id); + TRACER.trace("Creating object for " + id); //$NON-NLS-1$ } InternalCDORevision revision = getRevision(id, true); @@ -855,7 +857,7 @@ public class CDOViewImpl extends Lifecycle implements InternalCDOView return path + CDOURIUtil.SEGMENT_SEPARATOR + name; } - throw new ImplementationError("Not a ResourceFolder: " + object); + throw new ImplementationError(MessageFormat.format(Messages.getString("CDOViewImpl.14"), object)); //$NON-NLS-1$ } /** @@ -881,7 +883,7 @@ public class CDOViewImpl extends Lifecycle implements InternalCDOView CDOID id = (CDOID)shouldBeCDOID; if (TRACER.isEnabled() && id != idOrObject) { - TRACER.format("Converted object to CDOID: {0} --> {1}", idOrObject, id); + TRACER.format("Converted object to CDOID: {0} --> {1}", idOrObject, id); //$NON-NLS-1$ } return id; @@ -907,7 +909,8 @@ public class CDOViewImpl extends Lifecycle implements InternalCDOView throw new DanglingReferenceException(eObject); } - throw new IllegalStateException("Unable to provideCDOID: " + idOrObject.getClass().getName()); + throw new IllegalStateException(MessageFormat.format( + Messages.getString("CDOViewImpl.16"), idOrObject.getClass().getName())); //$NON-NLS-1$ } public Object convertObjectToID(Object potentialObject) @@ -983,7 +986,7 @@ public class CDOViewImpl extends Lifecycle implements InternalCDOView InternalCDOObject result = getObject(id, true); if (result == null) { - throw new ImplementationError("ID not registered: " + id); + throw new ImplementationError(MessageFormat.format(Messages.getString("CDOViewImpl.17"), id)); //$NON-NLS-1$ } return result.cdoInternalInstance(); @@ -999,7 +1002,7 @@ public class CDOViewImpl extends Lifecycle implements InternalCDOView { if (!resource.isExisting()) { - throw new ReadOnlyException("CDO view is read-only: " + this); + throw new ReadOnlyException(MessageFormat.format(Messages.getString("CDOViewImpl.18"), this)); //$NON-NLS-1$ } // ResourceSet.getResource(uri, true) was called!! @@ -1031,7 +1034,7 @@ public class CDOViewImpl extends Lifecycle implements InternalCDOView { if (TRACER.isEnabled()) { - TRACER.format("Registering {0}", object); + TRACER.format("Registering {0}", object); //$NON-NLS-1$ } InternalCDOObject old; @@ -1042,7 +1045,7 @@ public class CDOViewImpl extends Lifecycle implements InternalCDOView if (old != null) { - throw new IllegalStateException("Duplicate ID: " + object); + throw new IllegalStateException(MessageFormat.format(Messages.getString("CDOViewImpl.20"), object)); //$NON-NLS-1$ } } @@ -1050,7 +1053,7 @@ public class CDOViewImpl extends Lifecycle implements InternalCDOView { if (TRACER.isEnabled()) { - TRACER.format("Deregistering {0}", object); + TRACER.format("Deregistering {0}", object); //$NON-NLS-1$ } removeObject(object.cdoID()); @@ -1068,7 +1071,7 @@ public class CDOViewImpl extends Lifecycle implements InternalCDOView if (TRACER.isEnabled()) { - TRACER.format("Remapping {0} --> {1}", oldID, newID); + TRACER.format("Remapping {0} --> {1}", oldID, newID); //$NON-NLS-1$ } } @@ -1388,7 +1391,7 @@ public class CDOViewImpl extends Lifecycle implements InternalCDOView @Override public String toString() { - return MessageFormat.format("CDOView({0})", viewID); + return MessageFormat.format("CDOView({0})", viewID); //$NON-NLS-1$ } public boolean isAdapterForType(Object type) @@ -1416,8 +1419,8 @@ public class CDOViewImpl extends Lifecycle implements InternalCDOView protected void doBeforeActivate() throws Exception { super.doBeforeActivate(); - checkState(session, "session"); - checkState(viewID > 0, "viewID"); + checkState(session, "session"); //$NON-NLS-1$ + checkState(viewID > 0, "viewID"); //$NON-NLS-1$ } /** @@ -1463,7 +1466,7 @@ public class CDOViewImpl extends Lifecycle implements InternalCDOView return CDOProtocolConstants.VIEW_AUDIT; default: - throw new IllegalStateException("Invalid view type: " + viewType); + throw new IllegalStateException(MessageFormat.format(Messages.getString("CDOViewImpl.26"), viewType)); //$NON-NLS-1$ } } @@ -1715,7 +1718,7 @@ public class CDOViewImpl extends Lifecycle implements InternalCDOView InternalCDOObject internalCDOObject = FSMUtil.adapt(eObject, CDOViewImpl.this); if (internalCDOObject.cdoView() != CDOViewImpl.this) { - throw new CDOException("Object " + internalCDOObject + " doesn`t belong to this view."); + throw new CDOException(MessageFormat.format(Messages.getString("CDOViewImpl.27"), internalCDOObject)); //$NON-NLS-1$ } subscribe(internalCDOObject.cdoID(), internalCDOObject, adjust); @@ -1878,7 +1881,7 @@ public class CDOViewImpl extends Lifecycle implements InternalCDOView @Override public String toString() { - return "CDOViewInvalidationEvent: " + dirtyObjects; + return "CDOViewInvalidationEvent: " + dirtyObjects; //$NON-NLS-1$ } } @@ -2031,7 +2034,7 @@ public class CDOViewImpl extends Lifecycle implements InternalCDOView return ReferenceType.WEAK; } - throw new IllegalStateException("referenceType"); + throw new IllegalStateException(Messages.getString("CDOViewImpl.29")); //$NON-NLS-1$ } public boolean setCacheReferenceType(ReferenceType referenceType) @@ -2072,7 +2075,7 @@ public class CDOViewImpl extends Lifecycle implements InternalCDOView break; default: - throw new IllegalArgumentException("referenceType"); + throw new IllegalArgumentException(Messages.getString("CDOViewImpl.29")); //$NON-NLS-1$ } if (objects == null) diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewProviderRegistryImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewProviderRegistryImpl.java index e533b31933..4ffe7b3e32 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewProviderRegistryImpl.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewProviderRegistryImpl.java @@ -11,6 +11,7 @@ */ package org.eclipse.emf.internal.cdo.view; +import org.eclipse.emf.cdo.messages.Messages; import org.eclipse.emf.cdo.util.CDOURIUtil; import org.eclipse.emf.cdo.util.CDOUtil; import org.eclipse.emf.cdo.view.AbstractCDOViewProvider; @@ -34,6 +35,7 @@ import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.IExtensionRegistry; import org.eclipse.core.runtime.Platform; +import java.text.MessageFormat; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; @@ -51,7 +53,7 @@ public class CDOViewProviderRegistryImpl extends Container<CDOViewProvider> impl { public static final CDOViewProviderRegistryImpl INSTANCE = new CDOViewProviderRegistryImpl(); - private static final String EXT_POINT = "viewProviders"; + private static final String EXT_POINT = "viewProviders"; //$NON-NLS-1$ private List<CDOViewProvider> viewProviders = new ArrayList<CDOViewProvider>(); @@ -249,17 +251,19 @@ public class CDOViewProviderRegistryImpl extends Container<CDOViewProvider> impl public CDOViewProviderDescriptor(IConfigurationElement element) { - super(element.getAttribute("regex"), Integer.parseInt(element.getAttribute("priority"))); + super(element.getAttribute("regex"), Integer.parseInt(element.getAttribute("priority"))); //$NON-NLS-1$ //$NON-NLS-2$ this.element = element; - if (StringUtil.isEmpty(element.getAttribute("class"))) + if (StringUtil.isEmpty(element.getAttribute("class"))) //$NON-NLS-1$ { - throw new IllegalArgumentException("class not defined for extension " + element); + throw new IllegalArgumentException(MessageFormat.format( + Messages.getString("CDOViewProviderRegistryImpl.4"), element)); //$NON-NLS-1$ } - if (StringUtil.isEmpty(element.getAttribute("regex"))) + if (StringUtil.isEmpty(element.getAttribute("regex"))) //$NON-NLS-1$ { - throw new IllegalArgumentException("regex not defined for extension " + element); + throw new IllegalArgumentException(MessageFormat.format( + Messages.getString("CDOViewProviderRegistryImpl.6"), element)); //$NON-NLS-1$ } } @@ -272,7 +276,7 @@ public class CDOViewProviderRegistryImpl extends Container<CDOViewProvider> impl { try { - return (CDOViewProvider)element.createExecutableExtension("class"); + return (CDOViewProvider)element.createExecutableExtension("class"); //$NON-NLS-1$ } catch (CoreException ex) { diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewSetImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewSetImpl.java index 5395adc862..abea7941f3 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewSetImpl.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewSetImpl.java @@ -14,6 +14,7 @@ package org.eclipse.emf.internal.cdo.view; import org.eclipse.emf.cdo.common.protocol.CDOProtocolConstants; import org.eclipse.emf.cdo.eresource.CDOResource; import org.eclipse.emf.cdo.eresource.CDOResourceFactory; +import org.eclipse.emf.cdo.messages.Messages; import org.eclipse.emf.cdo.view.CDOView; import org.eclipse.emf.common.notify.Notification; @@ -27,6 +28,7 @@ import org.eclipse.emf.ecore.resource.Resource.Factory.Registry; import org.eclipse.emf.spi.cdo.InternalCDOView; import org.eclipse.emf.spi.cdo.InternalCDOViewSet; +import java.text.MessageFormat; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; @@ -91,7 +93,8 @@ public class CDOViewSetImpl extends NotifierImpl implements InternalCDOViewSet { if (repositoryUUID != null) { - throw new IllegalArgumentException("Cannot find associated CDOView for repository " + repositoryUUID); + throw new IllegalArgumentException(MessageFormat.format( + Messages.getString("CDOViewSetImpl.0"), repositoryUUID)); //$NON-NLS-1$ } if (mapOfViews.size() == 1) @@ -104,7 +107,7 @@ public class CDOViewSetImpl extends NotifierImpl implements InternalCDOViewSet return null; } - throw new IllegalStateException("Don't know which CDOView to take since no authority has been specified"); + throw new IllegalStateException(Messages.getString("CDOViewSetImpl.1")); //$NON-NLS-1$ } } @@ -127,7 +130,7 @@ public class CDOViewSetImpl extends NotifierImpl implements InternalCDOViewSet CDOView lookupView = mapOfViews.get(repositoryUUID); if (lookupView != null) { - throw new RuntimeException("Only one view per repository can be open for the same resource set"); + throw new RuntimeException(Messages.getString("CDOViewSetImpl.2")); //$NON-NLS-1$ } views.add(view); @@ -181,12 +184,12 @@ public class CDOViewSetImpl extends NotifierImpl implements InternalCDOViewSet { if (!isAdapterForType(newTarget)) { - throw new IllegalArgumentException("Unsupported target: " + newTarget); + throw new IllegalArgumentException(MessageFormat.format(Messages.getString("CDOViewSetImpl.3"), newTarget)); //$NON-NLS-1$ } if (resourceSet != null) { - throw new IllegalStateException("Cannot associate more than 1 resource set with this view set"); + throw new IllegalStateException(Messages.getString("CDOViewSetImpl.4")); //$NON-NLS-1$ } resourceSet = (ResourceSet)newTarget; diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/PluginContainerViewProvider.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/PluginContainerViewProvider.java index 51d62e8db7..832a9ee7d8 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/PluginContainerViewProvider.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/PluginContainerViewProvider.java @@ -32,7 +32,7 @@ import org.eclipse.emf.ecore.resource.ResourceSet; */ public class PluginContainerViewProvider extends ManagedContainerViewProvider implements CDOViewProvider { - private final static String REGEX = "cdo:.*"; + private final static String REGEX = "cdo:.*"; //$NON-NLS-1$ private final static int PRIORITY = 400; diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/AbstractObjectConflictResolver.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/AbstractObjectConflictResolver.java index 96b1c8df18..0fef742fb7 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/AbstractObjectConflictResolver.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/AbstractObjectConflictResolver.java @@ -17,6 +17,7 @@ import org.eclipse.emf.cdo.common.id.CDOID; import org.eclipse.emf.cdo.common.revision.delta.CDOFeatureDelta; import org.eclipse.emf.cdo.common.revision.delta.CDORevisionDelta; import org.eclipse.emf.cdo.common.util.CDOException; +import org.eclipse.emf.cdo.messages.Messages; import org.eclipse.emf.cdo.spi.common.revision.CDORevisionMerger; import org.eclipse.emf.cdo.spi.common.revision.InternalCDORevision; import org.eclipse.emf.cdo.spi.common.revision.InternalCDORevisionDelta; @@ -326,7 +327,7 @@ public abstract class AbstractObjectConflictResolver implements CDOConflictResol if (hasFeatureConflicts(localDelta, remoteDeltas)) { // TODO localDelta may be corrupt already and the transaction will not be able to restore it!!! - throw new CDOException("Object has feature-level conflicts"); + throw new CDOException(Messages.getString("AbstractObjectConflictResolver.0")); //$NON-NLS-1$ } rollbackObject(conflict); diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/CDOSessionProtocol.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/CDOSessionProtocol.java index 29e18aceee..4ed399274e 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/CDOSessionProtocol.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/CDOSessionProtocol.java @@ -256,7 +256,7 @@ public interface CDOSessionProtocol extends PackageLoader { return MessageFormat .format( - "RepositoryTime[requested={0,date} {0,time}, indicated={1,date} {1,time}, responded={2,date} {2,time}, confirmed={3,date} {3,time}]", + "RepositoryTime[requested={0,date} {0,time}, indicated={1,date} {1,time}, responded={2,date} {2,time}, confirmed={3,date} {3,time}]", //$NON-NLS-1$ requested, indicated, responded, confirmed); } } |