jdeodorant-commandline's People
jdeodorant-commandline's Issues
Need some suggestions about how to perform other refactorings programmatically according to detected refactoring opportunities
Hi authors,
Currently, the jdeodorant-commandline only supports the Extract Clone in running as a standalone command-line application mode.
I am trying to invoke other refactorings (like Extract Method, Move Method, and etc. in JDeodorant) programmatically, so i need to write code for other refactorings like Extract Clone in standalone command-line application mode.
I noticed that in this issuse, jdeodorant-commandline can print all the refactoring opportunities. I want to apply other refactorings programmatically according those detected refactoring opportunities. For this purpose, i read the code in JDeodorant and find out that other refactorings are closed binded with the eclipse UI, it is not a easy work to unbind them.
So i write this issue to ask for some suggestions or advices about how to achieve other refactoring types in standalone command-line application mode. Jdeodorant-commandline can print all the refactoring opportunities now, so based on those detected code smell, what i want to do is applying those refactorings without eclipse UI, then i can programmatically achieve other auto-refactorings.
I would be really appreciate if you could give me some hints or advices about how to achieve the above goals. @tsantalis
Thanks
The project is not opened in the workspace
related to #12
I encountered the error reported in #12, but I think I specified the project dir correctly.
What's going on?
My environment: Mac OS Catalina
AdoptOpenJDK8
Target project: jFreeChart(https://github.com/jfree/jfreechart)
./eclipse -p jfreechart -x "./clone.xls" -m "PARSE_AND_ANALYZE" -t CLONE_TOOL_CCFINDER -i ... -xargs ...
!SESSION 2019-11-08 10:16:14.042 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.8.0_232
java.vendor=AdoptOpenJDK
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=ja_JP
Framework arguments: -p jfreechart -x ./clone.xls -m PARSE_AND_ANALYZE -t CLONE_TOOL_CCFINDER -i ... -xargs ...
Command-line arguments: -os macosx -ws cocoa -arch x86_64 -consoleLog -p jfreechart -x ./clone.xls -m PARSE_AND_ANALYZE -t CLONE_TOOL_CCFINDER -i ... -xargs ...
!ENTRY org.eclipse.core.resources 2 10035 2019-11-08 10:16:16.043
!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes.
java.lang.RuntimeException: The project "jfreechart" is not opened in the workspace. Cannot continue.
at ca.concordia.jdeodorant.eclipse.commandline.Application.getJavaProject(Application.java:950)
at ca.concordia.jdeodorant.eclipse.commandline.Application.start(Application.java:159)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:660)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:597)
at org.eclipse.equinox.launcher.Main.run(Main.java:1468)
!ENTRY org.eclipse.core.resources 2 10035 2019-11-08 10:16:17.228
!MESSAGE The workspace will exit with unsaved changes in this session.
Import problem. PDGExpressionGap and PDGNodeBlockGap are missing in JDeodorant
When I import the project in Eclipse, the following classes are missing:
import gr.uom.java.ast.decomposition.cfg.mapping.PDGExpressionGap;
import gr.uom.java.ast.decomposition.cfg.mapping.PDGNodeBlockGap;
In class CloneInfoCSVWriter
It seems they were removed. For which version of JDeodorant the jdeodorant-commandline works?
Windows 10 x64
Eclipse Oxygen IDE for Java Developers Release (4.7.0)
JDeodorant 5.0 5.0.0.201803171130
NullPointerException in ExtractCloneRefactoringGapHanlder
Hi,
There is an error generated (details are below).
Note: This error is generated for JRuby - NiCad_Blind - Case 753 from the files on Prof. Nikolaos website.
Regards,
Asif
10:45:30.317 [main] INFO c.c.j.e.commandline.Application - 88%: Reading information from row 2909 (Clone group ID 753, clone 5)
10:45:30.346 [main] INFO c.c.j.e.commandline.Application - 88%: Generating PDG for method "setUp" in "org.jruby.test.TestLoadService"
10:45:32.229 [main] INFO c.c.j.e.commandline.Application - 88%: Analyzing Clone 1 (Group 753, Pair 1-5): org.jruby.test.TestRequire#setUp (row 2905) and org.jruby.test.TestLoadService#setUp (row 2909)
10:45:32.300 [main] INFO c.c.j.e.commandline.Application - CDT 1 depth = 0, CDT 2 depth = 0
10:45:32.300 [main] INFO c.c.j.e.commandline.Application - CDT 1 leaves = 1, CDT 2 leaves = 1
java.lang.NullPointerException
at gr.uom.java.jdeodorant.refactoring.manipulators.ExtractCloneRefactoringGapHandler.differenceBelongsToBlockGaps(ExtractCloneRefactoringGapHandler.java:306)
at gr.uom.java.jdeodorant.refactoring.manipulators.ExtractCloneRefactoringGapHandler.createArgument(ExtractCloneRefactoringGapHandler.java:904)
at gr.uom.java.jdeodorant.refactoring.manipulators.ExtractCloneRefactoring.createArgument(ExtractCloneRefactoring.java:3985)
at gr.uom.java.jdeodorant.refactoring.manipulators.ExtractCloneRefactoring.generateGetterMethodInvocation(ExtractCloneRefactoring.java:4098)
at gr.uom.java.jdeodorant.refactoring.manipulators.ExtractCloneRefactoring.processASTNodeWithDifferences(ExtractCloneRefactoring.java:3437)
at gr.uom.java.jdeodorant.refactoring.manipulators.ExtractCloneRefactoring.processCloneStructureNode(ExtractCloneRefactoring.java:2938)
at gr.uom.java.jdeodorant.refactoring.manipulators.ExtractCloneRefactoring.extractClone(ExtractCloneRefactoring.java:1254)
at gr.uom.java.jdeodorant.refactoring.manipulators.ExtractCloneRefactoring.apply(ExtractCloneRefactoring.java:341)
at gr.uom.java.jdeodorant.refactoring.manipulators.ExtractCloneRefactoring.checkFinalConditions(ExtractCloneRefactoring.java:5058)
at ca.concordia.jdeodorant.eclipse.commandline.Application.testRefactoring(Application.java:969)
at ca.concordia.jdeodorant.eclipse.commandline.Application.start(Application.java:208)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:673)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610)
at org.eclipse.equinox.launcher.Main.run(Main.java:1519)
at org.eclipse.equinox.launcher.Main.main(Main.java:1492)
Exporting Product has encountered a problem
Hi,
I want to use jdeodorant-commandline as a standalone application and try to export product,
but I encountered an error in exporting.
Message:
'Export Product' has encountered a problem.
/Users/my_name/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/temp/org.eclipse.pde.container.feature/package.org.eclipse.pde.container.feature.macosx.cocoa.x86_64.xml:89: The following error occurred while executing this line:
/Users/my_name/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/temp/org.eclipse.pde.container.feature/package.org.eclipse.pde.container.feature.macosx.cocoa.x86_64.xml:699: The following error occurred while executing this line:
/Volumes/Eclipse/Eclipse.app/Contents/Eclipse/plugins/org.eclipse.pde.build_3.10.400.v20190320-1020/scripts/genericTargets.xml:240: A problem occured while invoking the director.
The following error occurred while executing this line:
/Users/my_name/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/temp/org.eclipse.pde.container.feature/package.org.eclipse.pde.container.feature.macosx.cocoa.x86_64.xml:699: The following error occurred while executing this line:
/Volumes/Eclipse/Eclipse.app/Contents/Eclipse/plugins/org.eclipse.pde.build_3.10.400.v20190320-1020/scripts/genericTargets.xml:240: A problem occured while invoking the director.
What should I do?
My Environment:
MacOS Catalina, Eclipse EE 2019-06, OpenJDK 1.8.0_222
And I found the same error in my Windows environment.
Delegate the work of parsers to JDeodorant
There is redundancy in ca.concordia.jdeodorant.eclipse.commandline.parsers; we depend on Cedar classes as well. We should delegate the work to JDeodorant and do a lot of clean-ups there
Plug-in "ca.concordia.jdeodorant.eclipse.commandline-lambda" was unable to instantiate class "ca.concordia.jdeodorant.eclipse.commandline.Application".
I followed the official tutorial on how to launch JDeodorant as a stand alone command line application, and when I run ./eclipse -p projectname -m print_opportunities I get the following error:
Plug-in "ca.concordia.jdeodorant.eclipse.commandline-lambda" was unable to instantiate class "ca.concordia.jdeodorant.eclipse.commandline.Application".
Caused by: java.lang.ClassNotFoundException: gr.uom.java.ast.CompilationErrorDetectedException cannot be found by ca.concordia.jdeodorant.eclipse.commandline-lambda_1.0.0.202008251507
I repeated the whole process using this tutorial still getting the same error.
Do you know what might be the problem?
I am using macOS Catalina and latest version of Eclipse and JDK 14
Installation problem.
I was trying to install the standalone version in windows 64-bit machine with eclipse oxygen.
problem details
'Export Product' has encountered a problem.
Cannot complete the install because one or more required items could not be found.
Cannot complete the install because one or more required items could not be found.
Software being installed: JDeodorant-Commandline-Product-Configuration 0.1.0 (JDeodorant-Commandline-Product-Configuration 0.1.0)
Missing requirement: Eclipse Application Services 2.1.0.v20170407-0928 (org.eclipse.e4.core.services 2.1.0.v20170407-0928) requires 'osgi.extender osgi.component [1.2.0,2.0.0)' but it could not be found
Cannot satisfy dependency:
Feature envy from JDeodorant
README file says "This is an Eclipse plug-in that allows running JDeodorant for identifying refactoring opportunities and applying them in the batch mode". So, I wanted to use this tool to search for move method refactorings opportunities. But it seems that this tool supports only clone detection. How can I search for move method opportunities? If it's not possible then it's better to clarify it in README.
Missing classes in jDeodorant
Hi guys,
I've been trying to use your tool on a bachelor thesis I'm currently working on.
As it seems the cmdline tool is using some classes that are not existent in jDeodorant (anymore).
"gr.uom.java.ast.decomposition.cfg.mapping.PDGExpressionGap" and "gr.uom.java.ast.decomposition.cfg.mapping.PDGNodeBlockGap" are missing in "ca.concordia.jdeodorant.eclipse.commandline.cloneinfowriter.CloneInfoCSVWriter".
Do you have any tips on how to fix this?
Cheers
Ivan
NPE when source file is not in a package
The NPE is now happening in many cases now, after changes to the clone output parsers. One example is JEdit-CloneDR-Group195
-s argument is not detected by CLIParser
Hi,
The CLIParser does not detect the -s (skip) if we place it after -xargs argument and all cases in the xls file is examined including the skipped cases. The work around was to place it before -xargs.
This issue happened in JRuby - NiCad_Blind - 753.
Asif,
Update commandline to use CloneInstanceMapper from JDeodorant
Currently this code is duplicated in both projects.
This will also simplify the Application class.
However, there is some interleaved code related to logging, and cpu time computation.
The project is not opened in the workspace
I am running jdeodorant from commandline on mac os. It shows the project is not opened in the workspace.
Where should i put the project? Thanks~
eclipse -pd workspace/avro/.project -x "clones.xls" -m PARSE_AND_ANALYZE
!SESSION 2019-02-26 15:16:21.355 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.8.0_112
java.vendor=Oracle Corporation
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_US
Framework arguments: -pd workspace/avro/.project -x clones.xls -m PARSE_AND_ANALYZE
Command-line arguments: -os macosx -ws cocoa -arch x86_64 -consoleLog -pd workspace/avro/.project -x clones.xls -m PARSE_AND_ANALYZE
!ENTRY org.eclipse.core.resources 2 10035 2019-02-26 15:16:22.250
!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes.
java.lang.RuntimeException: The project "avro-toplevel" is not opened in the workspace. Cannot continue.
at ca.concordia.jdeodorant.eclipse.commandline.Application.start(Application.java:172)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:673)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610)
at org.eclipse.equinox.launcher.Main.run(Main.java:1519)
Notify by email after analysis is finished
The commandline application will notify the user after the analysis is finished for any reason. The SMTP server and the email address can be asked from the user, using the CLI args.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.