Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 329342 - SCA model cannot be used outside of an eclipse environment
Summary: SCA model cannot be used outside of an eclipse environment
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Sca (show other bugs)
Version: unspecified   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Damien Fournier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-03 09:17 EDT by Damien Fournier CLA
Modified: 2017-03-30 14:20 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.