Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian W. Damus2016-02-01 15:46:23 +0000
committerChristian W. Damus2016-02-01 15:46:23 +0000
commitfec12b1385a425332ad92859ac106451636baf75 (patch)
treeb172c6873e926862bd6b8a4c3d163acfe4e296a7
parent964f8076a2c938edebc3fc0568aa19c5a9734cce (diff)
downloadorg.eclipse.papyrus-fec12b1385a425332ad92859ac106451636baf75.tar.gz
org.eclipse.papyrus-fec12b1385a425332ad92859ac106451636baf75.tar.xz
org.eclipse.papyrus-fec12b1385a425332ad92859ac106451636baf75.zip
Bug 486921: [CDO] Lots of new CDO Tests failures
https://bugs.eclipse.org/bugs/show_bug.cgi?id=486921 Update default language provider to implement safe iteration of resources in the CDO context.
-rw-r--r--plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/internal/language/DefaultLanguageProvider.java4
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/services/Messages.java4
2 files changed, 5 insertions, 3 deletions
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/internal/language/DefaultLanguageProvider.java b/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/internal/language/DefaultLanguageProvider.java
index 6f40db2c71b..eb3924c8b84 100644
--- a/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/internal/language/DefaultLanguageProvider.java
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/internal/language/DefaultLanguageProvider.java
@@ -16,6 +16,7 @@ package org.eclipse.papyrus.infra.core.internal.language;
import java.io.File;
import java.io.IOException;
import java.io.StringReader;
+import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
@@ -92,7 +93,8 @@ public class DefaultLanguageProvider implements ILanguageProvider {
@Override
public synchronized Iterable<ILanguage> getLanguages(ILanguageService languageService, ModelSet modelSet) {
- if (!matchContentType(modelSet.getResources())) {
+ // Make a defensive copy because CDO resources aren't iteration-safe as standard EMF resources are
+ if (!matchContentType(new ArrayList<>(modelSet.getResources()))) {
return Collections.emptyList();
} else {
// If any of my content-types matches, then all of my languages are present
diff --git a/plugins/infra/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/services/Messages.java b/plugins/infra/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/services/Messages.java
index 58482ab0e2c..0b8d66d2056 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/services/Messages.java
+++ b/plugins/infra/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/services/Messages.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2015 Christian W. Damus and others.
+ * Copyright (c) 2015, 2016 Christian W. Damus and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -19,7 +19,7 @@ import org.eclipse.osgi.util.NLS;
* Translatable strings.
*/
class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.papyrus.infra.core.services.messages"; //$NON-NLS-1$
+ private static final String BUNDLE_NAME = "org.eclipse.papyrus.infra.ui.services.messages"; //$NON-NLS-1$
public static String SaveLayoutBeforeClose_0;
public static String SaveLayoutBeforeClose_1;
public static String SaveLayoutBeforeClose_2;

Back to the top