[MGNLCTS-68] Close stream properly in ContentTransporter.export() method. Created: 20/Apr/15 Updated: 01/Jul/15 Resolved: 20/May/15 |
|
| Status: | Closed |
| Project: | Content Translation Support |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 2.0.4 |
| Type: | Bug | Priority: | Neutral |
| Reporter: | Federico Grilli | Assignee: | Trang Truong |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | 0.5d | ||
| Time Spent: | 1d 7h | ||
| Original Estimate: | 1h | ||
| Attachments: |
|
| Template: |
|
| Acceptance criteria: |
Empty
|
| Task DoD: |
[ ]*
Doc/release notes changes? Comment present?
[ ]*
Downstream builds green?
[ ]*
Solution information and context easily available?
[ ]*
Tests
[ ]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
| Bug DoR: |
[ ]*
Steps to reproduce, expected, and actual results filled
[ ]*
Affected version filled
|
| Date of First Response: | |
| Epic Link: | Dispose of resources properly |
| Description |
|
info.magnolia.module.contenttranslationsupport.ContentTransporter.export(AbstractTranslationBundleWriter, Session, String, OutputStream) |
| Comments |
| Comment by Aleksandr Pchelintcev [ 08/May/15 ] |
|
Since the stream is provided as a method argument - I don't think it is correct to close it there. What if the caller of the method wants to write smth else to that stream? Instead I'd take care of closing that one in info.magnolia.module.contenttranslationsupport.commands.ExportCommand#execute |
| Comment by Aleksandr Pchelintcev [ 11/May/15 ] |
|
Please note that there is a separate ExportCommand in content translation module (not related to main): |
| Comment by Federico Grilli [ 12/May/15 ] |
|
Can you please add a unit test? |
| Comment by Evzen Fochr [ 20/May/15 ] |
|
Please rewrite test to not use RepositoryTestCase, its not needed here and test is much faster without it. (see atached patch.txt) |
| Comment by Trang Truong [ 20/May/15 ] |
|
Thanks! already applied |