# 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-cor118 [2013/12/15 18:05]narges.tvs teaching:labs:mdse:2013:bug_descriptions:jt-bug-cor118 [2018/05/09 01:59] (current) Both sides previous revision Previous revision 2013/12/16 15:01 behnam_ghavimi 2013/12/15 18:05 narges.tvs 2013/12/09 17:19 behnam_ghavimi 2013/12/09 17:18 behnam_ghavimi 2013/12/09 17:18 behnam_ghavimi 2013/12/09 17:17 behnam_ghavimi 2013/12/09 16:02 behnam_ghavimi created Next revision Previous revision 2013/12/16 15:01 behnam_ghavimi 2013/12/15 18:05 narges.tvs 2013/12/09 17:19 behnam_ghavimi 2013/12/09 17:18 behnam_ghavimi 2013/12/09 17:18 behnam_ghavimi 2013/12/09 17:17 behnam_ghavimi 2013/12/09 16:02 behnam_ghavimi created Line 1: Line 1: + ====== Bug Cor118-(SA_LOCAL_SELF_COMPUTATION) ====== + //SA: Nonsensical self computation involving a variable (e.g., x & x)// + + ===== Inspired by ===== + + * [[http://​findbugs.sourceforge.net/​bugDescriptions.html#​SA_LOCAL_SELF_COMPUTATION | SA_LOCAL_SELF_COMPUTATION]] + + ===== Original Description ===== + + "This method performs a nonsensical computation of a local variable with another reference to the same variable (e.g., x&x or x-x). Because of the nature of the computation,​ this operation doesn'​t seem to make sense, and may indicate a typo or a logic error. Double check the computation."​ -- 2013-12-09 + + ===== Detailed Description ===== + + //When inside a method we use in both side of some special operators same local variable so always we have a fix result in these cases which makes that computation nonsense .// + + ===== Sample Problem Scenario ===== + + //In below part we have an example:// + + public class test {static int y=0; + public static void find2(int x) { + + y=x-x; + } + } + ​ + + ===== Sample Counter Scenario ===== + + //Add here a minimal example where the problem **DOES NOT** occur.// + + ​public class test {static int y=0; + public static void find2(int x) { + + x=y-y; + } + } + ​ + + + + + ===== Evaluation Results ===== + + ^  Benchmark project ​ ^  Precision ​             ^^^  Recall ​               ^^^ + |                     ​| ​ FB    |  JT    |  Delta  |  FB    |  JT    |  Delta | + |  Project ...        |  ...%  |  ...%  |  ...%   ​| ​ ...%  |  ...%  |  ...%  |  ​ + |  Project ...        |  ...%  |  ...%  |  ...%   ​| ​ ...%  |  ...%  |  ...%  | + FB = FindBugs, JT = JTransformer,​ Delta = JTransformer - FindBugs +