Skip to content

Commit

Permalink
Merge pull request #1629 from lf-lang/fix-validation
Browse files Browse the repository at this point in the history
Fix validation of target properties
  • Loading branch information
lhstrh authored Mar 10, 2023
2 parents 481fae1 + 3119f62 commit 0e00a81
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions org.lflang/src/org/lflang/validation/LFValidator.java
Original file line number Diff line number Diff line change
Expand Up @@ -1034,7 +1034,7 @@ public void checkTargetProperties(KeyValuePairs targetProperties) {

private KeyValuePair getKeyValuePair(KeyValuePairs targetProperties, TargetProperty property) {
List<KeyValuePair> properties = targetProperties.getPairs().stream()
.filter(pair -> pair.getName() == property.description)
.filter(pair -> pair.getName().equals(property.description))
.toList();
assert (properties.size() <= 1);
return properties.size() > 0 ? properties.get(0) : null;
Expand Down Expand Up @@ -1128,7 +1128,7 @@ private void validateSchedulerTargetProperties(KeyValuePairs targetProperties) {
private void validateRos2TargetProperties(KeyValuePairs targetProperties) {
KeyValuePair ros2 = getKeyValuePair(targetProperties, TargetProperty.ROS2);
KeyValuePair ros2Dependencies = getKeyValuePair(targetProperties, TargetProperty.ROS2_DEPENDENCIES);
if (!ASTUtils.toBoolean(ros2.getValue()) && ros2Dependencies != null) {
if (ros2Dependencies != null && (ros2 == null || !ASTUtils.toBoolean(ros2.getValue()))) {
warning(
"Ignoring ros2-dependencies as ros2 compilation is disabled",
ros2Dependencies,
Expand Down

0 comments on commit 0e00a81

Please sign in to comment.