-
Type: Bug
-
Resolution: Works as Designed
-
Priority: Minor - P4
-
None
-
Affects Version/s: 4.6.1
-
Component/s: Codecs
-
None
Summary
When using codecs with a POJO, any extra methods beginning with the keyword get or set will trigger exceptions, even if the method is marked with the @BsonIgnore annotation.
Please provide the version of the driver. If applicable, please provide the MongoDB server version and topology (standalone, replica set, or sharded cluster).
4.6.1
How to Reproduce
Steps to reproduce. If possible, please include a Short, Self Contained, Correct (Compilable), Example.
public class User {
@BsonId
private ObjectId mongoID;
@BsonIgnore
public User setMongoID (String mongoID) {
this.mongoID = new ObjectId(mongoID);
return this;
}
public User setMongoID (ObjectId mongoID) {
this.mongoID = mongoID;
return this;
}
public ObjectId getMongoID() {
return mongoID;
}
}
Additional Background
Please provide any additional background information that may be helpful in diagnosing the bug.
- is related to
-
JAVA-4479 Issue with setter of different type than field
- Backlog