#445 MultipleStringLiterals checks w/in Annotations

Future
closed
nobody
Check (274)
5
2016-02-28
2007-01-09
No

MultipleStringLiterals currently checks for duplicate strings within Annotations.

It would be nice if it supported a parameter to disable this.

The case I ran into was that I was exposing two different methods to JMX via spring annotations. Both methods took a "category" parameter with description "Logging category.". In this case, though it would work, it doesn't seem to be valuable to declare a private constant for this parameter name and description.

@ManagedOperation(description = "Get the current log level.")
@ManagedOperationParameter(name = "category", description = "Logging category.")

and

@ManagedOperation(description = "Set the log level for the given category.")
@ManagedOperationParameters({
    @ManagedOperationParameter(
        name = "category", 
        description = "Logging category."), 
    @ManagedOperationParameter(
        name = "logLevel", 
        description = "The new log level: ALL, TRACE, DEBUG, INFO, WARN, ERROR, FATAL, or OFF")
})

Both "category" and "Logging category." were flagged as duplicate Strings.

Discussion

  • Roman Ivanov

    Roman Ivanov - 2016-02-28
    • status: open --> closed
    • Group: --> Future
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks