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

Formatting necessary for token string normalization #1027

Open
brodmo opened this issue Apr 13, 2023 · 1 comment
Open

Formatting necessary for token string normalization #1027

brodmo opened this issue Apr 13, 2023 · 1 comment
Labels
enhancement Issue/PR that involves features, improvements and other changes

Comments

@brodmo
Copy link
Contributor

brodmo commented Apr 13, 2023

For token string normalization to work, the code must be formatted beforehand. I did this by first removing the comments with JavaParser (see here) and then formatting the result with Eclipse with a sepcial config using the following command:

<ecplise> -vm <java> -data <workspace> -application org.eclipse.jdt.core.JavaCodeFormatter -config <config> -nosplash <target directory>

Since either dependency is undesireable in JPlag other solutions for these two tasks need to be found to use token string normalization. My suggestions would be to remove the comments by parsing the submission with javac and turning the ast back into a string with the existing toString method (which I probably should have done) and use spotless for the formatting after. Spotless can use the Eclipse config AFAIK.

@tsaglam tsaglam added the enhancement Issue/PR that involves features, improvements and other changes label Apr 20, 2023
@tsaglam
Copy link
Member

tsaglam commented Apr 20, 2023

We could add an option to JPlag to format the code of the submissions, as this could be useful independently of the normalization for manual inspection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Issue/PR that involves features, improvements and other changes
Projects
None yet
Development

No branches or pull requests

2 participants