Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 335204

Summary: Epsilon Mac problem
Product: [Modeling] Epsilon Reporter: Andy Ed <ae2>
Component: CoreAssignee: Louis Rose <louis>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: louis
Version: unspecified   
Target Milestone: ---   
Hardware: Macintosh   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard: interim

Description Andy Ed CLA 2011-01-24 10:39:24 EST
My ETL translation runs under windows but not Mac. I think I've tracked the problem to the following code in: 
/org.eclipse.epsilon.emc.emf/src/org/eclipse/epsilon/emc/emf /EmfModel.java rev 1163, at line 196.

model = resourceSet.createResource(modelFileUri);

This is successful in windows, but not Mac. The difference is as follows:

The modelFileURI in Windows is: platform:/resource/sharedbuffer20100819Tasking/sharedbuffer2 0100819b.tasking

The modelFileURI on the Mac is, file:/sharedbuffer20100819Tasking/sharedbuffer20100819b.task ing

The difference arises during the call to EMFUtil.createURI(metamodelFile) in line 84, org.eclipse.epsilon.emc.emf/src/org/eclipse/epsilon/emc/emf/ EmfUtil.java. 

I hacked the code on the Mac to make the modelFileURI a platform relative resource, then all went well. So a branch like the following could be necessary.
...
else if(OperatingSystem.isMac() ){
return URI.createPlatformResourceURI(s, true);
} ...


within the method,


public static URI createURI(String s) {
URI uri = URI.createURI(s);

if (uri.scheme() != null) {
// If we are under Windows and s starts with x: it is an absolute path
if (OperatingSystem.isWindows() && uri.scheme().length() == 1) {
return URI.createFileURI(s);
}
// otherwise it is a proper uri
else {
return uri;
}
}
// Handle paths that start with / under Unix e.g. /local/foo.txt
else if (OperatingSystem.isUnix() && s.startsWith("/")) { 
return URI.createFileURI(s);
}
// ... otherwise it is a platform resource uri
else {
return URI.createPlatformResourceURI(s, true);
}
}

Is it possible to fix this?

cheers, 
Andy
Comment 1 Louis Rose CLA 2011-01-25 05:49:27 EST
*** Bug 335214 has been marked as a duplicate of this bug. ***
Comment 2 Louis Rose CLA 2011-01-25 05:50:38 EST
As mentioned on #335214:

I've checked in a fix for this to SVN, and this appears to work on both Windows
and Mac. This allows users to launch Epsilon programs, and to use external
object references with HUTN.
Comment 3 Dimitris Kolovos CLA 2011-01-25 07:37:10 EST
This has been fixed in the latest interim version.
Comment 4 Dimitris Kolovos CLA 2011-07-25 08:16:06 EDT
Fixed in 0.9.1