I've written an API for the navigation and the below line of code is throwing a sonarlint error "Refactor this code to use a 'static final' pattern".
Can someone tell me what is the issue if we replace the special characters like above? And how to resolve it?
Views
Replies
Total Likes
Hello @goyalkritika ,
A Pattern is compiled from a String literal or constant and is not stored in a static final reference.
Here is a recommended way to write your code. Follow this ticket-> https://sonarsource.atlassian.net/browse/RSPEC-4248
@Sady_Rifat I tried making the 'str' variable private static, but it is not accepting it.
Can you think of any other solution to resolve this issue?
Please refer to the below thread for this issue.
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies