You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following code has six superfluous me->s, four of which are for method calls, which is what the check claims it detects:
classcl definition.
public section.
methods meth_1
returningvalue(result) type i.
methods meth_2
importing param type i.
methods do.
private section.
datavalue type i.
endclass.
classcl implementation.
methoddo.
me->meth_1( ).
data(var_1) =me->meth_1( ).
callmethodme->meth_1
receivingresult=data(var_2).
meth_2( me->meth_1( ) ).
data(var_3) =me->value.
meth_2( me->value ).
endmethod.
methodmeth_1.
endmethod.
methodmeth_2.
endmethod.
endclass.
The current implementation of Y_CHECK_SELF_REFERENCE emits a finding for the first, fourth and sixth occurence of me->. This means that the check does not detect all references that it claims it detects and also that it detects usages of me-> it doesn't claim to detect (the Clean ABAP guide was only recently changed to advise against all usages of me-> and not only for methods).
The check should be reworked to be more consistent (and if it keeps emitting findings for attributes, it also needs to check that there is no aliasing local variable in scope that makes the me-> necessary).
The text was updated successfully, but these errors were encountered:
Check: Self-reference
The following code has six superfluous
me->
s, four of which are for method calls, which is what the check claims it detects:The current implementation of Y_CHECK_SELF_REFERENCE emits a finding for the first, fourth and sixth occurence of
me->
. This means that the check does not detect all references that it claims it detects and also that it detects usages ofme->
it doesn't claim to detect (the Clean ABAP guide was only recently changed to advise against all usages ofme->
and not only for methods).The check should be reworked to be more consistent (and if it keeps emitting findings for attributes, it also needs to check that there is no aliasing local variable in scope that makes the
me->
necessary).The text was updated successfully, but these errors were encountered: