Why is this an issue?

According to Spring documentation, the @Scheduled annotation can only be applied to methods without arguments. Applying @Scheduled to a method with arguments will result in a runtime error.

How to fix it

Transform method annotated with @Scheduled into a no-arg method.

Code examples

Noncompliant code example

public class ExampleService {

    @Scheduled(fixedRate = 5000)
    public void scheduledTask(String param) { // non compliant, method has an argument. It will raise a runtime error.
        // Task implementation
    }
}

Compliant solution

public class ExampleService {

    @Scheduled(fixedRate = 5000)
    public void scheduledTask() { // compliant, no-arg method
        // Task implementation
    }
}

Resources

Documentation