Menu

#278 fix for NPE in XSLProcessor.getInputStream

Release 3.0.2
open
nobody
5
2006-11-11
2006-11-11
No

in getInputStream(String path) there's a block of code that reads:

if (file == null)
{
ClassLoader cl = getClass().getClassLoader();
if (cl == null)
{
file = ClassLoader.getSystemClassLoader().getResourceAsStream
(targetFile);
}
else
{
file = getClass().getClassLoader().getResourceAsStream
(targetFile);
}
file = getClass().getClassLoader().getResourceAsStream
(targetFile);
}

the problem is the last attempt to assign the file (line 363) is erroneous
and will cause an NPE whenever getClass().getClassLoader() returns null.
Looks like someone tried to fix this bug, added the code to handle the
null case, but forgot to remove the original line.

in my local code I've removed the offending line and then the code works
as expected.

Discussion


Log in to post a comment.