Bug Description
In Submission.java, a HashSet of the submission files is created as input for the method Language::parse. The iterator of the HashSet class, which determines the order in which the files are tokenized, seems to depend on internal state, resulting in a different file order when I extract a subset of submissions into another directory compared to the complete submission set. Specifically, the token order does not usually correspond to the file order in Submission::files, which seems counterintuitive.
As GreedyStringTiling is implemented to prefer earlier matches (w.r.t. the token list), a different file tokenization order may result in different matching, so we should set a fixed file order for tokenization. I therefore propose to change the Language API to accept Lists of Files instead of Sets, avoiding randomness in file order for tokenization and enabling consistency with the file order in Submission::files.
Find attached two screenshots displaying this behavior: Two comparisons of the same submission pair result in a different matching (118 vs. 120 matches) using the same algorithm, but the submissions are located inside different subsets of the submission set. The resulting average similarity differs by ~0.54 percentage points: 40.172 % vs. 40.715 %.
JPlag Version
develop/7.0.0-SNAPSHOT
Operating System
Windows 11
Java Version
Temurin 25
Bug Description
In
Submission.java, aHashSetof the submission files is created as input for the methodLanguage::parse. The iterator of theHashSetclass, which determines the order in which the files are tokenized, seems to depend on internal state, resulting in a different file order when I extract a subset of submissions into another directory compared to the complete submission set. Specifically, the token order does not usually correspond to the file order inSubmission::files, which seems counterintuitive.As
GreedyStringTilingis implemented to prefer earlier matches (w.r.t. the token list), a different file tokenization order may result in different matching, so we should set a fixed file order for tokenization. I therefore propose to change theLanguageAPI to acceptLists ofFiles instead ofSets, avoiding randomness in file order for tokenization and enabling consistency with the file order inSubmission::files.Find attached two screenshots displaying this behavior: Two comparisons of the same submission pair result in a different matching (118 vs. 120 matches) using the same algorithm, but the submissions are located inside different subsets of the submission set. The resulting average similarity differs by ~0.54 percentage points: 40.172 % vs. 40.715 %.
JPlag Version
develop/7.0.0-SNAPSHOT
Operating System
Windows 11
Java Version
Temurin 25