From 6c475645d425586cfad175d36556d28f6a70ec15 Mon Sep 17 00:00:00 2001 From: Peter Tsongalis Date: Sun, 12 Jun 2022 16:06:58 -0700 Subject: [PATCH] [1373] PR review fixes Move hasRecoveryDevice to RocketComponent and reimplement FlightConfiguration version to check for FlightConfiguration errors. --- .../rocketcomponent/FlightConfiguration.java | 17 +++++------------ .../rocketcomponent/RocketComponent.java | 13 +++++++++++++ 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/core/src/net/sf/openrocket/rocketcomponent/FlightConfiguration.java b/core/src/net/sf/openrocket/rocketcomponent/FlightConfiguration.java index 9d9bd6a72..2ae0211fa 100644 --- a/core/src/net/sf/openrocket/rocketcomponent/FlightConfiguration.java +++ b/core/src/net/sf/openrocket/rocketcomponent/FlightConfiguration.java @@ -549,21 +549,14 @@ public class FlightConfiguration implements FlightConfigurableParameter iterator = this.iterator(); + while (iterator.hasNext()) { + RocketComponent child = iterator.next(); + if (child instanceof RecoveryDevice) { + return true; + } + } + return false; + } ////////////// Methods that may not be overridden ////////////