lishijie211 / mb-unit

Automatically exported from code.google.com/p/mb-unit
0 stars 0 forks source link

Overrides of non-abstract virtual methods should invoke the base method by default #762

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Many of the methods that override an inherited virtual method do not invoke the 
base class' implementation as part of the override. This is especially common 
for methods that override a base method that currently does nothing.

Classes that override a method without invoking the base class' implementation 
of the method could potentially break if the inherited method's implementation 
changes. (Of course, some overrides are intended to completely override and 
replace the inherited method's behavior, but for other method overrides the 
missing base method invocation is probably an unintentional oversight.)

Examples of virtual methods that have overrides that may be unintentionally 
skipping the base method invocation include:
1. PatternAttribute.public virtual void Consume(IPatternScope containingScope, 
ICodeElementInfo codeElement, bool skipChildren)
2. PatternAttribute.public virtual void Process(IPatternScope scope, 
ICodeElementInfo codeElement)
3. TestExplorer.public virtual void Finish()

Original issue reported on code.google.com by justin.w...@gmail.com on 21 Oct 2010 at 8:25

GoogleCodeExporter commented 9 years ago
Update: I added TODO comments ("//TODO: Review: Issue 762: ...") to mark 24 
locations that need to be reviewed for possible changes/fixes as described 
above. See revision 3125.

Original comment by justin.w...@gmail.com on 2 Mar 2011 at 6:45