Fix concurrent exception and upload the same file

This commit is contained in:
J-Jamet committed 2020-08-25 12:39:17 +02:00
1 parent 9cf59b8d73
commit 4bd3bdaddf
2 files changed
+7 -10

No files matched your search

@@ -40,24 +40,21 @@ data class EntryAttachment(var name: String,
return 0
}
override fun toString(): String {
return "$name at $binaryAttachment"
}
override fun equals(other: Any?): Boolean {
if (this === other) return true
if (other !is EntryAttachment) return false
if (name != other.name) return false
if (binaryAttachment != other.binaryAttachment) return false
return true
}
override fun hashCode(): Int {
var result = name.hashCode()
result = 31 * result + binaryAttachment.hashCode()
return result
}
override fun toString(): String {
return "$name at $binaryAttachment"
return name.hashCode()
}
companion object CREATOR : Parcelable.Creator<EntryAttachment> {
@@ -39,15 +39,15 @@ import com.kunzisoft.keepass.utils.UriUtil
import kotlinx.coroutines.*
import java.io.BufferedInputStream
import java.util.*
import java.util.concurrent.CopyOnWriteArrayList
import java.util.zip.GZIPInputStream
import java.util.zip.GZIPOutputStream
import kotlin.collections.ArrayList
class AttachmentFileNotificationService: LockNotificationService() {
override val notificationId: Int = 10000
private val attachmentNotificationList = ArrayList<AttachmentNotification>()
private val attachmentNotificationList = CopyOnWriteArrayList<AttachmentNotification>()
private var mActionTaskBinder = ActionTaskBinder()
private var mActionTaskListeners = LinkedList<ActionTaskListener>()