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

Fix bug for absolute paths from parser tokens. #85

Merged
merged 3 commits into from
May 27, 2021

Conversation

Alberth289346
Copy link
Contributor

While adding a new language, generating reports crashed on not finding the submitted files, even though it had parsed them successfully in the analysis phase.

After several hours digging, I found that the cause was that Jplag assumes that tokens contain relative paths while generating reports. That doesn't hold for my parser. Instead, it did:

        String dir = "/path/to/exercise1";  // Command-line path to the root of submitted files
        String tokenPath = "/path/to/exercise1/stud1/x.y"; // Path stored in tokens to submitted files[X].

        File dpath = new File(dir);
        File fpath = new File(dpath, tokenPath); // As in old line 225 of Submission.java
        System.out.printf("fpath = %s\n", fpath.getPath());

which then outputs paths like fpath = /path/to/exercise1/path/to/exercise1/stud1/x.y
That of course has no hope of ever finding the file, so I patched the Submission code to deal with absolute paths from tokens.

@tsaglam tsaglam merged commit 3445d22 into jplag:master May 27, 2021
@Alberth289346 Alberth289346 deleted the fix-abs-token-paths branch December 2, 2021 06:19
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

Successfully merging this pull request may close these issues.

3 participants