OpenLiberty / liberty-tools-intellij

IntelliJ IDEA extension for Liberty
https://plugins.jetbrains.com/plugin/14856-open-liberty-tools
Eclipse Public License 2.0
11 stars 20 forks source link

Refactor duplicated code and functionally equivalent patterns in the language clients. #754

Open mrglavas opened 1 month ago

mrglavas commented 1 month ago

This is an umbrella for more focused clean-up tasks.

https://github.com/OpenLiberty/liberty-tools-intellij/pull/750 is an example where we applied a fix to duplicate code in more than 20 places. This code which sets the WorkspaceEdit and handles exceptions should be extracted into its own method so that there's only one copy. Both MicroProfile and Jakarta EE quick fixes have this duplicated block of code.

We should look for other instances of duplication across the language clients and refactor to reduce this duplication as well. This would also include blocks of functionally equivalent code that may have been written independently that serve the same purpose or have overlap that they could be refactored into a unified set of classes/methods.