Avoid Redundant ME-> Self Reference
WarningAnti-Patterns & Bad Practices#EC MERemote Enabled
Overview
Avoid self-reference ME->.
ATC Finding Message:
Avoid unnecessary ME-> reference
Rationale
Member variables and methods are already accessible inside an instance method, so prefixing every access with me-> only adds noise. Removing the prefix keeps attention on the member itself and makes genuine shadowing easier to spot. Keep me-> only where a parameter or local variable shadows the member, typically in constructors and setters.
Non-Compliant
abap
me->mv_order_count = me->mv_order_count + 1.
me->save( ).Compliant
abap
mv_order_count = mv_order_count + 1.
save( ).Configuration & Thresholds
This check can be fine-tuned directly in the ATC Check Variant Editor (CHKV) in Eclipse ADT:
| Parameter Name | Data Type | Default Value |
|---|---|---|
ALLOW_IN_CONSTRUCTORS | Boolean | true |
Suppression
To suppress findings for this rule, append the pseudo-comment to the statement:
abap
" Standard pseudo-comment:
... "#EC ME
" SAP CI_ prefix format:
... "#EC CI_METechnical Details
- Native ATC Class:
ZCL_SKYLINT_NO_ME_REFERENCE - Implementation File: zcl_skylint_no_me_reference.clas.abap