Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 313634 - package whose repository is in the current directory can cause NullPointer exception
Summary: package whose repository is in the current directory can cause NullPointer ex...
Status: CLOSED DUPLICATE of bug 291126
Alias: None
Product: RTSC
Classification: Technology
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Sasha Slijepcevic CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 313408
Blocks:
  Show dependency tree
 
Reported: 2010-05-19 18:13 EDT by Sasha Slijepcevic CLA
Modified: 2012-06-14 17:26 EDT (History)
2 users (show)

See Also:


Attachments
test case (11.54 KB, application/x-zip-compressed)
2010-05-19 18:13 EDT, Sasha Slijepcevic CLA
no flags Details

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