- Operating system: Windows 11
- SonarLint plugin version: 8.4.0.73538
- Programming language you’re coding in: java
- Is connected mode used: No
I’ve created a custom annotation @Job
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Inherited
@Component
public @interface Job {
...
}
Spring support classes annotated with this kind of annotation and consider them as beans. Spring do constructors injection as it were real component (and they are!)
But I have this SonarLint rule infraction java:S107:
@Job(JobName.FtpsRetry)
public class FtpsRetryJobFactory implements JobFactory {
(...)
@Autowired
// Here I have the SonarLint warning
public FtpsRetryJobFactory(UserManager userManager,
PCPWorkflowService workflowService,
@Qualifier("associatedFileManagerImpl") AssociatedFileManager associatedFileManager,
HistoryManager historyManager,
ConfigurationManager configurationManager,
NotificationModeles notificationModeles,
MailManager mailManager,
CommentManager commentManager,
DocumentActionManager documentActionManager,
DocumentManager documentManager,
CircuitManager circuitManager) {
(...)
}
(...)
}