Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR when run on Bears-Benchmark: Problem compiling the model with compliance level #310

Open
WuYff opened this issue Apr 7, 2021 · 1 comment

Comments

@WuYff
Copy link
Contributor

WuYff commented Apr 7, 2021

Hello, I running jGenProg2 on Bears-Benchmark. I can run on some bugs successfully (e.g. Bears-100), but I fail with compliance level error on other bugs (e.g. Bears-1, Bears-2).

For example, I fail on Bears-1 and the steps to reproduce are shown as below.

May I ask how can I solve this compliance level problem?

Environment:

java version "1.8.0_191"
Java(TM) SE Runtime Environment (build 1.8.0_191-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)

Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /usr/local/apache-maven-3.6.3
Java version: 1.8.0_191, vendor: Oracle Corporation, runtime: /usr/lib/jvm/java-8-oracle/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.15.0-140-generic", arch: "amd64", family: "unix"

Build Astor

Create astor.jar following the steps in Getting started Astor

 git clone https://github.com/SpoonLabs/astor.git
 cd astor
 mvn install -DskipTests=true
 mvn package -DskipTests=true

Command:

java  -cp /home/yiwu/thesis/astor/target/astor-1.1.0-jar-with-dependencies.jar fr.inria.main.evolution.AstorMain -mode jgenprog -srcjavafolder /src/java/ -srctestfolder /src/test/  -binjavafolder /target/classes/ -bintestfolder  /target/test-classes/ -location /home/yiwu/thesis/Bears/Bears-1 -dependencies /home/yiwu/thesis/Bears_dependency/Bears-1 

-dependencies /home/yiwu/thesis/Bears_dependency/Bears-1 is a directory that contains all the .jar files for a Bears bug.

Output log:

(base) yiwu@SH1:java -cp /home/yiwu/thesis/astor/target/astor-1.1.0-jar-with-dependencies.jar fr.inria.main.evolution.AstorMain -mode jgenprog -srcjavafolder /src/java/ -srctestfolder /src/test/  -binjavafolder /target/classes/ -bintestfolder  /target/test-classes/ -location /home/yiwu/thesis/Bears/Bears-1 -dependencies /home/yiwu/thesis/Bears_dependency/Bears-1
19:57:37.452 [main] ERROR MutationSupporter - Problem compiling the model with compliance level 8
19:57:37.454 [main] ERROR MutationSupporter - Name clash: The method readValues(JsonParser, TypeReference<?>) of type ObjectMapper has the same erasure as readValues(JsonParser, TypeReference<T>) of type ObjectCodec but does not override it at /home/yiwu/thesis/Bears/Bears-1/src/main/java/com/fasterxml/jackson/databind/ObjectMapper.java:2230
spoon.compiler.ModelBuildingException: Name clash: The method readValues(JsonParser, TypeReference<?>) of type ObjectMapper has the same erasure as readValues(JsonParser, TypeReference<T>) of type ObjectCodec but does not override it at /home/yiwu/thesis/Bears/Bears-1/src/main/java/com/fasterxml/jackson/databind/ObjectMapper.java:2230
        at spoon.support.compiler.jdt.JDTBasedSpoonCompiler.report(JDTBasedSpoonCompiler.java:635)
        at spoon.support.compiler.jdt.JDTBasedSpoonCompiler.reportProblems(JDTBasedSpoonCompiler.java:617)
        at spoon.support.compiler.jdt.JDTBasedSpoonCompiler.build(JDTBasedSpoonCompiler.java:116)
        at spoon.support.compiler.jdt.JDTBasedSpoonCompiler.build(JDTBasedSpoonCompiler.java:97)
        at fr.inria.astor.core.manipulation.MutationSupporter.buildModel(MutationSupporter.java:85)
        at fr.inria.astor.core.manipulation.MutationSupporter.buildSpoonModel(MutationSupporter.java:240)
        at fr.inria.astor.core.solutionsearch.AstorCoreEngine.initModel(AstorCoreEngine.java:866)
        at fr.inria.main.evolution.AstorMain.createEngine(AstorMain.java:113)
        at fr.inria.main.evolution.AstorMain.run(AstorMain.java:173)
        at fr.inria.main.evolution.AstorMain.execute(AstorMain.java:233)
        at fr.inria.main.evolution.AstorMain.main(AstorMain.java:204)
spoon.compiler.ModelBuildingException: Name clash: The method readValues(JsonParser, TypeReference<?>) of type ObjectMapper has the same erasure as readValues(JsonParser, TypeReference<T>) of type ObjectCodec but does not override it at /home/yiwu/thesis/Bears/Bears-1/src/main/java/com/fasterxml/jackson/databind/ObjectMapper.java:2230
        at spoon.support.compiler.jdt.JDTBasedSpoonCompiler.report(JDTBasedSpoonCompiler.java:635)
        at spoon.support.compiler.jdt.JDTBasedSpoonCompiler.reportProblems(JDTBasedSpoonCompiler.java:617)
        at spoon.support.compiler.jdt.JDTBasedSpoonCompiler.build(JDTBasedSpoonCompiler.java:116)
        at spoon.support.compiler.jdt.JDTBasedSpoonCompiler.build(JDTBasedSpoonCompiler.java:97)
        at fr.inria.astor.core.manipulation.MutationSupporter.buildModel(MutationSupporter.java:85)
        at fr.inria.astor.core.manipulation.MutationSupporter.buildSpoonModel(MutationSupporter.java:253)
        at fr.inria.astor.core.solutionsearch.AstorCoreEngine.initModel(AstorCoreEngine.java:866)
        at fr.inria.main.evolution.AstorMain.createEngine(AstorMain.java:113)
        at fr.inria.main.evolution.AstorMain.run(AstorMain.java:173)
        at fr.inria.main.evolution.AstorMain.execute(AstorMain.java:233)
        at fr.inria.main.evolution.AstorMain.main(AstorMain.java:204)
19:57:40.161 [main] ERROR MutationSupporter - Error compiling: Name clash: The method readValues(JsonParser, TypeReference<?>) of type ObjectMapper has the same erasure as readValues(JsonParser, TypeReference<T>) of type ObjectCodec but does not override it at /home/yiwu/thesis/Bears/Bears-1/src/main/java/com/fasterxml/jackson/databind/ObjectMapper.java:2230
19:57:40.331 [main] ERROR MutationSupporter - Astor continues when model build fails. Classes created: 372


@martinezmatias
Copy link
Collaborator

Hi @WuYff

Astor fails when creating the application model using Spoon.
By default, Astor uses Java 8. The command you pasted does not overwrite that value.
Could you try with another value?

It could be the case that Spoon cannot create the model from that piece of code. A test case doing that could help to understand the problem.

Regards
Matias

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants