As mentioned, I want to reuse a locally declared variable and use its value in the extension method.
Example
protected boolean checkTaxCodesByLine()
{
TaxCode lastTaxCode;
lastTaxCode = taxWorkTrans.TaxCode;
}
Extension method
public TaxTable taxTable;
protected boolean checkTaxCodesByLine()
{
next checkTaxCodesByLine() ;
taxTable = this.getTaxTable(lastTaxCode);
return true;
}