Refactoring could fail if the warning level is not 0

15 views
Skip to first unread message

Gabriel Cotelli

unread,
Sep 19, 2011, 3:50:46 PM9/19/11
to va-sma...@googlegroups.com
Hi,
I made the following change:

RefactoryChangeManager>>ignoreChangesWhile: aBlock

"Added useWarningLevel0While: because if the warning level is not 0 the refactoring can 
fail during the execution and leave the code in an inconsistent state - g.cotelli"

Compiler useWarningLevel0While: [
isPerformingRefactoring ifTrue: [^aBlock value].
isPerformingRefactoring := true.
aBlock ensure: [isPerformingRefactoring := false]]

to avoid some failure doing refactorings when the warning level is for example at 2. To reproduce perform a refactoring that needs to change a method that raises a warning at the current level (but not at 0). Without the Compiler userWarningLevel0While:  the refactoring fails in the middle of the execution leaving the code in an inconsistent state.

Feel free to integrate this change.

Regards,
Gabriel
Reply all
Reply to author
Forward
0 new messages