History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: IDEABKL-3194
Type: New Feature New Feature
Status: Open Open
Priority: Normal Normal
Assignee: Alexey Kudravtsev
Reporter: Thomas Raugust
Votes: 0
Watchers: 2
Available Workflow Actions

Mark as Stalled
Operations

If you were logged in you would be able to see more operations.
IDEA: Backlog

inspection suppression of form: /** @noinspection DuplicateStringLiteralInspection*/ should be configurable on method-called-level

Created: 29 Jun 05 16:29   Updated: 29 Jun 05 16:58
Component/s: Code Analysis. Inspection, Code Analysis. Duplicates
Affects Version/s: None
Fix Version/s: None

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
Environment: Windows XP

Build: 3,378
Severity: Low


 Description  « Hide
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().



 All   Comments   Work Log   Change History      Sort Order:
There are no comments yet on this issue.