jeffsvajlenko / cloneworks Goto Github PK
View Code? Open in Web Editor NEWLicense: Other
License: Other
The path of CloneWorks on my computer is /home/USER_NAME/opt/CloneWorks
.
OS: Ubuntu 18.04
With the default config where INSTALL_DIR=.
, the example test works ok.
Then I set INSTALL_DIR=/home/USER_NAME/opt/CloneWorks
, and add export PATH="/home/USER_NAME/opt/CloneWorks/cwbuild:$PATH"
to ~/.zshrc
.
I tried cwbuild -i sources -f sources/files -b sources/blocks -l java -g function -c type3line > cwbuild.log
in another directory, but I got the following errors (Exception: Broken pipe
and Exception: Stream closed
):
CloneWorks Version 1.0
Input Builder
System=/home/USER_NAME/MyDir/sources
FileIDs=/home/USER_NAME/MyDir/sources/files
Blocks=/home/USER_NAME/MyDir/sources/blocks
Configuration=type3line
Languages=java,
Granularity=function
TokenType=line
Parsing....
Failed for file: InputFile [id=40, path=sources/ProjectA/projectA.callgraph/target/test-classes/callgraph/NonVirtualCall/source/NVC1.java]. Exception: Broken pipe
Failed for file: InputFile [id=80, path=sources/ProjectA/projectA.callgraph/src/test/resources/callgraph/NonVirtualCall/source/NVC2.java].
Failed for file: InputFile [id=0, path=sources/ProjectA/projectA.examples/target/test-classes/ClassHierarchy/source/D.java]. Exception: Broken pipe
Failed for file: InputFile [id=220, path=sources/ProjectA/projectA.tests/src/test/resources/methoddispatchresolver/AbstractDispatch/B.java]. Exception: Stream closed
...
I log INSTALL_DIR
and LIBS
in cwbuild
.
With the default setting, their values are:
INSTALL_DIR is .
LIBS is ./bin/:./libs/commons-lang3-3.4/commons-lang3-3.4.jar:./libs/commons-exec-1.3/commons-exec-1.3.jar:./libs/commons-cli-1.3.1/commons-cli-1.3.1.jar:./libs/commons-io-2.4/commons-io-2.4.jar
"./cfprocessors/txl_normalization" "r" "." "java" "function" extract
After modification, they are:
INSTALL_DIR is /home/USER_NAME/opt/CloneWorks
LIBS is /home/USER_NAME/opt/CloneWorks/bin/:/home/USER_NAME/opt/CloneWorks/libs/commons-lang3-3.4/commons-lang3-3.4.jar:/home/USER_NAME/opt/CloneWorks/libs/commons-exec-1.3/commons-exec-1.3.jar:/home/USER_NAME/opt/CloneWorks/libs/commons-cli-1.3.1/commons-cli-1.3.1.jar:/home/USER_NAME/opt/CloneWorks/libs/commons-io-2.4/commons-io-2.4.jar
"/home/USER_NAME/opt/CloneWorks/cfprocessors/txl_normalization" "r" "/home/USER_NAME/opt/CloneWorks" "java" "function" extract
I have a test function like this:
`
public org.jooby.Route.Definition apply(final org.jooby.Route.Definition route) {
this.attrs.build().forEach(route::attr); **
if (this.name != null) {
route.name(this.name);
}
if (this.prefix != null) {
route.name(this.prefix + "/" + route.name());
}
if (this.consumes != null) {
route.consumes(this.consumes);
}
if (this.produces != null) {
route.produces(this.produces);
}
if (this.excludes != null) {
route.excludes(this.excludes);
}
if (this.mapper != null) {
route.map(this.mapper);
}
if (this.renderer != null) {
route.renderer(this.renderer);
}
return route;
}
`
When I run this test case with command './cwbuild -i test/ -f test/ana.files -l java -b test/ana.fragments -g function -c type3token', I only got an empty fragments file.
Then I delete line ** (this.attrs.build().forEach(route::attr);) and seemed to work well. Why is that? Does it mean that it can not recognize the symbol like :: or?
src/detection/GTF/GTFHashMap.java
when updating gtf,if there is a same token in gtf before,gtf will not be updated,like this:
@OverRide
public void add(String term, long num) {
AtomicLong value = map.putIfAbsent(term, new AtomicLong(num));
if(value != null)
value.addAndGet(num);
}
maybe we should change to :
@OverRide
public void add(String term, long num) {
AtomicLong value = map.putIfAbsent(term, new AtomicLong(num));
if(value != null){
value.addAndGet(num);
map.put(term,value);
}
}
Dear Jeffrey,
I tried to test CloneWorks with the Code of the Testing Chapter in the readme.
But the Code
./cwbuild -i example/JHotDraw54b1/ -f example/JHotDraw.files -b example/JHotDraw.fragments -l java -g function -c type3_conservative
is not working because the type type3_conservative
can't be found. I tried to use type1
- another configuration from ./config
- and its working. So maybe just change it in the readme.md
?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.