After looking at the following question at StackOverflow, I attempted to reproduce the described use case and experienced it exactly as described:
This issue was reproduced on Eclipse Oxygen.2 Release (4.7.2) with SonarLint 3.5.0. I also tried this use case in IntelliJ, but the issue was not encountered.
Steps to reproduce :