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

HELP - ERROR MutationSupporter #318

Open
juliamanfrindias opened this issue Jun 3, 2021 · 1 comment
Open

HELP - ERROR MutationSupporter #318

juliamanfrindias opened this issue Jun 3, 2021 · 1 comment

Comments

@juliamanfrindias
Copy link

When I run the command using the lang_63 example:

java -cp 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/astor/Documents/A3/astor/examples/lang_63/

Returns the error:


22:04:49.451 [main] ERROR MutationSupporter - Problem compiling the model with compliance level 8
22:04:49.452 [main] ERROR MutationSupporter - Syntax error on token "enum", Identifier expected at /home/astor/Documentos/A3/astor/examples/lang_63/src/main/java/org/apache/commons/lang/enum/Enum.java:17
spoon.compiler.ModelBuildingException: Syntax error on token "enum", Identifier expected at /home/astor/Documentos/A3/astor/examples/lang_63/src/main/java/org/apache/commons/lang/enum/Enum.java:17
	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:776)
	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: Syntax error on token "enum", Identifier expected at /home/astor/Documentos/A3/astor/examples/lang_63/src/main/java/org/apache/commons/lang/enum/Enum.java:17
	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:776)
	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)
22:04:51.504 [main] ERROR MutationSupporter - Error compiling: Syntax error on token "enum", Identifier expected at /home/astor/Documentos/A3/astor/examples/lang_63/src/main/java/org/apache/commons/lang/enum/Enum.java:17
22:04:51.618 [main] ERROR MutationSupporter - Astor continues when model build fails. Classes created: 77
@martinezmatias
Copy link
Collaborator

Hi @juliamanfrindias

The code from the bug you want to repair would be compiled with 1.4 compliance.
Astor provides a parameter for specifying the compliance level. By default, it uses compliance level 8.
For this reason, it fails when compiling that code ( enum is not a valid identifier since Java 1.5).

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