PreviousNextTracker indexSee it online !

(15/27) 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:

<https://github.com/SOEN6471-jEdit/jEdit>

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>




Submitted hkisoft - 2014-04-08 00:21:08.090000 Assigned
Priority 5 Labels
Status open Group
Resolution remind

Comments

2014-04-08 16:53:08.207000
ezust

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.

https://sourceforge.net/p/jedit/plugin-bugs/1735/

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

https://sourceforge.net/p/jedit/feature-requests/269/

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.

2014-04-09 08:15:54.092000
kpouer

Hi,
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:

XSLT
MacroManager
ProjectViewer
XSearch
Tags
RFCReader
Highlight
CscopeFinder
CodeBrowser
Cipher
BufferList

That's a lot of broken plugins.

2014-04-09 18:57:27.739000
ezust

- **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.

2014-04-09 20:51:35.776000
ezust

- **status**: pending-remind --> open-remind

2014-04-10 07:58:42.442000
kpouer

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

2014-04-25 20:27:18.494000
ezust

- **assigned_to**: Alan Ezust --> nobody