Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.1RC2
-
Fix Version/s: JRuby 1.5
-
Component/s: Core Classes/Modules
-
Labels:None
-
Environment:Leopard on a Core 2 Duo
-
Number of attachments :
Description
When writing some documents with REXML to a file, the output ends at around 16k, even if it's in the middle of a tag. This is not true for all documents, but for some. I guess it's an IO error (it works with StringIO), but I couldn't find anything that sounded quite like it in recent bug reports, so I hope this is not a hidden duplicate.
Steps to reproduce:
Unzip test.xml from: http://www.raschke.de/julian/xml_before_after.zip
Run: jruby -rrexml/document -e "REXML::Document.new(File.new('test.xml')).write File.new('test2.xml', 'w')"
Compare test.xml and test2.xml.
Issue Links
- is duplicated by
-
JRUBY-2475
JRuby and Builder::XmlMarkup (strange File interaction)
-
Base length limit issue still exists, but I have some info to dump here...
A few notes:
1. In current Ruby/rexml attributes with same name get overwritten:
Will get written out with only a single xxxx attribute. Both MRI and JRuby do this properly. Differences between source and dest xml of this nature are fine.
2. attribute order can swap
Both JRuby and MRI also do this...no problems here
3. File.new as case specified still has issue reported, but interestingly $stdout works fine. So this is isolated to Files. I bet we are missing an implicit close. I suspect this bug is same as
JRUBY-2305and some other bug that I cannot find, but I know was not resolved (implicit finalization IO bug). BINGO!Adding output.flush to formatters/default.rb#write solves the issue. So this is due to us not finalizing the IO object as it goes away.