Clear warning state properly

Fix defect MAGN-2378 Warning don't get cleared after resolving code error.