Community
Participate
Working Groups
Build ID: I20070621-1340 Steps To Reproduce: If the ant build file to be imported (build.xml) has a Byte Order Mark (BOM) (example build_BOM.xml) as it's first character than the import in the second file (build-dist.xml) fails. Import file "build_BOM.xml" in the "build-dist.xml" gives this errors: - Content is not allowed in prolog. Test build-dist.xml line 1 - Target build does not exist in this project Test build-dist.xml line 5 Change the import statement to "build.xml" and the errors are gone. The only difference is that build_BOM.xml includes a BOM character (eclipse shows it in the properties of a file, but not in the editor. Eclipse 3.3, Java 1.6, Windows XP More information:
Created attachment 73334 [details] file to be imported
Created attachment 73335 [details] file to be imported with BOM charater
Created attachment 73336 [details] this file has the import statement
Thank you for the bug report. I can reproduce and will investigate.
A zipped BOM file is available for testing in bug 61564.
Created attachment 99927 [details] patch problem: parser in ProjectHelper#parse throws SAXParseException when imported file (with byte order mark) is read by FileReader passed to InputSource reason: javadoc http://java.sun.com/j2se/1.4.2/docs/api/org/xml/sax/InputSource.html#InputSource(java.io.Reader) states: "The character stream shall not include a byte order mark." solution (in this patch): use file input stream instead of file reader patch includes test case for org.eclipse.ant.tests.ui link: http://unicode.org/faq/utf_bom.html#BOM
Thanks Martin. I will review.
Please adjust the target milestone, so it does not point at a closed milestone in the past.
Martin's fix has been released but from my testing only works on VMs newer than 1.4.* therefore I tweaked the new test to only run on 1.5 or newer. Changes to: ProjectHelper to use input streams instead of readers AntEditorTests: add new test for this problem on 1.5 or newer ProjectCreationDecorator: add ability to check if 1.5 or newer and close welcome intro Added 2 test files: importWithByteOrderMark.xml and toBeImportedWithByteOrderMark.xml
Please verify Michael.
Thank you darin for using my fix, i hope it helped a little bit
verified