Giter Club home page Giter Club logo

cloneworks's Introduction

Hi there ๐Ÿ‘‹

cloneworks's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

cloneworks's Issues

Failed to run CloneWorks from other directory after change INSTALL_DIR

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.

Problematic config

Then I set INSTALL_DIR=/home/USER_NAME/opt/CloneWorks, and add export PATH="/home/USER_NAME/opt/CloneWorks/cwbuild:$PATH" to ~/.zshrc.

Failure

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

Additional Info for debug

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

A testcase cannot get fragments

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?

about building gtf

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);
}
}

Example Code of Readme not working

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.