# SDA SE Wiki

Software Engineering for Smart Data Analytics & Smart Data Analytics for Software Engineering

# Differences

This shows you the differences between two versions of the page.

 teaching:labs:mdse:2013:bug_descriptions:jt-bug-cor117 [2013/12/09 16:56]behnam_ghavimi teaching:labs:mdse:2013:bug_descriptions:jt-bug-cor117 [2018/05/09 01:59] (current) Both sides previous revision Previous revision 2013/12/16 15:02 behnam_ghavimi 2013/12/09 16:56 behnam_ghavimi 2013/12/09 16:46 behnam_ghavimi 2013/12/09 16:45 behnam_ghavimi 2013/12/09 16:45 behnam_ghavimi 2013/12/09 16:44 behnam_ghavimi 2013/12/09 15:59 behnam_ghavimi created Next revision Previous revision 2013/12/16 15:02 behnam_ghavimi 2013/12/09 16:56 behnam_ghavimi 2013/12/09 16:46 behnam_ghavimi 2013/12/09 16:45 behnam_ghavimi 2013/12/09 16:45 behnam_ghavimi 2013/12/09 16:44 behnam_ghavimi 2013/12/09 15:59 behnam_ghavimi created Line 1: Line 1: + ====== Bug Cor117_(SA_LOCAL_SELF_COMPARISON) ====== + //Self comparison of value with itself// + + ===== Inspired by ===== + + * [[http://​findbugs.sourceforge.net/​bugDescriptions.html#​SA_LOCAL_SELF_COMPARISON | SA_LOCAL_SELF_COMPARISON]] + + ===== Original Description ===== + + "This method compares a local variable with itself, and may indicate a typo or a logic error. Make sure that you are comparing the right things"​ -- 2013-12-09 + + ===== Detailed Description ===== + + //It will happen when we have a condition which one local element compare with itself.It seems wrong as it always true or false so it should compare with the other element.// ​ + + ===== Sample Problem Scenario ===== + + //Here we have one example for this problem(it can be occurred in while or for condition as well:// + + ​public static void find2(int x) { + int y=0; + if (x>=x){ + x=0; + } + } + ​ + + ===== Sample Counter Scenario ===== + + + public class test {static int y=0; + public static void find2(Integer x) { + + if (y>=y){ + x=0; + } + } + } + ​ + + + + + ===== Evaluation Results ===== + + ^  Benchmark project ​ ^  Precision ​             ^^^  Recall ​               ^^^ + |                     ​| ​ FB    |  JT    |  Delta  |  FB    |  JT    |  Delta | + |  Project ...        |  ...%  |  ...%  |  ...%   ​| ​ ...%  |  ...%  |  ...%  |  ​ + |  Project ...        |  ...%  |  ...%  |  ...%   ​| ​ ...%  |  ...%  |  ...%  | + FB = FindBugs, JT = JTransformer,​ Delta = JTransformer - FindBugs +