SpoonLabs / coming

A tool for mining commits from Git repositories and diffs to automatically extract code change pattern instances and features with ast analysis
https://hal.inria.fr/hal-00861883/file/paper-short.pdf
MIT License
93 stars 33 forks source link

Error - FineGrainDifftAnalyzer - Gumtree inheritance information file not found #219

Closed jacksonpradolima closed 4 years ago

jacksonpradolima commented 4 years ago

Hello

I am trying to use the coming tool, but I am receiving the following error:

Analyzing 3438/3537 83bbf2b4862182b15739af31c8e432a08ec7283c
2020-05-18 18:18:29,221 INFO fr.inria.coming.changeminer.analyzer.commitAnalyzer.FineGrainDifftAnalyzer -
*****
Commit: 83bbf2b4862182b15739af31c8e432a08ec7283c
Exception in thread "main" java.lang.RuntimeException: Gumtree inheritance information file not found
        at fr.inria.coming.utils.EntityTypesInfoResolver.loadChildrenToParentsRelationsBetweenEntityTypes(EntityTypesInfoResolver.java:49)
        at fr.inria.coming.utils.EntityTypesInfoResolver.<init>(EntityTypesInfoResolver.java:29)
        at fr.inria.coming.utils.EntityTypesInfoResolver.getInstance(EntityTypesInfoResolver.java:24)
        at fr.inria.coming.changeminer.analyzer.instancedetector.DetectorChangePatternInstanceEngine.matchElements(DetectorChangePatternInstanceEngine.java:464)
        at fr.inria.coming.changeminer.analyzer.instancedetector.DetectorChangePatternInstanceEngine.mappingActions(DetectorChangePatternInstanceEngine.java:395)
        at fr.inria.coming.changeminer.analyzer.instancedetector.DetectorChangePatternInstanceEngine.findPatternInstances(DetectorChangePatternInstanceEngine.java:47)
        at fr.inria.coming.changeminer.analyzer.instancedetector.PatternInstanceAnalyzer.analyze(PatternInstanceAnalyzer.java:65)
        at fr.inria.coming.core.engine.RevisionNavigationExperiment.analyze(RevisionNavigationExperiment.java:127)
        at fr.inria.coming.main.ComingMain.start(ComingMain.java:156)
        at fr.inria.coming.main.ComingMain.run(ComingMain.java:149)
        at fr.inria.coming.main.ComingMain.main(ComingMain.java:133)

The repository under evaluation is alibaba/fastjson. The other one that I tried was alibaba/druid, in which I received the following error:

Analyzing 6006/6104 2220bedc8e16f439a7cdbaf785fea0d20fab972a
2020-05-18 18:21:40,853 INFO fr.inria.coming.changeminer.analyzer.commitAnalyzer.FineGrainDifftAnalyzer -
*****
Commit: 2220bedc8e16f439a7cdbaf785fea0d20fab972a
Exception in thread "main" java.lang.RuntimeException: Gumtree inheritance information file not found
        at fr.inria.coming.utils.EntityTypesInfoResolver.loadChildrenToParentsRelationsBetweenEntityTypes(EntityTypesInfoResolver.java:49)
        at fr.inria.coming.utils.EntityTypesInfoResolver.<init>(EntityTypesInfoResolver.java:29)
        at fr.inria.coming.utils.EntityTypesInfoResolver.getInstance(EntityTypesInfoResolver.java:24)
        at fr.inria.coming.changeminer.analyzer.instancedetector.DetectorChangePatternInstanceEngine.matchElements(DetectorChangePatternInstanceEngine.java:464)
        at fr.inria.coming.changeminer.analyzer.instancedetector.DetectorChangePatternInstanceEngine.mappingActions(DetectorChangePatternInstanceEngine.java:395)
        at fr.inria.coming.changeminer.analyzer.instancedetector.DetectorChangePatternInstanceEngine.findPatternInstances(DetectorChangePatternInstanceEngine.java:47)
        at fr.inria.coming.changeminer.analyzer.instancedetector.PatternInstanceAnalyzer.analyze(PatternInstanceAnalyzer.java:65)
        at fr.inria.coming.core.engine.RevisionNavigationExperiment.analyze(RevisionNavigationExperiment.java:127)
        at fr.inria.coming.main.ComingMain.start(ComingMain.java:156)
        at fr.inria.coming.main.ComingMain.run(ComingMain.java:149)
        at fr.inria.coming.main.ComingMain.main(ComingMain.java:133)

As we can see the problem is concerning the FineGrainDifftAnalyzer class. The commits with problems are 83bbf2b4862182b15739af31c8e432a08ec7283c for alibaba/fastjson and 2220bedc8e16f439a7cdbaf785fea0d20fab972a for alibaba/druid.

In addition, when the execution starts, I receive the error:

log4j:ERROR setFile(null,true) call failed.
java.io.FileNotFoundException:
        at java.io.FileOutputStream.open0(Native Method)
        at java.io.FileOutputStream.open(FileOutputStream.java:270)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:133)
        at org.apache.log4j.FileAppender.setFile(FileAppender.java:290)
        at org.apache.log4j.RollingFileAppender.setFile(RollingFileAppender.java:194)
        at org.apache.log4j.FileAppender.activateOptions(FileAppender.java:164)
        at org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:257)
        at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:133)
        at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:97)
        at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:689)
        at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:647)
        at org.apache.log4j.PropertyConfigurator.parseCatsAndRenderers(PropertyConfigurator.java:568)
        at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:442)
        at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:476)
        at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:471)
        at org.apache.log4j.LogManager.<clinit>(LogManager.java:125)
        at org.apache.log4j.Logger.getLogger(Logger.java:105)
        at fr.inria.coming.main.ComingMain.<clinit>(ComingMain.java:57)

