This mostly happens when the project is not built properly (can be due to many issues such as project build properties have not been set properly, build runtime issues, file paths and location reference issues of the source files to the project, etc..). Not only in Eclipse, but in most IDEs, this happens where the line number mapping is not synced with the source code.
I suggest to first check on the build properties and env setup to (clean and) build the project properly, and then try out and see.
Cheers