-
Notifications
You must be signed in to change notification settings - Fork 332
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feature/avoidProgressBarOverlap
- Loading branch information
Showing
13 changed files
with
162 additions
and
184 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package de.jplag.options; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
import java.util.Set; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import de.jplag.java.JavaLanguage; | ||
|
||
class JPlagOptionsTest { | ||
@Test | ||
void testWithLanguageOption() { | ||
JavaLanguage lang = new JavaLanguage(); | ||
JPlagOptions options = new JPlagOptions(null, Set.of(), Set.of()); | ||
options = options.withLanguageOption(lang); | ||
|
||
assertEquals(lang, options.language()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
language-antlr-utils/src/main/java/de/jplag/antlr/AntlrLoggerErrorListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package de.jplag.antlr; | ||
|
||
import org.antlr.v4.runtime.BaseErrorListener; | ||
import org.antlr.v4.runtime.RecognitionException; | ||
import org.antlr.v4.runtime.Recognizer; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
/** | ||
* Writes error messages from ANTLR to a logger | ||
*/ | ||
public class AntlrLoggerErrorListener extends BaseErrorListener { | ||
private static final Logger logger = LoggerFactory.getLogger(AntlrLoggerErrorListener.class); | ||
private static final String ERROR_TEMPLATE = "ANTLR error - line {}:{} {}"; | ||
|
||
@Override | ||
public void syntaxError(Recognizer<?, ?> recognizer, Object offendingSymbol, int line, int charPositionInLine, String msg, | ||
RecognitionException e) { | ||
logger.error(ERROR_TEMPLATE, line, charPositionInLine, msg); | ||
} | ||
} |
Oops, something went wrong.