[JAVA-3286] @BsonIgnore doesn't always work Created: 11/May/19 Updated: 28/Oct/23 Resolved: 09/Aug/19 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | BSON, POJO |
| Affects Version/s: | 3.10.1 |
| Fix Version/s: | 3.11.0 |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Mike Baranczak | Assignee: | Ross Lawley |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
I have a POJO that I want to save, with the following methods:
This causes an error:
If I change the last method name to "setSecretAsInt", I get this error:
I can make it work if I then add a dummy getter like this:
But that's just ugly, and shouldn't be necessary. If a property is marked as ignored, then the serialization code should ignore it, period. Similar bug (already fixed): https://jira.mongodb.org/browse/JAVA-2620
|
| Comments |
| Comment by Githook User [ 09/Aug/19 ] |
|
Author: {'name': 'Ross Lawley', 'email': 'ross.lawley@gmail.com', 'username': 'rozza'}Message: Delay the validation of PropertyModel type data Now ensures the conventions have been applied before
|
| Comment by Ross Lawley [ 06/Aug/19 ] |