I've found the solution. That class had a custom add()
method that rewrote the file everytime something was added. At the beginning of the loop there were 100 entries, but after it executed once only one entry was left. There was also some extra code that had always added those missing 99 entries.
Replacing add()
with super.add()
solved the problem.