#18853 closed defect (fixed)
[PATCH] Close OsmWriter after writing XML output streams (Sonar)
| Reported by: | hiddewie | Owned by: | team |
|---|---|---|---|
| Priority: | minor | Milestone: | 20.03 |
| Component: | Core | Version: | |
| Keywords: | Cc: |
Description
Patch attached. A few cases of using an OsmWriter were not closing resources.
See https://josm.openstreetmap.de/sonar/project/issues?id=josm&open=AWNZyLUQKE_UNurjNkdy&resolved=false&severities=BLOCKER&types=BUG and https://josm.openstreetmap.de/sonar/project/issues?id=josm&open=AW1u4lFzJXjdhKcaOBMY&resolved=false&severities=BLOCKER&types=BUG
Attachments (1)
Change History (8)
by , 6 years ago
| Attachment: | osm-writer.patch added |
|---|
comment:1 by , 6 years ago
| Summary: | [PATCH] Close OsmWriter after writing XML output streams → [PATCH] Close OsmWriter after writing XML output streams (Sonar) |
|---|
comment:2 by , 6 years ago
| Milestone: | → 20.03 |
|---|---|
| Priority: | trivial → minor |
comment:3 by , 6 years ago
| Type: | enhancement → defect |
|---|
comment:4 by , 6 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
comment:5 by , 6 years ago
Thanks for the patch! I only applied ValidatorErrorWriter, because stream is not meant to be closed in OsmDataSessionExporter.
comment:6 by , 6 years ago
OK, good to know. In OsmDataSessionExporter: the stream should maybe not be closed, but the it would be logical to close the associated writers (without closing the stream) in the scope where they are created.
comment:7 by , 6 years ago
I did not check, but I think the stream is closed if you close the writer.



In 16088/josm: