diff --git a/core/src/main/java/org/lflang/AbstractTargetProperty.java b/core/src/main/java/org/lflang/AbstractTargetProperty.java index 19745ba27f..7723beafab 100644 --- a/core/src/main/java/org/lflang/AbstractTargetProperty.java +++ b/core/src/main/java/org/lflang/AbstractTargetProperty.java @@ -167,4 +167,14 @@ public void update(TargetConfig config, Element node, MessageReporter reporter) public void update(TargetConfig config, String value, MessageReporter reporter) { this.update(config, fromString(value, reporter)); } + + @Override + public boolean equals(Object obj) { + return obj.getClass().getName().equals(this.getClass().getName()); + } + + @Override + public int hashCode() { + return this.getClass().getName().hashCode(); + } } diff --git a/core/src/main/java/org/lflang/federated/generator/FedGenerator.java b/core/src/main/java/org/lflang/federated/generator/FedGenerator.java index afa7e30627..6eee6656ee 100644 --- a/core/src/main/java/org/lflang/federated/generator/FedGenerator.java +++ b/core/src/main/java/org/lflang/federated/generator/FedGenerator.java @@ -422,8 +422,11 @@ private void analyzeFederates(Reactor federation, LFGeneratorContext context) { && !federation.getHost().getAddr().equals("localhost")) { rtiConfig.setHost(federation.getHost().getAddr()); } + + var d = new DockerProperty(); + var x = targetConfig.get(d); // If the federation is dockerized, use "rti" as the hostname. - if (rtiConfig.getHost().equals("localhost") && targetConfig.get(new DockerProperty()).enabled) { + if (rtiConfig.getHost().equals("localhost") && x.enabled) { rtiConfig.setHost("rti"); } diff --git a/core/src/main/java/org/lflang/target/TargetConfig.java b/core/src/main/java/org/lflang/target/TargetConfig.java index 524266f802..7c416eb376 100644 --- a/core/src/main/java/org/lflang/target/TargetConfig.java +++ b/core/src/main/java/org/lflang/target/TargetConfig.java @@ -189,7 +189,7 @@ public void override( /** Reset this target property to its initial value (and mark it as unset). */ public void reset(AbstractTargetProperty property) { - this.properties.remove(property); + this.properties.put(property, property.initialValue()); this.setProperties.remove(property); }