@@ -1449,7 +1449,7 @@ protected void loadValidatedSettingsFrom(final NodeSettingsRO settings)
14491449if (iErrorCounter == arrDeprecatedKeys .length - 1 ) {
14501450LOGGER .debug ("Deprecated keys did not work either. - Giving up." );
14511451
1452- if (bIgnoreNonExistingSetting ) {
1452+ if (bIgnoreNonExistingSetting && isNonExistingSettingException ( excOrig ) ) {
14531453LOGGER .warn ("The new setting '" + newKey + "' was not known when the node" +
14541454(nodeName == null ? "" : " '" + nodeName + "'" ) + " was saved. " +
14551455"Please save the workflow again to include it for the future." );
@@ -1465,7 +1465,7 @@ protected void loadValidatedSettingsFrom(final NodeSettingsRO settings)
14651465setting .loadSettingsFrom (settings );
14661466}
14671467catch (final InvalidSettingsException excOrig ) {
1468- if (bIgnoreNonExistingSetting ) {
1468+ if (bIgnoreNonExistingSetting && isNonExistingSettingException ( excOrig ) ) {
14691469LOGGER .debug ("A new setting was not known when the node" +
14701470(nodeName == null ? "" : " '" + nodeName + "'" ) + " was saved." );
14711471}
@@ -1547,7 +1547,7 @@ protected void validateSettings(final NodeSettingsRO settings)
15471547if (iErrorCounter == arrDeprecatedKeys .length - 1 ) {
15481548LOGGER .debug ("Deprecated keys did not work either. - Giving up." );
15491549
1550- if (!bIgnoreNonExistingSetting ) {
1550+ if (!bIgnoreNonExistingSetting || ! isNonExistingSettingException ( excOrig ) ) {
15511551throw excOrig ;
15521552}
15531553}
@@ -1558,7 +1558,7 @@ protected void validateSettings(final NodeSettingsRO settings)
15581558setting .validateSettings (settings );
15591559}
15601560catch (final InvalidSettingsException excOrig ) {
1561- if (!bIgnoreNonExistingSetting ) {
1561+ if (!bIgnoreNonExistingSetting || ! isNonExistingSettingException ( excOrig ) ) {
15621562throw excOrig ;
15631563}
15641564}
@@ -2907,5 +2907,22 @@ protected static PortObject[] tablesToObjects(BufferedDataTable[] inTables) {
29072907.toArray (PortObject []::new );
29082908}
29092909
2910+ //
2911+ // Private static methods
2912+ //
2913+
2914+ /**
2915+ * Checks and returns True if the supplied {@code InvalidSettingsException} instance
2916+ * is about a non-existing settings entry, otherwise False.
2917+ *
2918+ * @param e The {@code InvalidSettingsException} instance to check.
2919+ * Can be null.
2920+ * @return True if the supplied {@code InvalidSettingsException} instance is about a non-existing settings entry, otherwise False.
2921+ */
2922+ private static boolean isNonExistingSettingException (InvalidSettingsException e ) {
2923+ return e != null && e .getMessage () != null
2924+ && e .getMessage ().matches (".*? for key \" .*?\" not found." );
2925+ }
2926+
29102927}
29112928
0 commit comments