Considering the following:
- The keyword
this
can only be used inside an instance method, i.e. in a method which is executed on an existing object.
this
refers to the object on which the method is called
this
is read-only (cannot explicitly assign null to it for example).
- Calling an instance method on a null object would result in an exception.
Therefore, it is guaranteed that this
is never null.
The compiler warning helps you to identify code which makes no sense or code which is never be executed.
EDIT: About error / warning behavior of eclipse kepler, see eclipse-kepler-shows-error-marks-on-warnings