#522 jEdit 5.1.0 - Refactoring of some code smells detected in org.gjt.sp.jedit.search package


We as an academic team studying at Concordia university, Montreal, Canada have conducted a project on jEdit in order to detect substantials code smells and refactor them from the code. following is the summary of our work so far:

1- Detected and refactored one instance of God class code smell (see section 2.1.1 of [1])
2- Detected and refactored one instance of InstanceOf code smell (see Section 2.1.2 of [1])
3- Detected and refactored one instance of Long Method code smell (see Section 2.1.3 of [1])
4 Refactored Implicit dependency of Static methods (see section 2.1.4 of [1])

[1] jEdit Milestone #3 (PDF) - http://goo.gl/Q7sFMq
In this document we have explained in detail the symptoms of code smell, their effect on the jEdit and detailed steps required to refactor them.

We have used GitHub for creating the patchset and diff files, however version 5.1.0 of jEdit was our base version for making this modification, following is the URL of our GitHub repository:


The patchset and diff file for mentioned changes are attached to this patch request, the changelog for this changes (PDF) is located here: http://goo.gl/6R4B6r

2 Attachments


  • Alan Ezust

    Alan Ezust - 2014-04-08

    Couple of comments.
    1- we're just about to branch 5.2.x and bump trunk to 5.3pre1 sometime before end of may. think this should go into 5.3pre1 after that.

    2- Have you tested against XSearch plugin? Are you willing to update/fix it if it is broken by your patch?

    3- Have you looked at any of the current open bugs against Search and Replace? Does your patch address any of them?

    There is one that is kinda caused by the state-nature of the god object, but that is actually in plugin-bugs.


    Here is a feature request of mine that I hope can be addressed after the redesign:


    4- I think the new classes like Search and Replace should should go into org.jedit.search package instead of org.gjt.sp.jedit.search since this is a new API.

    5- the refactored code has old API doc comments that need to be updated.

    Last edit: Alan Ezust 2014-04-09
    • Matthieu Casanova

      not only XSearch, I did not read the patch entirely but I understand the SearchAndReplace class will be removed and replaced by a Search and a Replace class.
      The following plugins are using SearchAndReplace class:


      That's a lot of broken plugins.

  • Alan Ezust

    Alan Ezust - 2014-04-09
    • status: open --> pending-remind
      In general, I like the direction this patch is going, but questions need to be answered and some issues need to be addressed.
    Last edit: Alan Ezust 2014-04-09
  • Alan Ezust

    Alan Ezust - 2014-04-09
    • status: pending-remind --> open-remind
  • Matthieu Casanova

    About broken plugins, a solution could be to create a SearchAndReplace marked as deprecated class that would delegate everything to the new classes. That class could be in a plugin that would keep compatibility for plugins that were not migrated

  • Alan Ezust

    Alan Ezust - 2014-04-25
    • assigned_to: Alan Ezust --> nobody

Log in to post a comment.