[gh-833] Handle legacy SPEL validation setting

This commit is contained in:
aboyko
2022-09-09 15:25:51 -04:00
parent 77d2f4dfad
commit b4ed5bc68d
2 changed files with 15 additions and 3 deletions

View File

@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2016, 2017 Pivotal, Inc.
* Copyright (c) 2016, 2022 Pivotal, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -14,13 +14,22 @@ import java.util.ArrayList;
import java.util.List;
import java.util.function.Consumer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class ListenerList<T> {
private static Logger log = LoggerFactory.getLogger(ListenerList.class);
private List<Consumer<T>> listeners = new ArrayList<>();
public synchronized void fire(T evt) {
for (Consumer<T> l : listeners) {
l.accept(evt);
try {
l.accept(evt);
} catch (Exception e) {
log.error("", e);
}
}
}

View File

@@ -125,8 +125,11 @@ public class BootJavaConfig implements InitializingBean {
// Legacy case
if ("true".equalsIgnoreCase(enabled)) {
return true;
} else if ("false".equalsIgnoreCase(enabled)) {
return false;
} else {
return Toggle.Option.valueOf(enabled) == Toggle.Option.ON;
}
return Toggle.Option.valueOf(enabled) == Toggle.Option.ON;
}
}