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

Summary: ClassPath.getClassPath() should return empty path instead of null
Product: java Reporter: _ tball <tball>
Component: ClasspathAssignee: Tomas Zezula <tzezula>
Status: NEW ---    
Severity: blocker    
Priority: P3    
Version: 5.x   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:

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.