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

Bug 378778

Summary: ApplicationLauncherImpl#getContextFileName calls BundleContext.getDataFile(String) with absolute Path
Product: [RT] RAP Reporter: Frank Appel <fr.appel>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: critical    
Priority: P2    
Version: 1.5   
Target Milestone: 1.5 RC1   
Hardware: All   
OS: All   
Whiteboard:

Description Frank Appel CLA 2012-05-08 01:39:51 EDT
There is a bug in the RAP RWT OSGi Bundle Version 1.5.0M6, Class ApplicationLauncherImpl, line 229.
The OSGi spec sais that any path passed to bundleContext.getDataFile() should be relative (http://www.osgi.org/javadoc/r4v43/org/osgi/framework/BundleContext.html#getDataFile(java.lang.String))

ApplicationLauncherImpl calls this method always with an absolute path (see method getContextFileName), which will return null and then there is a NPE on line 221.
Comment 1 Ralf Sternberg CLA 2012-05-09 08:37:44 EDT
I cannot reproduce the NPE with current Equinox OSGi, where getDataFile() seems to accept absolute paths as well. For both "/rwtcontext_xxx" and "rwtcontext_xxx", the same file name is returned. This might explain why this issue wasn't noticed. So I think it's safe to simply remove the leading slash.

The change is in CVS and will be part of 1.5RC1.