Avoid Method Override That Only Delegates to Super
WarningAnti-Patterns & Bad Practices#EC NO_EMPTY_OVERRIDERemote Enabled
Overview
Avoid method override that only calls super.
ATC Finding Message:
Empty method override; method only delegates to super
Rationale
Redefining a method only to immediately call the superclass method without performing any additional initialization, logging, argument transformation, or side effect is redundant. It clutters the method implementation, adds needless call stack overhead, and requires maintenance whenever super signatures change. Omit the empty override and let polymorphism delegate to the superclass naturally.
Non-Compliant
abap
METHOD do_work.
super->do_work( ).
ENDMETHOD.Compliant
abap
" Omit method redefinition and let superclass handle execution naturallyConfiguration & Thresholds
This check can be fine-tuned directly in the ATC Check Variant Editor (CHKV) in Eclipse ADT:
| Parameter Name | Data Type | Default Value | Description & Guidance |
|---|---|---|---|
IGNORE_CTOR | Boolean | true | Ignore empty constructor redefinitions (when only calling super->constructor) |
IGNORE_CHECK | Boolean | true | Ignore empty redefinitions in test classes or abstract interfaces |
Suppression
To suppress findings for this rule, append the pseudo-comment to the statement:
abap
" Standard pseudo-comment:
... "#EC NO_EMPTY_OVERRIDE
" SAP CI_ prefix format:
... "#EC CI_NO_EMPTY_OVERRIDERelated Rules
- Avoid FRIENDS in class definitions —
#EC NO_FRIENDS - Avoid Purely Static Utility Classes —
#EC NO_STATIC_CLS - Avoid Calling Static Methods via Instance References (->) —
#EC NO_STATIC_ARROW
Technical Details
- Native ATC Class:
ZCL_SKYLINT_NO_EMPTY_OVERRIDE - Implementation File: zcl_skylint_no_empty_override.clas.abap