walkmod / walkmod-core

walkmod: an open source tool to fix coding style issues
http://www.walkmod.com
GNU Lesser General Public License v3.0
153 stars 23 forks source link

RemoveUnusedMethodParameters is not working for interface designs #71

Closed subisueno closed 7 years ago

subisueno commented 7 years ago

ksksk `package sonar.autofix;

public class UseLessParameter {

}

interface IService{ void serve(String userId); }

class ServiceImpl implements IService{ public void serve(String userId) { System.out.println("userId = "+userId); } } `

Now, If we run - walkmod apply sonar:RemoveUnusedMethodParameters

It often removes the last parameter / all parameters from the interface, keeping implementations unchanged. Sometimes, it removes parameters from the invocation keeping interfaces/implementations unchanged. As a result, it always produces compilation errors.

After running the command - it shows 0 mdified files but actually, modified the above file as below -

`package sonar.autofix;

public class UseLessParameter {

}

interface IService{ void serve(); }

class ServiceImpl implements IService{ public void serve(String userId) { System.out.println("userId = "+userId); } } `

rpau commented 7 years ago

Are you using multiple transformations at the same time?

subisueno commented 7 years ago

No, I am not using multiple transformation. I have run just above mentioned command. If you follow the above steps, you will be able to match the output, I have posted.

subisueno commented 7 years ago

Any update on this issue ?

rpau commented 7 years ago

No. Since the end of march, I cannot spent so much time on it. This is an open source project (not a commercial), so work on it in my spare time. You can also try to fix it, this is why it is open source. I will take a look on it during this weekend. Many PRs have been merged during the last months; and I would like to perform a more explorative test,

rpau commented 7 years ago

Fixed in walkmod-sonar-plugin

subisueno commented 7 years ago

No, It is not working too. It is not removing the unused method parameters.