Hello @armandino and welcome to the Sonar Community!
The use case you are describing should be supported, with a small trick:
We are relying on “.class” for resolving the constants. It means that if you just added a constant in another file, we will not be able to find it. If you build the project, the issue should disappear as expected.
Hi @Quentin, thanks for suggestion. Unfortunately it still doesn’t work for me. I did a full build, but I still see an unsuppressed warning when I replace a String literal with a constant.
Could you share more information concerning the issue? Ideally, a minimal code sample reproducing the issue? In addition, it would help to have the constant definition and its exact location.
Hi Quentin, happy to report, the problem was on my end. As I was creating a sample project I realised that it is working, just slow to reflect in the IDE. The warning stays on for some time after the build, then eventually disappears. It disappeared much faster in an empty project