Actual Method Parameter Is the Same Constant  

 


Actual Method Parameter Is the Same Constant  °Ë»ç´Â ±×µéÀÇ ¸Å°³ º¯¼ö¿¡ ´ëÇÑ °°Àº »ó¼ö°ª°ú ÇÔ²² ºÒ·ÁÁö´Â ¸Þ¼Òµå¸¦ ã½À´Ï´Ù.

¸¸ÀÏ Actual method parameter is the same constant  Ã¼Å© ¹Ú½º°¡ ¼±Åõǰí Inspection ÀÌ ¾î¶² ¹®Á¦¸¦ ã´Â´Ù¸é Inspection Åø À©µµ¿ì´Â ½ÇÁ¦ ¸Å°³º¯¼ö °ªÀÌ Ç×»ó °°Àº °ÍÀÎ ¸Þ¼Òµå¸¦ º¸¿©ÁÖ´Â Same parameter value ÅÇÀ» Ç¥½ÃÇÕ´Ï´Ù.

ÀÌ °Ë»ç¿¡ ÀÇÇØ ¹ß°ßµÈ ¹®Á¦¿¡ ´ëÇÑ ¾î¶² »çÀü Á¤ÀÇÀÇ ¼Ö·ç¼Çµµ ¾ø½À´Ï´Ù


ÀÌ °Ë»ç´Â ¾î¶² ¿É¼Çµµ °¡ÁöÁö ¾Ê½À´Ï´Ù.


 

»ç¿ë ¿¹



´ÙÀ½ Ŭ·¡½º¸¦ º¸½Ê½Ã¿À:

 
public class AClass {
 
    public void methodA(int A, boolean B) {
        //some code here
    }
 
    public void method1() {
        //some code here
 
        methodA(1, false);
 
        //some code here
 
        methodA(2, false);
    }
}
 

Inspection ÀÌ AClass ¿¡ Àû¿ëµÇ°í ³­ ÈÄ¿¡´ÙÀ½ÀÇ Åø À©µµ¿ì°¡ ³ªÅ¸³¯ °ÍÀÔ´Ï´Ù.



±× ½ÇÁ¦ °ªÀÌ ¸ðµç ¸Þ¼Òµå ÄÝ¿¡¼­ °°Àº °ÍÀ̱⠶§¹®¿¡ B ¸Å°³ º¯¼ö´Â ÁöÀûµË´Ï´Ù.