JDK-4432218 : (cl) ClassLoader.getResources() is final but ClassLoader.getResource() is not
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang:class_loading
  • Affected Version: 1.4.0
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2001-03-30
  • Updated: 2017-05-16
  • Resolved: 2004-04-26
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
5.0 b49Fixed
Related Reports
Relates :  
Description
The behavior of java.lang.ClassLoader is not fully customizable.  Many of the
ClassLoader methods are correctly permitted to be overriden in order to implement
secure, networked, etc. class loaders.  However the method,
ClassLoader.getResources is final.  This restriction prevents ClassLoader
sublclasses from overriding the order that ClassLoader will use to return all
the resources of a class loader for a given name.

Custom class loading schemes ought to be able to customize the getResources
behavior.  Additionally, it is inconsistent that getResource can be overriden
but getResources can not.

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: tiger-beta2 FIXED IN: tiger-beta2 INTEGRATED IN: tiger-b49 tiger-beta2
14-06-2004

WORK AROUND There is no workaround, there is no way to override getResources()
11-06-2004

SUGGESTED FIX Modify the spec. for ClassLoader.getResources appropriately and remove the use of the final keyword.
11-06-2004

EVALUATION It seems reasonable to remove "final" from getResources() and doing so will not impact binary compatibility. This should be considered for tiger. -- iag@sfbay 2001-11-06
06-11-2001