The org.bson.codecs.pojo.ConventionAnnotationImpl#processPropertyAnnotations method first looks for constructors annotated with @BsonCreator then for static methods annotated with BsonCreator. But if a class contains more than one of either type, the results are unpredictable and depend on the order that the constructors or methods in the lists provided by the reflection API.
For example, a class like:
public class Person { // oops, missing BsonProperty annotation @BsonCreator Person(String name); // properly annotated @BsonCreator Person(@BsonProperty("name") String name, @BsonProperty("age") int age); // ... }
will result in an exception if the first constructor is first in the list, but not if the second constructor is first in the list.
If the intention is that at most one constructor or static method annotated with @BsonCreator is permitted, then all of them should be examined rather than breaking out of the loop on the first one.