Skip to content

Commit

Permalink
Fixed build errors and code style
Browse files Browse the repository at this point in the history
  • Loading branch information
TwoOfTwelve committed Dec 2, 2024
1 parent d62a358 commit f9dfa80
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
5 changes: 4 additions & 1 deletion cli/src/test/java/de/jplag/cli/LanguageTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@
import de.jplag.cli.test.CliArgument;
import de.jplag.cli.test.CliTest;
import de.jplag.exceptions.ExitException;
import de.jplag.multilang.MultiLanguage;
import de.jplag.options.JPlagOptions;

class LanguageTest extends CliTest {
private static final List<Class<? extends Language>> ignoredLanguages = List.of(MultiLanguage.class);

@Test
void testDefaultLanguage() throws ExitException, IOException {
Expand Down Expand Up @@ -58,6 +60,7 @@ void testCustomSuffixes() throws ExitException, IOException {
}

public static Collection<Language> getAllLanguages() {
return LanguageLoader.getAllAvailableLanguages().values();
return LanguageLoader.getAllAvailableLanguages().values().stream().filter(language -> !ignoredLanguages.contains(language.getClass()))
.toList();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class DefaultLanguageOption<T> implements LanguageOption<T> {
this.hasValue = true;
}

DefaultLanguageOption(OptionType<T> type, String description, String name) {
DefaultLanguageOption(OptionType<T> type, String name, String description) {
this(type, name, description, null);
this.hasValue = false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ protected <T> LanguageOption<T> createDefaultOption(OptionType<T> type, String n
* @return The new option
*/
protected <T> LanguageOption<T> createOption(OptionType<T> type, String name, String description) {
LanguageOption<T> option = new DefaultLanguageOption<>(type, description, name);
LanguageOption<T> option = new DefaultLanguageOption<>(type, name, description);
this.options.add(option);
return option;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
public class MultiLanguageOptions extends LanguageOptions {
private static final String ERROR_LANGUAGE_NOT_FOUND = "The selected language %s could not be found";
private static final String ERROR_NOT_ENOUGH_LANGUAGES = "To use multi language specify at least 1 language";
private static final String OPTION_DESCRIPTION_LANGUAGES = "The languages that should be used. This is a ',' separated list";

public LanguageOption<String> languageNames = createOption(OptionType.string(), "languages",
"The languages that should be used. This is a ',' separated list");
public LanguageOption<String> languageNames = createOption(OptionType.string(), "languages", OPTION_DESCRIPTION_LANGUAGES);
private List<Language> languages = null;

public List<Language> getLanguages() {
Expand Down

0 comments on commit f9dfa80

Please sign in to comment.