您的位置:首页 > 编程语言 > Java开发

Bug in JDK

2011-04-06 18:00 225 查看
在JDK中, DocumentBuilder类的其中一个parse方法如下。

我认为如果在文件路径中包含如日文中文,这个函数无法正常工作。

 

What do you guys think?
 
 
    public Document
parse(File f) throws SAXException, IOException
{
       
if (f == null) {
           
throw new
IllegalArgumentException("File cannot be null");
       
}
 
       
//convert
file to appropriate URI, f.toURI().toASCIIString()
        //converts the
URI to string as per rule specified in
       
//RFC
2396,
       
InputSource
in = new InputSource(f.toURI().toASCIIString());  

        return parse(in);
}
 
 
各位如果有不同意见可以跟帖。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  jdk null file string 工作