wrong handling of resource paths

Project:JNode Core
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

I suspect something inconsistent probably in VmSystemClassLoader or PluginClassLoader.
I mean by 'inconsistent' that somewhere/sometime a method is called with '.' or '/' as path separators. And, when '/' is used, somewhere/sometime it is called with leading '/' or not.

Involved/bugged methods :
ClassLoader.getResource
ClassLoader.getResourceAsStream
Class.getResource
Class.getResourceAsStream
ResourceBundle.getBundle and PropertyResourceBundle.getBundle

The must to see case is that one : ResourceBundle.getBundle. It take a String for a classname like 'org.jnode.driver.input.KeyboardLayout' that is supposed to (eventally) be a valid. If it is not a valid classname, I think that the implementation have to convert it to '/org/jnode/driver/input/KeyboardLayout'+some String+'.properties' and the problem is there in my opinion.

I wrote JUnit testcase named org.jnode.test.ResourceTest with what I understood from the SUN javadocs. Here is the results of the run :
- outside of JNode : all tests are passed.
- under JNode : some of them are failing.

I can't find yet where is exactly the problem. If someone want to work on that, let me know and assign yourself to the task.

I just found a difference

I just found a difference between the way classes are loaded compaired to getResourceAsStream. When the ClassLoader looks for a class with the loadClass method, it's as the last also calling the PluginClassLoader, but that's not the same with loading of resourcecs like property files. Using the getResourcesAsStream the ResourceBundle (or ClassLoader as the ResourceBundle calls it) don't look in the PluginClassLoader. Hereby can property files added in jar files of plugins not be found. I don't know if this is what you see, but it might have something in common.

Martin

#1

Fabien, can we close that?

#2

Title:I suspect something inconsistent probably » wrong handling of resource paths

fixed title