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 /plugins/infra/core
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.
Diffstat (limited to 'plugins/infra/core')
-rw-r--r--plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/internal/language/DefaultLanguageProvider.java4
1 files changed, 3 insertions, 1 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

Back to the top