Clone Digger Eclipse plugin not working properly

104 views
Skip to first unread message

zpcspm

unread,
Dec 26, 2008, 2:44:10 PM12/26/08
to Clone Digger general
I've tried to use the Clone Digger plugin with Eclipse (version 3.4.1)
on Slackware Linux 12.2.
Java version:
$ java -version
java version "1.6.0_11"
Java(TM) SE Runtime Environment (build 1.6.0_11-b03)
Java HotSpot(TM) Client VM (build 11.0-b16, mixed mode, sharing)

I've started Eclipse, went to "Help -> Software Updates" and added the
URL for the update site as the Eclipse plugin manual suggests.
In the "Available Software" tag there were two versions of the plugin
- 1.0.8 and 1.1.6. I've installed the latest one. Everything went
smoothly, Clone Digger was downloaded.
I've restarted Eclipse and a "Clone digger" item appeared in main
menu.
I've created a trivial PyDev project (nothing fancy, just one module
and one package) and I've run Clone Digger against it. I've used
default dig options.

This is the log I saw:

--- cut here ---
Running clonedigger...

Parsing /home/shadow/workspace/efm/src/efm.py ... done
Parsing /home/shadow/workspace/efm/src/efmlib/__init__.py ... done
Parsing /home/shadow/workspace/efm/src/test.py ... done
2 sequences
average sequence length: 4.500000
maximum sequence length: 5
Number of statements: 9
Calculating size for each statement... done
Building statement hash... done
Number of different hash values: 7
Building patterns... 7 patterns were discovered
Choosing pattern for each statement... done
Finding similar sequences of statements... 0 sequences were found
Refining candidates... 0 clones were found
Removing dominated clones... 0 clones were removed

Press finish to view results...
--- cut here ---

This is well, I get the same if I run Clone Digger manually from
console against /home/shadow/workspace/efm

When I've pressed the "Finish" button, I've got the following
traceback:

