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

Bug 329342

Summary: SCA model cannot be used outside of an eclipse environment
Product: z_Archived Reporter: Damien Fournier <damien.fournier>
Component: ScaAssignee: Damien Fournier <damien.fournier>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: damien.fournier, vincent.zurczak
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: All   
Whiteboard:

Description Damien Fournier CLA 2010-11-03 09:17:13 EDT
The SCAResourceImpl class inside the org.eclipse.stp.sca.util package of the SCA model use the static method Platform.getLocation(). This method only works in an eclipse environment. Composite files should be loaded using an alternative method if the SCA model is not used by an eclipse editor.

for example:

public static void prepareCompositeFile(URI uri) {
  try {
    File file;
    try {
      IPath path = Platform.getLocation();
      file = new File(path.toString() + uri.toPlatformString(true));
     }
     // Load file from the system if Eclipse platform is not running or present
     catch (NoClassDefFoundError e) {
       file = new File(uri.toFileString());
     }
...
Comment 1 Damien Fournier CLA 2010-11-04 11:24:27 EDT
Fixed by commit #3544
Comment 2 Damien Fournier CLA 2010-11-04 12:20:50 EDT
Also raise AssertionFailedException when Platform class has been loaded but the eclipse platform has not been initialized
Comment 3 Damien Fournier CLA 2010-11-04 12:35:06 EDT
Fixed by commit #3545
Comment 4 Vincent Zurczak CLA 2011-03-25 08:22:36 EDT
Close old bugs.