Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[recommenders-dev] Need help to collect completion proposals made by code recommenders programetically

Hi All,
Good day. I am involved with a research project where we are are
comparing performance of code completion engines including code
recommenders. The reason is that there are other completion engines
(at least in the form of research prototype) but they compare their
performance/accuracy differently. What I need is the method calls
(after typing object name and dot) performed by the developers in a
java code and the completion proposals made by code recommenders at
that point.

Marcel pointed me to a headless api in the master branch:
https://git.eclipse.org/c/recommenders/org.eclipse.recommenders.git/tree/plugins/org.eclipse.recommenders.calls/examples/org/eclipse/recommenders/examples/calls

I have collected the code via: git clone
https://eclipse.googlesource.com/recommenders/org.eclipse.recommenders
Add required  jars and run the EclipseOrgCallRecommenderMain file as a
java application, but it gives me the following error:
+++++++++++++++++++++++++ Output+++++++++++++
Setting up recommender and model repository (downloads search index
the first time).
Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/maven/model/building/ModelBuildingException
	at java.lang.Class.getDeclaredConstructors0(Native Method)
	at java.lang.Class.privateGetDeclaredConstructors(Class.java:2404)
	at java.lang.Class.getConstructor0(Class.java:2714)
	at java.lang.Class.newInstance0(Class.java:343)
	at java.lang.Class.newInstance(Class.java:325)
	at org.sonatype.aether.impl.internal.DefaultServiceLocator.getServices(DefaultServiceLocator.java:160)
	at org.sonatype.aether.impl.internal.DefaultServiceLocator.getService(DefaultServiceLocator.java:133)
	at org.sonatype.aether.impl.internal.DefaultRepositorySystem.initService(DefaultRepositorySystem.java:146)
	at org.sonatype.aether.impl.internal.DefaultServiceLocator.getServices(DefaultServiceLocator.java:181)
	at org.sonatype.aether.impl.internal.DefaultServiceLocator.getService(DefaultServiceLocator.java:133)
	at org.eclipse.recommenders.models.AetherModelRepository.createRepositorySystem(AetherModelRepository.java:262)
	at org.eclipse.recommenders.models.AetherModelRepository.<init>(AetherModelRepository.java:102)
	at org.eclipse.recommenders.models.AetherModelRepository.<init>(AetherModelRepository.java:135)
	at org.eclipse.recommenders.examples.calls.EclipseOrgCallRecommenderMain.main(EclipseOrgCallRecommenderMain.java:26)
Caused by: java.lang.ClassNotFoundException:
org.apache.maven.model.building.ModelBuildingException
	at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
	... 14 more
++++++++++++++++++++++++++++++++++++++++++++++
Can anyone help me to solve this problem?

Marcel also pointed me to Eclipse Code Recommenders Proposal Computer
API  (is it part org.eclipse.recommenders.completion.rcp.sandbox or
org.eclipse.recommenders.completion.rcp).  How can I collect the code.
They are not part of the master branch, if I am correct.

My program need to traverse a java source file (may be in the form of
a compilation unit), find the method call made by developers  and
check what completion proposals made by code recommenders at that
time. It would be really helpful for me if I get some help from you.

Thanks.

-Muhammad Asaduzzaman
Graduate Student
Department of Computer Science
University of Saskatchewan


Back to the top