--- cut here ---
java.lang.NullPointerException
at org.clonedigger.ResultBrowser.createPartControl(ResultBrowser.java:
173)
at org.eclipse.ui.internal.EditorReference.createPartHelper
(EditorReference.java:661)
at org.eclipse.ui.internal.EditorReference.createPart
(EditorReference.java:428)
at org.eclipse.ui.internal.WorkbenchPartReference.getPart
(WorkbenchPartReference.java:594)
at org.eclipse.ui.internal.EditorReference.getEditor
(EditorReference.java:266)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched
(WorkbenchPage.java:2820)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor
(WorkbenchPage.java:2729)
at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPage.java:
2721)
at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:
2673)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:
70)
at org.eclipse.ui.internal.WorkbenchPage.openEditor
(WorkbenchPage.java:2668)
at org.eclipse.ui.internal.WorkbenchPage.openEditor
(WorkbenchPage.java:2652)
at org.eclipse.ui.internal.WorkbenchPage.openEditor
(WorkbenchPage.java:2635)
at org.clonedigger.actions.DigAction$DigWizard.performFinish
(DigAction.java:349)
at org.eclipse.jface.wizard.WizardDialog.finishPressed
(WizardDialog.java:742)
at org.eclipse.jface.wizard.WizardDialog.buttonPressed
(WizardDialog.java:373)
at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:624)
at org.eclipse.swt.widgets.TypedListener.handleEvent
(TypedListener.java:228)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1158)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:
3401)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3033)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
at org.eclipse.jface.window.Window.open(Window.java:801)
at org.clonedigger.actions.DigAction.run(DigAction.java:393)
at org.eclipse.ui.internal.PluginAction.runWithEvent
(PluginAction.java:251)
at org.eclipse.ui.internal.WWinPluginAction.runWithEvent
(WWinPluginAction.java:229)
at
org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection
(ActionContributionItem.java:583)
at org.eclipse.jface.action.ActionContributionItem.access$2
(ActionContributionItem.java:500)
at org.eclipse.jface.action.ActionContributionItem$5.handleEvent
(ActionContributionItem.java:411)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1158)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:
3401)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3033)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:
2382)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2198)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at org.eclipse.core.databinding.observable.Realm.runWithDefault
(Realm.java:288)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench
(Workbench.java:488)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:
149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start
(IDEApplication.java:113)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run
(EclipseAppHandle.java:193)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication
(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start
(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run
(EclipseStarter.java:386)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run
(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
--- cut here ---

I have supposed that maybe the exception is happening because there
are 0 clones and there might be some bug involving this special case.
So I have added the following code snippet to a python source file
inside the project, to create clones:

--- cut here ---
def function1():
a = 1
b = 2
c = 3
d = 4
e = 5

def function2():
a = 1
b = 2
c = 3
d = 4
e = 5
--- cut here ---

This indeed makes Clone Digger to detect clones, as its log suggests:

--- cut here ---
Running clonedigger...

Parsing /home/shadow/workspace/efm/src/efm.py ... done
Parsing /home/shadow/workspace/efm/src/efmlib/__init__.py ... done
Parsing /home/shadow/workspace/efm/src/test.py ... done
5 sequences
average sequence length: 4.200000
maximum sequence length: 5
Number of statements: 21
Calculating size for each statement... done
Building statement hash... done
Number of different hash values: 9
Building patterns... 9 patterns were discovered
Choosing pattern for each statement... done
Finding similar sequences of statements... 2 sequences were found
Refining candidates... 2 clones were found
Removing dominated clones... -1 clones were removed

Press finish to view results...
--- cut here ---

But pressing the "Finish" button results with a traceback again:

--- cut here ---
java.lang.NullPointerException
at org.clonedigger.ResultBrowser.createPartControl(ResultBrowser.java:
173)
at org.eclipse.ui.internal.EditorReference.createPartHelper
(EditorReference.java:661)
at org.eclipse.ui.internal.EditorReference.createPart
(EditorReference.java:428)
at org.eclipse.ui.internal.WorkbenchPartReference.getPart
(WorkbenchPartReference.java:594)
at org.eclipse.ui.internal.EditorReference.getEditor
(EditorReference.java:266)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched
(WorkbenchPage.java:2820)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor
(WorkbenchPage.java:2729)
at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPage.java:
2721)
at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:
2673)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:
70)
at org.eclipse.ui.internal.WorkbenchPage.openEditor
(WorkbenchPage.java:2668)
at org.eclipse.ui.internal.WorkbenchPage.openEditor
(WorkbenchPage.java:2652)
at org.eclipse.ui.internal.WorkbenchPage.openEditor
(WorkbenchPage.java:2635)
at org.clonedigger.actions.DigAction$DigWizard.performFinish
(DigAction.java:349)
at org.eclipse.jface.wizard.WizardDialog.finishPressed
(WizardDialog.java:742)
at org.eclipse.jface.wizard.WizardDialog.buttonPressed
(WizardDialog.java:373)
at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:624)
at org.eclipse.swt.widgets.TypedListener.handleEvent
(TypedListener.java:228)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1158)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:
3401)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3033)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
at org.eclipse.jface.window.Window.open(Window.java:801)
at org.clonedigger.actions.DigAction.run(DigAction.java:393)
at org.eclipse.ui.internal.PluginAction.runWithEvent
(PluginAction.java:251)
at org.eclipse.ui.internal.WWinPluginAction.runWithEvent
(WWinPluginAction.java:229)
at
org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection
(ActionContributionItem.java:583)
at org.eclipse.jface.action.ActionContributionItem.access$2
(ActionContributionItem.java:500)
at org.eclipse.jface.action.ActionContributionItem$5.handleEvent
(ActionContributionItem.java:411)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1158)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:
3401)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3033)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:
2382)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2198)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at org.eclipse.core.databinding.observable.Realm.runWithDefault
(Realm.java:288)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench
(Workbench.java:488)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:
149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start
(IDEApplication.java:113)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run
(EclipseAppHandle.java:193)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication
(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start
(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run
(EclipseStarter.java:386)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run
(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
--- cut here ---

Anatoly

unread,
Dec 28, 2008, 5:20:51 AM12/28/08
to Clone Digger general
It seems that you haven't browser support in your eclipse... to
diagnose this try to open any html file just from File menu. Also i
added few error checks in org.clonedigger.ResultBrowser, try to
upgrade your CloneDigger plugin to version 1.1.7, reproduce the error
and look through "error log". This error log view is by default stay
on the bottom of workspace but could also be opened from "window->show
view" main menu.
Thanks for support!

zpcspm

unread,
Dec 28, 2008, 8:53:09 AM12/28/08
to Clone Digger general
On Dec 28, 12:20 pm, Anatoly <zapadin...@gmail.com> wrote:
> It seems that you haven't browser support in your eclipse...

Indeed, that was the problem. Thank you for your hint.
Trying to add an external browser setting to eclipse didn't work, I
could see this error in the error log:
"Internal browser is not available: No more handles [Unknown Mozilla
path (MOZILLA_FIVE_HOME not set)]"
The fix was to enable the grayed out internal web browser. I did this
by running eclipse like this:
$ MOZILLA_FIVE_HOME=/usr/lib/seamonkey eclipse

It wasn't possible to use firefox instead of seamonkey, I found the
reason for this by googling. Here is a reference link:

http://www.eclipse.org/swt/faq.php#browserlinux

Perhaps you could use the content of this topic to improve a bit the
eclipse plugin manual, just in case that other people would run into
the same issue.

Reply all
Reply to author
Forward
0 new messages