[gh-833] Handle legacy SPEL validation setting
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user