Locate duplicate
L.D. doesn't see any duplication in the code below:
(options: see attached screen copy)
public class Foo
{
public void test1 ()
{
String s = null;
Object n = s;
System.out.println ("1");
System.out.println ("2");
System.out.println (n);
}
public void test2() {
Object n = null;
System.out.println ("1");
System.out.println ("2");
System.out.println (n);
}
}
Note: if you change the code a little - see below -, it now detects correctly the 2 duplicated lines
public void test1 ()
{
String s = null;
System.out.println ("1");
System.out.println ("2");
Object n = s; <<----------- moved
System.out.println (n);
}
I had code like this
3-line block ABC <-- DUPE
stuff <------------- to be removed manually later
1-line block D
...
3-line block ABC <-- DUPE
1-line block D
, where IDEA correctly located the duplicated 3-line blocks.
I then removed the 'stuff', and IDEA couldn't find any duplication in :
4-line block ABCD <-- DUPE not found : bug
...
4-line block ABCD <-- DUPE not found : bug