This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 222849 - Repository.java assumes Thread.currentThread().getContextClassloader() will not return null
Summary: Repository.java assumes Thread.currentThread().getContextClassloader() will n...
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Filesystems (show other bugs)
Version: 7.3
Hardware: All All
: P3 normal (vote)
Assignee: Jaroslav Tulach
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-27 16:49 UTC by dave_charles
Modified: 2012-11-30 02:48 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dave_charles 2012-11-27 16:49:51 UTC
The implementation of Repository$MainFS.provideLayer(List<URL>) assumes that  Thread.currentThread().getContextClassLoader() will never return null.

A non-null return value is the typical case, but I have received numerous reports from other developers of an NPE on the very next line, suggesting that Thread.currentThread().getContextClassLoader() has indeed returned null.

I have never seen this behavior myself, but I have received enough reports from different sources to believe it is true, and it seems to happen only when org-openide-filesystems.jar is used outside of an RCP application.

It appears that Sun/Oracle has already reviewed this return-value issue and decided it is not a bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4155645
Comment 1 Jaroslav Tulach 2012-11-27 20:37:28 UTC
ergonomics#b97a99473384
Comment 2 Quality Engineering 2012-11-30 02:48:15 UTC
Integrated into 'main-golden', will be available in build *201211300001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/b97a99473384
User: Jaroslav Tulach <jtulach@netbeans.org>
Log: #222849: Repository.java assumes Thread.currentThread().getContextClassloader() will not return null
#222849: As a fallback classloader use the one that loaded Repository