Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for validation of target properties #1629

Merged
merged 1 commit into from
Mar 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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