RFR: Things to consider before PR
Martin Desruisseaux
duke at openjdk.org
Thu Apr 27 22:22:23 UTC 2023
On Thu, 27 Apr 2023 20:23:32 GMT, Jesper Wilhelmsson <jwilhelm at openjdk.org> wrote:
> Ok. I've added a few words to clarify that reducing code size is included in Refactoring/Cleanup. Will that cover your examples?
It is okay for me, it is not very important. I do not know if I'm the only one to think that "reducing footprint" and "improve maintainability" would have been an answer to the _"what will a cleanup actually achieve?"_ question.
On the maintainability aspect, the reason is that when relatively large method bodies are duplicated (e.g. [here](https://github.com/openjdk/jdk/blob/406021ad585eec1ec007535ed6b08c2ebffec2ee/src/java.desktop/share/classes/java/awt/image/Raster.java#L1037) versus [here](https://github.com/openjdk/jdk/blob/406021ad585eec1ec007535ed6b08c2ebffec2ee/src/java.desktop/share/classes/java/awt/image/Raster.java#L1145) where only the last line differs), if a change is applied in one method, there is a risk that the duplicated method is forgotten.
-------------
PR Comment: https://git.openjdk.org/guide/pull/101#issuecomment-1526584926
More information about the guide-dev
mailing list