|
Unused Method Parameters
|
|
|
|
|
|
Unused Method Parameters 검사는 넘어가는 매개 변수가 무시되는 메소드의 존재 위에서 당신의 코드를 분석합니다.
1. methodA 를 선언하는 인터페이스 package aPackage; public interface AnInterface
{ void methodA(int myInt, boolean myBoolean); } 2. 그리고 이 인터페이스를 구현하는 2 클래스 - AClass: package aPackage; public class AClass implements AnInterface{ public void methodA(int myInt, boolean myBoolean)
{ int aField =
myInt;
//some code here } } 3. 그리고 AClassTwo package aPackage; public class AClassTwo
implements AnInterface
{ public void methodA(int myInt, boolean myBoolean)
{
//some code here where the myBoolean is not
used } }
인터페이스와 양쪽의 파생 클래스와 Inspection 에서 사용되지 않은 myBoolean 매개 변수는 그것을 완전히 제거하는 것을 제안합니다. |