[JAVA-453] GridFSFile does not implement equals(...)/hashCode() Created: 19/Oct/11  Updated: 04/Aug/16  Resolved: 04/Aug/16

Status: Closed
Project: Java Driver
Component/s: API
Affects Version/s: 2.6.5
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Oliver Gierke Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

The GridFsFile class does not implement equals(...) and hashCode() so that comparing two instances of the class actually representing the very same file will not answer equals(...) with true. Also problematic when dealing with collections of GridFsFile instances.



 Comments   
Comment by Jeffrey Yemin [ 04/Aug/16 ]

GridFS and GridFSFile have been effectively deprecated in favor of com.mongodb.client.gridfs.GridFSBucket, which has no equivalent to GridFSFile. Since GridFS files are immutable, equality checks can be accomplished in the new API by comparing the _id values of files.

Generated at Thu Feb 08 08:52:19 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.