The feature of suppressing an inspection for a statement, method or class using a comment of form
/** @noinspection DuplicateStringLiteralInspection*/
is really nice.
But when you come to write logging code, then your realize, that this granularity of inspecttion suppression does not fit your needs.
Example:
In class A you have a statement :
logger.logDebug("Created new request, identifier:"request.getIdentifier()", issuer: "+request.getIssuer());
And in class B you have a statement:
logger.logDebug("added attachment to request, identifier:"request.getIdentifier()", issuer: "+request.getIssuer());
Then the string literal ", issuer: " is detected to be a duplicate. This is correct. But i don't want to define constants for string fragments in my log statements , as this makes the code unreadable. So what you really need is the ability to define, that calls to logger.logDebug and several other methods should not be inspected for duplicate string literals.
The configuration can be done quite simple using a javadoc comment of the same form as /** @noinspection DuplicateStringLiteralInspection*/ for the logDebug method of the logger class in case the class in question is in your own source, but when the method called is implemented by a library, then a different mechanism is needed to specify which mehtods calls should not be inspected.
Another nice-to-have-feature would be the ability to specify that implemenation of a certain interface or superclass method are not inspected for duplicate string literals. This would IMHO be the case for all implementations of toString(), as these implementations are generated and all have the same forme and i definitely would not want to introduce a dependency to another class for the sake of avoiding a duplicate string literal in the implementation of toString().