2016-12-06 17:53 GMT+01:00 Denis Kudriashov <[email protected]>: > > 2016-12-06 17:16 GMT+01:00 John Brant <[email protected]>: > >> > For me it is too intelligent now because it is tried to create new >> version of accessors instead of existing one. >> > But simple logic should just analyze method name and if accessor >> already exists it should skip it >> >> That isn’t a refactoring. The existing methods aren’t accessors. The >> refactoring will find accessors for the variables if they exist (even if >> they have a different names). >> > > We all know what is refactoring. Usually we don't care about safe aspect > of it (and we have tests). We just want simple code transformation. I think > it is exactly such case. > Also after applying override browser shows it with special icon. And user > could see it. > > >> >> New accessors can’t override an existing method, for example #name, since >> that would change the behavior of the #name method for that object. If you >> are suggesting not creating the accessor method for the “myInstVar >> ^myInstVar ifNil: [#someValue]” method, then you’ll need to change the >> abstract variable refactorings so that they no longer use the modified >> create accessors refactoring. > > > We could make it configurable. "Manually" accessors will be generated in > simplified mode and related refactorings will use intelligent mode >
The whole refactoring engine is pretty well written, we should take care to not fix the wrong places (this has been done already in the past by people (including me) not understanding the framework well enough).
