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 73215 - ClassPath.getClassPath() should return empty path instead of null
Summary: ClassPath.getClassPath() should return empty path instead of null
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Classpath (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: Tomas Zezula
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-03 16:55 UTC by _ tball
Modified: 2009-11-12 05:50 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description _ tball 2006-03-03 16:55:36 UTC
If a FileObject isn't found by ClassPath.getClassPath(), it returns null.  An
"empty" path object (aka Null Object pattern) would eliminate the need for
clients to check the return value from ClassPath.getClassPath().  This empty
path would return null from methods such as getResourceName(), just like normal
ClassPaths do today, so other client code shouldn't be affected by this enhancement.
Comment 1 Tomas Zezula 2006-03-13 09:16:12 UTC
I agree that returning an empty classpath should be better then null.
The change needs an API review, it is an incompatible semantic change, but
it should not cause any problems since clients should not rely on the (non)
existence of ClassPathProvider and currently the IDE returns classpath for any
file if the j2seplatform module (DefaultClassPathProvider) is installed.