The command that I am using is similar to that one in the README file.

Thanks in advance for your help

martinezmatias commented 4 years ago

Dear @jacksonpradolima Thanks for reporting the error. I will take a look to the first two traces. The last one seems to be related to the log properties file. Thanks Matias

martinezmatias commented 4 years ago

Hi @jacksonpradolima I added two new test cases, each of them test one pair of the files you mention. I could not reproduce the error from those inputs. The tests assert that coming correctly generates the diff and then asserts the pattern change instances found. WDYT?

jacksonpradolima commented 4 years ago

Dear @martinezmatias I asked a colleague to try to execute too. However, the error persists. We followed the instructions in the README. (Could you provide a jar file in the release tab?)

Besides that, I made a git clone from repogit4testv0 inside the coming folder. Then, I executed the following command:

java -classpath ./target/coming-0-SNAPSHOT-jar-with-dependencies.jar fr.inria.coming.main.ComingMain -location  ./repogit4testv0/ -mode mineinstance -action INS -entitytype BinaryOperator   -output ./out

I received the same output:

log4j:WARN File option not set for appender [file].
log4j:WARN Are you using FileAppender instead of ConsoleAppender?
**NOT_EXECUTED_BY_TRAVIS**
log4j:ERROR No output stream or file set for the appender named [file].
Exception in thread "main" java.lang.RuntimeException: Gumtree inheritance information file not found
        at fr.inria.coming.utils.EntityTypesInfoResolver.loadChildrenToParentsRelationsBetweenEntityTypes(EntityTypesInfoResolver.java:49)
        at fr.inria.coming.utils.EntityTypesInfoResolver.<init>(EntityTypesInfoResolver.java:29)
        at fr.inria.coming.utils.EntityTypesInfoResolver.getInstance(EntityTypesInfoResolver.java:24)
        at fr.inria.coming.changeminer.analyzer.instancedetector.DetectorChangePatternInstanceEngine.matchElements(DetectorChangePatternInstanceEngine.java:464)
        at fr.inria.coming.changeminer.analyzer.instancedetector.DetectorChangePatternInstanceEngine.mappingActions(DetectorChangePatternInstanceEngine.java:395)
        at fr.inria.coming.changeminer.analyzer.instancedetector.DetectorChangePatternInstanceEngine.findPatternInstances(DetectorChangePatternInstanceEngine.java:47)
        at fr.inria.coming.changeminer.analyzer.instancedetector.PatternInstanceAnalyzer.analyze(PatternInstanceAnalyzer.java:65)
        at fr.inria.coming.core.engine.RevisionNavigationExperiment.analyze(RevisionNavigationExperiment.java:127)
        at fr.inria.coming.main.ComingMain.start(ComingMain.java:156)
        at fr.inria.coming.main.ComingMain.run(ComingMain.java:149)
        at fr.inria.coming.main.ComingMain.main(ComingMain.java:133)

Java information

java -version
openjdk version "1.8.0_252"
OpenJDK Runtime Environment (build 1.8.0_252-8u252-b09-1~18.04-b09)
OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode)
javac -version
javac 1.8.0_252

Maven Information

mvn -version
Apache Maven 3.6.0
Maven home: /usr/share/maven
Java version: 1.8.0_252, vendor: Private Build, runtime: /usr/lib/jvm/java-8-openjdk-amd64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.15.0-88-generic", arch: "amd64", family: "unix"
martinezmatias commented 4 years ago

Hi @jacksonpradolima Thanks for the info. Bug reproduced:

Exception in thread "main" java.lang.RuntimeException: Gumtree inheritance information file not found
    at fr.inria.coming.utils.EntityTypesInfoResolver.loadChildrenToParentsRelationsBetweenEntityTypes(EntityTypesInfoResolver.java:49)
    at fr.inria.coming.utils.EntityTypesInfoResolver.<init>(EntityTypesInfoResolver.java:29)
    at fr.inria.coming.utils.EntityTypesInfoResolver.getInstance(EntityTypesInfoResolver.java:24)
    at fr.inria.coming.changeminer.analyzer.instancedetector.DetectorChangePatternInstanceEngine.matchElements(DetectorChangePatternInstanceEngine.java:464)
    at fr.inria.coming.changeminer.analyzer.instancedetector.DetectorChangePatternInstanceEngine.mappingActions(DetectorChangePatternInstanceEngine.java:395)
    at fr.inria.coming.changeminer.analyzer.instancedetector.DetectorChangePatternInstanceEngine.findPatternInstances(DetectorChangePatternInstanceEngine.java:47)
    at fr.inria.coming.changeminer.analyzer.instancedetector.PatternInstanceAnalyzer.analyze(PatternInstanceAnalyzer.java:65)
    at fr.inria.coming.core.engine.RevisionNavigationExperiment.analyze(RevisionNavigationExperiment.java:127)
    at fr.inria.coming.main.ComingMain.start(ComingMain.java:147)
    at fr.inria.coming.main.ComingMain.run(ComingMain.java:140)
    at fr.inria.coming.main.ComingMain.main(ComingMain.java:124)
martinezmatias commented 4 years ago

Hi @jacksonpradolima

I found one potential cause. If you run from an IDE it should not happen. In any case, the bug needs to be fixed.

martinezmatias commented 4 years ago

Hi @jacksonpradolima I fixed the problem. Could you try it again please? Thanks Matias

jacksonpradolima commented 4 years ago

Hi @martinezmatias Perfect! It's working now!

Thanks a lot!

martinezmatias commented 4 years ago

Hi @jacksonpradolima Perfect! Cheers Matias