You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Java version:
java version "17.0.9" 2023-10-17 LTS
Java(TM) SE Runtime Environment (build 17.0.9+11-LTS-201)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.9+11-LTS-201, mixed mode, sharing)
Contents of python files: Two duplicate submissions of a single python file, which only contains a space character. whitespace.py
Output:
java -jar jplag-4.3.0-jar-with-dependencies.jar -l python3 -t 2 python_files
2024-01-16-04:01:55_636 [main] [INFO] LanguageLoader - Available languages: '[C/C++ Scanner [basic markup], C/C++ Parser, C# 6 Parser, EMF metamodel, Go Parser, Javac based AST plugin, Kotlin Parser, Python3 Parser, R Parser, Rust Language Module, Scala parser, SchemeR4RS Parser [basic markup], Swift Parser, Text Parser (naive)]'
2024-01-16-04:01:55_647 [main] [INFO] ParallelComparisonStrategy - Start comparing...
line 1:1 extraneous input ' ' expecting {<EOF>, STRING, NUMBER, 'def', 'return', 'raise', 'from', 'import', 'global', 'nonlocal', 'assert', 'if', 'while', 'for', 'try', 'with', 'lambda', 'not', 'None', 'True', 'False', 'class', 'yield', 'del', 'pass', 'continue', 'break', 'async', 'await', NEWLINE, NAME, '...', '*', '(', '[', '+', '-', '~', '{', '@'}
line 1:1 extraneous input ' ' expecting {<EOF>, STRING, NUMBER, 'def', 'return', 'raise', 'from', 'import', 'global', 'nonlocal', 'assert', 'if', 'while', 'for', 'try', 'with', 'lambda', 'not', 'None', 'True', 'False', 'class', 'yield', 'del', 'pass', 'continue', 'break', 'async', 'await', NEWLINE, NAME, '...', '*', '(', '[', '+', '-', '~', '{', '@'}
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: offset -4, count 5, length 4096
at java.base/java.lang.String.checkBoundsOffCount(String.java:4593)
at java.base/java.lang.String.<init>(String.java:523)
at org.antlr.v4.runtime.CodePointCharStream$CodePoint8BitCharStream.getText(CodePointCharStream.java:160)
at org.antlr.v4.runtime.CommonToken.getText(CommonToken.java:170)
at org.antlr.v4.runtime.tree.TerminalNodeImpl.getText(TerminalNodeImpl.java:54)
at de.jplag.python3.JplagPython3Listener.visitTerminal(JplagPython3Listener.java:210)
at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:29)
at de.jplag.python3.Parser.parseFile(Parser.java:62)
at de.jplag.python3.Parser.parse(Parser.java:39)
at de.jplag.python3.Language.parse(Language.java:45)
at de.jplag.Submission.parse(Submission.java:249)
at de.jplag.SubmissionSet.parseSubmissions(SubmissionSet.java:147)
at de.jplag.SubmissionSet.parseAllSubmissions(SubmissionSet.java:103)
at de.jplag.SubmissionSet.<init>(SubmissionSet.java:45)
at de.jplag.SubmissionSetBuilder.buildSubmissionSet(SubmissionSetBuilder.java:78)
at de.jplag.JPlag.run(JPlag.java:55)
at de.jplag.cli.CLI.main(CLI.java:91)
When running the command listed above, I would not expect an uncaught top level exception. This behavior causes checks for other files in the submission to be disregarded, as the program crashes.
The text was updated successfully, but these errors were encountered:
In the current version of JPlag ANTLR does not throw an exception for this, so the error should not occur anymore. However, there won't be a general fix for this, because then submission that cause ANTLR to crash would not be shown in the final result and the error message might easily be missed in the log.
A python file containing only whitespace crashes JPlag.
Using the jar with dependencies supplied in the latest release at this time: 4.3.0
Command:
java -jar jplag-4.3.0-jar-with-dependencies.jar -l python3 -t 2 python_files
Java version:
java version "17.0.9" 2023-10-17 LTS
Java(TM) SE Runtime Environment (build 17.0.9+11-LTS-201)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.9+11-LTS-201, mixed mode, sharing)
Contents of python files: Two duplicate submissions of a single python file, which only contains a space character.
whitespace.py
Output:
When running the command listed above, I would not expect an uncaught top level exception. This behavior causes checks for other files in the submission to be disregarded, as the program crashes.
The text was updated successfully, but these errors were encountered: