Misc. adjustments

Properties file was encoded using latin1 again!

The JaCoCo agent should not execute when running the server,
use mvn jacoco:prepare-agent test jacoco:report
when generating test coverage.
This commit is contained in:
Arne Keller 2021-02-08 09:52:09 +01:00
parent d4e9d3b566
commit 22705727cb
8 changed files with 14 additions and 41 deletions

View File

@ -1,8 +0,0 @@
{
"recommendations": [
"runem.lit-plugin",
"vscjava.vscode-java-pack",
"pivotal.vscode-spring-boot",
],
"unwantedRecommendations": []
}

15
pom.xml
View File

@ -206,21 +206,6 @@
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.6</version>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<!-- attached to Maven test phase -->
<execution>
<id>report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>

View File

@ -10,7 +10,7 @@ import java.util.List;
import java.util.Optional;
/**
* Utility class to avoid unification logic duplication in type methods.
* Utility class to avoid unification logic duplication in type methods (constrainEqualTo*).
*
* @see Type
*/
@ -50,7 +50,7 @@ final class UnificationUtil {
}
static Result<UnificationActions, UnificationError> namedNamed(NamedType a, NamedType b) {
if (a != b) {
if (!a.equals(b)) {
return new Result<>(null, UnificationError.DIFFERENT_TYPES);
} else {
return new Result<>(new UnificationActions());

View File

@ -9,7 +9,7 @@ public final class LatexCreatorConstants {
protected static final String IN = "in";
protected static final String CONSTRAINT_SET = "C";
protected static final String NEW_LINE = System.lineSeparator();
protected static final String NEW_LINE = "\n";
protected static final String SPACE = " ";
protected static final String DOLLAR_SIGN = "$";
protected static final String EQUALS = "=";

View File

@ -57,7 +57,6 @@ public class InputBar extends HorizontalLayout implements LocaleChangeObserver {
inputField.setId(INPUT_FIELD_ID);
inputField.setClearButtonVisible(true);
inputField.setMaxLength(1000); // TODO: perhaps remove the error message? more than 1000 can't be entered now
inputField.setValueChangeMode(ValueChangeMode.EAGER); // TODO: this causes a lot of network traffic
// attach a listener that replaces \ with λ
// JavaScript is used because Vaadin does not have APIs for selectionStart/selectionEnd
// and this will be much faster than a bunch of network round trips per character entered!
@ -95,8 +94,7 @@ public class InputBar extends HorizontalLayout implements LocaleChangeObserver {
*/
protected void inferTerm(String term) {
inputField.setValue(term);
UI.getCurrent().getPage().executeJs(
String.format("document.getElementById('%s').click()", INFER_BUTTON_ID));
UI.getCurrent().getPage().executeJs("document.getElementById($0).click()", INFER_BUTTON_ID);
}
private void onTypeInferButtonClick(Consumer<Pair<String, Map<String, String>>> callback) {

View File

@ -17,35 +17,34 @@ import com.vaadin.flow.i18n.LocaleChangeObserver;
public class TypeAssumptionField extends HorizontalLayout implements LocaleChangeObserver {
private static final long serialVersionUID = -81579298585584658L;
/*
* IDs for the imported .css-file
*/
private static final String MINUS_ICON_ID = "minusIcon";
private static final String ASS_DELETE_BUTTON_ID = "assDeleteButton";
private static final String ASSUMPTIONS_FIELD_ID = "typeAssumptionField";
private final Button deleteButton;
private final TextField variableInputField;
private final TextField typeInputField;
protected TypeAssumptionField(final Consumer<TypeAssumptionField> deleteSelf) {
protected TypeAssumptionField(Consumer<TypeAssumptionField> deleteSelf) {
variableInputField = new TextField();
variableInputField.setLabel(getTranslation("root.variable"));
typeInputField = new TextField();
typeInputField.setLabel(getTranslation("root.type"));
Icon minusIcon = new Icon(VaadinIcon.MINUS_CIRCLE);
minusIcon.setId(MINUS_ICON_ID);
deleteButton = new Button(minusIcon, event -> deleteSelf.accept(this));
Button deleteButton = new Button(minusIcon, event -> deleteSelf.accept(this));
deleteButton.setId(ASS_DELETE_BUTTON_ID);
add(variableInputField, typeInputField, deleteButton);
setId(ASSUMPTIONS_FIELD_ID);
}
protected String getVariable() {
return variableInputField.getOptionalValue().orElse(StringUtils.EMPTY);
}
protected String getType() {
return typeInputField.getOptionalValue().orElse(StringUtils.EMPTY);
}
@ -55,5 +54,5 @@ public class TypeAssumptionField extends HorizontalLayout implements LocaleChang
variableInputField.setLabel(getTranslation("root.variable"));
typeInputField.setLabel(getTranslation("root.type"));
}
}

View File

@ -1,6 +1,5 @@
root.domain=http://localhost:8080/
root.lambda=\u03BB
root.home=home
root.typicalc=Typicalc
root.examplebutton=\uD83D\uDCC2
root.termGrammar=\u2329Term\u232A ::= \u2329App\u232A | \u2329Abs\u232A | (\u2329Term\u232A) | \

View File

@ -19,8 +19,8 @@ root.selectLanguage=Sprache
root.termExplanation=Die folgende Grammatik beschreibt den Aufbau eines gültigen Terms:
root.assExplanation=Die folgende Grammatik beschreibt die Syntax eines gültigen Typs:
root.typeAssumptions=Typannahmen
root.addAssumption=Typannahme hinzufügen
root.deleteAll=Alle löschen
root.addAssumption=Typannahme hinzufügen
root.deleteAll=Alle löschen
root.variable=Variable
root.type=Typ