Open cmd prompt > go to project directory > type command and press enter key > walkmod apply sonar:RemoveUselessVariables
Project has a sample Java class for removing Unused Variable -
package sonar.autofix;
public class MyServiceImpl {
private String name;// unused
private int id;// unused
}
Expected Output - Code Transformation Chain should result in "SUCCESS" and unused variables should get automatically removed.
Actual Output -
Unused variables are not removed.
Below Console output produced -
INFO [main] - THE TRANSFORMATION CHAIN sonar:RemoveUselessVariables STARTS
--------------------------------------------------------------------------------
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
INFO [main] - No sources changed
INFO [main] - TRANSFORMATION CHAIN SUCCESS
--------------------------------------------------------------------------------
INFO [main] - Total time: 4.653 seconds
INFO [main] - Finished at: Wed, 5 Jul 2017 18:06:46
INFO [main] - Final memory: 181 M/ 266 M
INFO [main] - Total modified files: 0
--------------------------------------------------------------------------------
Analysis -
As it has Failed to load class "org.slf4j.impl.StaticLoggerBinder", so it is evident some jar is missing in the classpath.
Now, question is which jar it expects to be downloaded ? I can check the console in details to see if that jar is downloaded and if not then how to add that jar file in the ivy list to be included ?
Steps to reproduce -
Open cmd prompt > go to project directory > type command and press enter key > walkmod apply sonar:RemoveUselessVariables
Project has a sample Java class for removing Unused Variable - package sonar.autofix;
public class MyServiceImpl {
}
Expected Output - Code Transformation Chain should result in "SUCCESS" and unused variables should get automatically removed.
Actual Output - Unused variables are not removed. Below Console output produced -
Analysis - As it has Failed to load class "org.slf4j.impl.StaticLoggerBinder", so it is evident some jar is missing in the classpath. Now, question is which jar it expects to be downloaded ? I can check the console in details to see if that jar is downloaded and if not then how to add that jar file in the ivy list to be included ?