mirror of
https://github.com/ushahidi/SMSSync.git
synced 2026-04-26 08:15:56 +03:00
[GH-ISSUE #375] smssync_log file only ever has one line in it #270
Labels
No labels
Bug report
Code improvement
Concern
Feature request
Feature request
Good first issue to work on
In progress
Needs info
Question
Ready
Translation
User Experience
User Experience
Website
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/SMSSync#270
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @alxndrsn on GitHub (Apr 6, 2016).
Original GitHub issue: https://github.com/ushahidi/SMSSync/issues/375
The file
smssync_logis written to SD card byFileManager, which appears to be a singleton. Every append toFileManagerin the current codebase callsFileManager.appendAndClose(), which closes the underlyingPrintWriter. From the Java 7 JavaDoc, closing aPrintWritermultiple times will have no effect (the Android JavaDoc makes no mention of this). The effect of appending to a closedPrintWriteris not documented, but from experimentation it seems to have no effect. This may explain why this bug has not been noticed.The obvious fix for this is to change all calls to
appendAndClose()toappend().@alxndrsn commented on GitHub (Apr 6, 2016):
Ah yes, from the
PrintWriterdocs: