Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas FAUVERGUE2016-12-09 14:11:19 +0000
committerGerrit Code Review @ Eclipse.org2016-12-09 19:59:02 +0000
commitcf023359f527ca5b1d89a31d9152afca1306e3b8 (patch)
treee8578f85feabe285f2891701e4835a4fe5dc3969 /plugins/infra
parent0f1a62a2336393adb9daf4b8b376665744a15c68 (diff)
downloadorg.eclipse.papyrus-cf023359f527ca5b1d89a31d9152afca1306e3b8.tar.gz
org.eclipse.papyrus-cf023359f527ca5b1d89a31d9152afca1306e3b8.tar.xz
org.eclipse.papyrus-cf023359f527ca5b1d89a31d9152afca1306e3b8.zip
Bug 508989: [Internationalization] Error log appear when loading a model
into a sub-folder of project https://bugs.eclipse.org/bugs/show_bug.cgi?id=508989 - The model is not always in a project direcly, manage it is in a sub-folder Change-Id: Ia0258d613c9c07fb400d385fd4391de7808d9124 Signed-off-by: Nicolas FAUVERGUE <nicolas.fauvergue@cea.fr>
Diffstat (limited to 'plugins/infra')
-rw-r--r--plugins/infra/internationalization/org.eclipse.papyrus.infra.internationalization/src/org/eclipse/papyrus/infra/internationalization/modelresource/InternationalizationModelResource.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/plugins/infra/internationalization/org.eclipse.papyrus.infra.internationalization/src/org/eclipse/papyrus/infra/internationalization/modelresource/InternationalizationModelResource.java b/plugins/infra/internationalization/org.eclipse.papyrus.infra.internationalization/src/org/eclipse/papyrus/infra/internationalization/modelresource/InternationalizationModelResource.java
index b13a06c9d34..82b2b016d3a 100644
--- a/plugins/infra/internationalization/org.eclipse.papyrus.infra.internationalization/src/org/eclipse/papyrus/infra/internationalization/modelresource/InternationalizationModelResource.java
+++ b/plugins/infra/internationalization/org.eclipse.papyrus.infra.internationalization/src/org/eclipse/papyrus/infra/internationalization/modelresource/InternationalizationModelResource.java
@@ -25,10 +25,11 @@ import java.util.Map.Entry;
import java.util.Properties;
import java.util.Set;
-import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.Path;
import org.eclipse.emf.common.command.AbstractCommand;
import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.common.command.CompoundCommand;
@@ -264,18 +265,18 @@ public class InternationalizationModelResource extends AbstractModelWithSharedRe
final URI folderURI = uriWithoutExtension.trimSegments(1);
// Calculate the project folder
- IProject projectFolder = null;
+ IContainer parentFolder = null;
if (folderURI.isPlatformResource()) {
final String uriPlatformString = folderURI.toPlatformString(true);
- projectFolder = ResourcesPlugin.getWorkspace().getRoot().getProject(uriPlatformString.substring(1));
+ parentFolder = ResourcesPlugin.getWorkspace().getRoot().getFolder(new Path(uriPlatformString));
}
- if (null != projectFolder) {
+ if (null != parentFolder) {
final String extension = "." + getModelFileExtension(); //$NON-NLS-1$
try {
// Loop on project resources to check about other properties
// file
- for (final IResource resourceEntry : projectFolder.members()) {
+ for (final IResource resourceEntry : parentFolder.members()) {
// Check if the file starts with the name of the model and
// finish with properties
if (resourceEntry.getName().startsWith(modelName) && resourceEntry.getName().endsWith(extension)) { // $NON-NLS-1$

Back to the top