Find Usages : When a variable is declared and initialized this is not marked as a 'write'

I would argue that is a bug.

Given:

   public void simple1() {
        Boolean example1;
        example1= new Boolean(true);
        example1 = Boolean.FALSE;
    }

As Expected,
Performing a find usages on the local variable example1 will find 2 'Value Writes'.

However, Given:

  public void simple2()  {
        Boolean example2= new Boolean(true);
        example2 = Boolean.FALSE;
    }


Surprisingly,
Performing a find usages on the local variable example2 will find  only 1 'Value Writes'. I would have expected 2 'Value Writes' as in the previous example

The same holds true for fields.

I would like to know every place a variable receives a value even if it is a declaration time.
This is for IJ 32 bit 12.0, running under JDK 1.7.0_11, for Windows 8 64 Bit.

0

请先登录再写评论。