Bug in JDK

来源:互联网 发布:淘宝侵犯商标权 编辑:程序博客网 时间:2024/06/06 18:13

在JDK中, DocumentBuilder类的其中一个parse方法如下。

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

 

What do you guys think?

 

 

    public Documentparse(File f) throws SAXException, IOException{

       if (f == null) {

           throw newIllegalArgumentException("File cannot be null");

       }

 

       //convertfile to appropriate URI, f.toURI().toASCIIString()

        //converts theURI to string as per rule specified in

       //RFC2396,

       InputSourcein = new InputSource(f.toURI().toASCIIString());  

        return parse(in);

}

 

 

各位如果有不同意见可以跟帖。

原创粉丝点击