[JAVA-2591] Bug report from twitter (outdated comments) Created: 30/Aug/17 Updated: 27/Oct/23 Resolved: 30/Aug/17 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Jay Gordon | Assignee: | Unassigned |
| Resolution: | Works as Designed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
Kfir Bloch @kfirondev — Please review if there are any portions in the driver that have outdated comments. thank you. |
| Comments |
| Comment by Ross Lawley [ 04/Sep/17 ] |
|
I replied back on the twitter post and linked back to this ticket. |
| Comment by Jay Gordon [ 30/Aug/17 ] |
|
can you just follow up on your own question? thanks! |
| Comment by Jeffrey Yemin [ 30/Aug/17 ] |
|
I see that it's confusing, but there's a reason. The DBCollection javadoc references the deprecated DB Mongo.getDB(String) method because a DB instance is the only way to get an instance of DBCollection. The question is: why aren't DB and DBCollection deprecated also? When we introduced the new CRUD API (MongoDatabase MongoClient.getDatabase(String)) in the 3.0 driver we had to decide what to do about the existing DB/DBCollection CRUD API. We wanted to gently nudge people towards the new CRUD API but at the same time not make it too painful for existing applications to upgrade to the 3.x driver. We decided the best compromise was to only deprecate the entry point into the old API, which is the DB Mongo.getDB(String) method. That way applications would get a warning at every entry point, but not on every line of code that used the old API. So that's why DBCollection itself is not deprecated, and why its javadoc references a deprecated method. I hope this clears it up. Please let us know if there are any other instances of this besides the one you pointed out. |