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

Bug 313634

Summary: package whose repository is in the current directory can cause NullPointer exception
Product: [Technology] RTSC Reporter: Sasha Slijepcevic <sascha>
Component: CoreAssignee: Sasha Slijepcevic <sascha>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: d-russo, dfriedland
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on: 313408    
Bug Blocks:    
Attachments:
Description Flags
test case none

Description Sasha Slijepcevic CLA 2010-05-19 18:13:52 EDT
Created attachment 169239 [details]
test case

+++ This bug was initially created as a clone of Bug #313408 +++

Attached is the package 'eclnew' which loads the package 'testpkg'. The package 'testpkg' is located in the directory 'eclnew/testpkg', and when 'eclnew' is being built, the repository directory for 'testpkg' is the current working directory.

To replicate the bug, unzip the attached file and build 'eclnew', without specifying XDCPATH.

If XDCPATH is not being set to include the current working directory, this physical organization causes NullPointer exception. The exception is caused by the difference between the path used by xdc.findFile and the path used by BrowserSession. When the schema for 'testpkg' is loaded, xdc.findFile automatically adds the current working directory to the search path, and 'testpkg' is found and processed correctly. However, when BrowserSession searches for the spec for 'testpkg' at the time when the config files are generated, only the package path is searched.

Here is the relevant part of the error output:
configuring test.x64P from package/cfg/test_x64P.cfg ...
java.lang.NullPointerException
        at xdc.services.intern.gen.Config.pkgSpec(Config.java:2739)
        at xdc.services.intern.gen.Config.getPkgAliases(Config.java:1765)
        at xdc.services.intern.gen.Config.gen(Config.java:251)
        at xdc.services.intern.gen.Prog.gen(Prog.java:63)
        at xdc.services.intern.gen.Prog.gen(Prog.java:40)
...
js: "/db/rtree/install/trees/products/xdcprod/xdcprod-m36/product/Linux/xdctools_3_20_00_36_eng/packages/xdc/cfg/Main.xs", line 31: XDC runtime exception: java.lang.NullPointerException

The original bug 313408 was fixed by recognizing that NullPointerException happened and displaying an error message. The real solution should be to fix the inconsistency in search paths between xdc.findFile and findPkg() in BrowserSession.
Comment 1 Sasha Slijepcevic CLA 2012-06-14 17:26:05 EDT

*** This bug has been marked as a duplicate of bug 291126 ***