Use diamond operator
Issue: SWF-1718
This commit is contained in:
@@ -55,7 +55,7 @@ public abstract class AbstractCachingMapDecorator<K, V> implements Map<K, V>, Se
|
||||
* @param weak whether to use weak references for keys and values
|
||||
*/
|
||||
public AbstractCachingMapDecorator(boolean weak) {
|
||||
Map<K, Object> internalMap = (weak ? new WeakHashMap<K, Object>() : new HashMap<K, Object>());
|
||||
Map<K, Object> internalMap = (weak ? new WeakHashMap<>() : new HashMap<>());
|
||||
this.targetMap = Collections.synchronizedMap(internalMap);
|
||||
this.synchronize = true;
|
||||
this.weak = weak;
|
||||
@@ -68,7 +68,7 @@ public abstract class AbstractCachingMapDecorator<K, V> implements Map<K, V>, Se
|
||||
* @param size the initial cache size
|
||||
*/
|
||||
public AbstractCachingMapDecorator(boolean weak, int size) {
|
||||
Map<K, Object> internalMap = weak ? new WeakHashMap<K, Object> (size) : new HashMap<K, Object>(size);
|
||||
Map<K, Object> internalMap = weak ? new WeakHashMap<K, Object> (size) : new HashMap<>(size);
|
||||
this.targetMap = Collections.synchronizedMap(internalMap);
|
||||
this.synchronize = true;
|
||||
this.weak = weak;
|
||||
@@ -161,11 +161,11 @@ public abstract class AbstractCachingMapDecorator<K, V> implements Map<K, V>, Se
|
||||
public Set<K> keySet() {
|
||||
if (this.synchronize) {
|
||||
synchronized (this.targetMap) {
|
||||
return new LinkedHashSet<K>(this.targetMap.keySet());
|
||||
return new LinkedHashSet<>(this.targetMap.keySet());
|
||||
}
|
||||
}
|
||||
else {
|
||||
return new LinkedHashSet<K>(this.targetMap.keySet());
|
||||
return new LinkedHashSet<>(this.targetMap.keySet());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -182,7 +182,7 @@ public abstract class AbstractCachingMapDecorator<K, V> implements Map<K, V>, Se
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private Collection<V> valuesCopy() {
|
||||
LinkedList<V> values = new LinkedList<V>();
|
||||
LinkedList<V> values = new LinkedList<>();
|
||||
for (Iterator<Object> it = this.targetMap.values().iterator(); it.hasNext();) {
|
||||
Object value = it.next();
|
||||
if (value instanceof Reference) {
|
||||
@@ -210,7 +210,7 @@ public abstract class AbstractCachingMapDecorator<K, V> implements Map<K, V>, Se
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private Set<Map.Entry<K, V>> entryCopy() {
|
||||
Map<K,V> entries = new LinkedHashMap<K, V>();
|
||||
Map<K,V> entries = new LinkedHashMap<>();
|
||||
for (Iterator<Entry<K, Object>> it = this.targetMap.entrySet().iterator(); it.hasNext();) {
|
||||
Entry<K, Object> entry = it.next();
|
||||
Object value = entry.getValue();
|
||||
@@ -238,7 +238,7 @@ public abstract class AbstractCachingMapDecorator<K, V> implements Map<K, V>, Se
|
||||
newValue = NULL_VALUE;
|
||||
}
|
||||
else if (useWeakValue(key, value)) {
|
||||
newValue = new WeakReference<Object>(newValue);
|
||||
newValue = new WeakReference<>(newValue);
|
||||
}
|
||||
return unwrapReturnValue(this.targetMap.put(key, newValue));
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ public class GenericConversionService implements ConversionService {
|
||||
* A map of custom converters. Custom converters are assigned a unique identifier that can be used to lookup the
|
||||
* converter. This allows multiple converters for the same source->target class to be registered.
|
||||
*/
|
||||
private final Map<String, Converter> customConverters = new HashMap<String, Converter>();
|
||||
private final Map<String, Converter> customConverters = new HashMap<>();
|
||||
|
||||
/**
|
||||
* Indexes classes by well-known aliases.
|
||||
|
||||
@@ -190,7 +190,7 @@ public class ELExpressionParser implements ExpressionParser {
|
||||
}
|
||||
|
||||
private static class VariableMapperImpl extends VariableMapper {
|
||||
private Map<String, ValueExpression> variables = new HashMap<String, ValueExpression>();
|
||||
private Map<String, ValueExpression> variables = new HashMap<>();
|
||||
|
||||
public ValueExpression resolveVariable(String name) {
|
||||
return variables.get(name);
|
||||
|
||||
@@ -155,7 +155,7 @@ public class SpringELExpression implements Expression {
|
||||
if (expressionVariables == null) {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
Map<String, Object> variableValues = new HashMap<String, Object>(expressionVariables.size());
|
||||
Map<String, Object> variableValues = new HashMap<>(expressionVariables.size());
|
||||
for (Map.Entry<String, Expression> var : expressionVariables.entrySet()) {
|
||||
variableValues.put(var.getKey(), var.getValue().getValue(rootObject));
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ public class SpringELExpressionParser implements ExpressionParser {
|
||||
|
||||
private final ConversionService conversionService;
|
||||
|
||||
private final List<PropertyAccessor> propertyAccessors = new ArrayList<PropertyAccessor>();
|
||||
private final List<PropertyAccessor> propertyAccessors = new ArrayList<>();
|
||||
|
||||
public SpringELExpressionParser(SpelExpressionParser expressionParser) {
|
||||
this(expressionParser, new DefaultConversionService());
|
||||
@@ -116,7 +116,7 @@ public class SpringELExpressionParser implements ExpressionParser {
|
||||
if (expressionVars == null || expressionVars.length == 0) {
|
||||
return null;
|
||||
}
|
||||
Map<String, Expression> result = new HashMap<String, Expression>(expressionVars.length);
|
||||
Map<String, Expression> result = new HashMap<>(expressionVars.length);
|
||||
for (ExpressionVariable var : expressionVars) {
|
||||
result.put(var.getName(), parseExpression(var.getValueExpression(), var.getParserContext()));
|
||||
}
|
||||
|
||||
@@ -172,7 +172,7 @@ public abstract class AbstractExpressionParser implements ExpressionParser {
|
||||
* @throws ParserException when the expressions cannot be parsed
|
||||
*/
|
||||
private Expression[] parseExpressions(String expressionString, ParserContext context) throws ParserException {
|
||||
List<Expression> expressions = new LinkedList<Expression>();
|
||||
List<Expression> expressions = new LinkedList<>();
|
||||
int startIdx = 0;
|
||||
while (startIdx < expressionString.length()) {
|
||||
int prefixIndex = expressionString.indexOf(getExpressionPrefix(), startIdx);
|
||||
@@ -227,7 +227,7 @@ public abstract class AbstractExpressionParser implements ExpressionParser {
|
||||
if (variables == null || variables.length == 0) {
|
||||
return null;
|
||||
}
|
||||
Map<String, Expression> variableExpressions = new HashMap<String, Expression>(variables.length, 1);
|
||||
Map<String, Expression> variableExpressions = new HashMap<>(variables.length, 1);
|
||||
for (ExpressionVariable var : variables) {
|
||||
variableExpressions.put(var.getName(), parseExpression(var.getValueExpression(), var.getParserContext()));
|
||||
}
|
||||
|
||||
@@ -114,6 +114,6 @@ public class FluentParserContext implements ParserContext {
|
||||
}
|
||||
|
||||
private void init() {
|
||||
expressionVariables = new ArrayList<ExpressionVariable>();
|
||||
expressionVariables = new ArrayList<>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ public class DefaultMapper implements Mapper {
|
||||
|
||||
private static final Log logger = LogFactory.getLog(DefaultMapper.class);
|
||||
|
||||
private List<DefaultMapping> mappings = new ArrayList<DefaultMapping>();
|
||||
private List<DefaultMapping> mappings = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* Add a mapping to this mapper.
|
||||
|
||||
@@ -50,7 +50,7 @@ public class DefaultMappingContext {
|
||||
public DefaultMappingContext(Object source, Object target) {
|
||||
this.source = source;
|
||||
this.target = target;
|
||||
this.mappingResults = new ArrayList<MappingResult>();
|
||||
this.mappingResults = new ArrayList<>();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -69,7 +69,7 @@ public class DefaultMappingResults implements MappingResults {
|
||||
}
|
||||
|
||||
public List<MappingResult> getErrorResults() {
|
||||
List<MappingResult> errorResults = new ArrayList<MappingResult>();
|
||||
List<MappingResult> errorResults = new ArrayList<>();
|
||||
for (MappingResult result : mappingResults) {
|
||||
if (result.isError()) {
|
||||
errorResults.add(result);
|
||||
@@ -79,7 +79,7 @@ public class DefaultMappingResults implements MappingResults {
|
||||
}
|
||||
|
||||
public List<MappingResult> getResults(MappingResultsCriteria criteria) {
|
||||
List<MappingResult> results = new ArrayList<MappingResult>();
|
||||
List<MappingResult> results = new ArrayList<>();
|
||||
for (MappingResult result : mappingResults) {
|
||||
if (criteria.test(result)) {
|
||||
results.add(result);
|
||||
|
||||
@@ -48,7 +48,7 @@ public class DefaultMessageContext implements StateManageableMessageContext {
|
||||
new LinkedHashMap<Object, List<Message>>()) {
|
||||
|
||||
protected List<Message> create(Object source) {
|
||||
return new ArrayList<Message>();
|
||||
return new ArrayList<>();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -75,7 +75,7 @@ public class DefaultMessageContext implements StateManageableMessageContext {
|
||||
// implementing message context
|
||||
|
||||
public Message[] getAllMessages() {
|
||||
List<Message> messages = new ArrayList<Message>();
|
||||
List<Message> messages = new ArrayList<>();
|
||||
for (List<Message> list : sourceMessages.values()) {
|
||||
messages.addAll(list);
|
||||
}
|
||||
@@ -88,7 +88,7 @@ public class DefaultMessageContext implements StateManageableMessageContext {
|
||||
}
|
||||
|
||||
public Message[] getMessagesByCriteria(MessageCriteria criteria) {
|
||||
List<Message> messages = new ArrayList<Message>();
|
||||
List<Message> messages = new ArrayList<>();
|
||||
for (List<Message> sourceMessages : this.sourceMessages.values()) {
|
||||
for (Message message : sourceMessages) {
|
||||
if (criteria.test(message)) {
|
||||
|
||||
@@ -44,11 +44,11 @@ public class MessageBuilder {
|
||||
|
||||
private Object source;
|
||||
|
||||
private Set<String> codes = new LinkedHashSet<String>();
|
||||
private Set<String> codes = new LinkedHashSet<>();
|
||||
|
||||
private Severity severity;
|
||||
|
||||
private List<Object> args = new ArrayList<Object>();
|
||||
private List<Object> args = new ArrayList<>();
|
||||
|
||||
private String defaultText;
|
||||
|
||||
|
||||
@@ -119,7 +119,7 @@ public class MessageContextErrors extends AbstractErrors {
|
||||
if (messages.length == 0) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
List<ObjectError> errors = new ArrayList<ObjectError>(messages.length);
|
||||
List<ObjectError> errors = new ArrayList<>(messages.length);
|
||||
for (Message message : messages) {
|
||||
errors.add(new ObjectError(objectName, message.getText()));
|
||||
}
|
||||
@@ -131,7 +131,7 @@ public class MessageContextErrors extends AbstractErrors {
|
||||
if (messages.length == 0) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
List<FieldError> errors = new ArrayList<FieldError>(messages.length);
|
||||
List<FieldError> errors = new ArrayList<>(messages.length);
|
||||
for (Message message : messages) {
|
||||
errors.add(new FieldError(objectName, (String) message.getSource(), message.getText()));
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ public class Parameters {
|
||||
* @param size the size
|
||||
*/
|
||||
public Parameters(int size) {
|
||||
this.parameters = new ArrayList<Parameter>(size);
|
||||
this.parameters = new ArrayList<>(size);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -57,7 +57,7 @@ public class Parameters {
|
||||
* @param parameter the single parameter
|
||||
*/
|
||||
public Parameters(Parameter parameter) {
|
||||
this.parameters = new ArrayList<Parameter>(1);
|
||||
this.parameters = new ArrayList<>(1);
|
||||
add(parameter);
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ public class Parameters {
|
||||
* @param parameters the parameters
|
||||
*/
|
||||
public Parameters(Parameter... parameters) {
|
||||
this.parameters = new ArrayList<Parameter>(parameters.length);
|
||||
this.parameters = new ArrayList<>(parameters.length);
|
||||
addAll(parameters);
|
||||
}
|
||||
|
||||
|
||||
@@ -9,11 +9,11 @@ public class MapAccessorTests extends TestCase {
|
||||
private MapAccessor<String, Object> accessor;
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("string", "hello");
|
||||
map.put("integer", 9);
|
||||
map.put("null", null);
|
||||
this.accessor = new MapAccessor<String, Object>(map);
|
||||
this.accessor = new MapAccessor<>(map);
|
||||
}
|
||||
|
||||
public void testAccessNullAttribute() {
|
||||
|
||||
@@ -27,8 +27,8 @@ import junit.framework.TestCase;
|
||||
*/
|
||||
public class SharedMapDecoratorTests extends TestCase {
|
||||
|
||||
private SharedMapDecorator<String, String> map = new SharedMapDecorator<String, String>(
|
||||
new HashMap<String, String>());
|
||||
private SharedMapDecorator<String, String> map = new SharedMapDecorator<>(
|
||||
new HashMap<>());
|
||||
|
||||
public void testGetPutRemove() {
|
||||
assertTrue(map.size() == 0);
|
||||
@@ -48,7 +48,7 @@ public class SharedMapDecoratorTests extends TestCase {
|
||||
}
|
||||
|
||||
public void testPutAll() {
|
||||
Map<String, String> all = new HashMap<String, String>();
|
||||
Map<String, String> all = new HashMap<>();
|
||||
all.put("foo", "bar");
|
||||
all.put("bar", "baz");
|
||||
map.putAll(all);
|
||||
|
||||
@@ -28,7 +28,7 @@ import junit.framework.TestCase;
|
||||
*/
|
||||
public class StringKeyedMapAdapterTests extends TestCase {
|
||||
|
||||
private Map<String, String> contents = new HashMap<String, String>();
|
||||
private Map<String, String> contents = new HashMap<>();
|
||||
|
||||
private StringKeyedMapAdapter<String> map = new StringKeyedMapAdapter<String>() {
|
||||
|
||||
@@ -67,7 +67,7 @@ public class StringKeyedMapAdapterTests extends TestCase {
|
||||
}
|
||||
|
||||
public void testPutAll() {
|
||||
Map<String, String> all = new HashMap<String, String>();
|
||||
Map<String, String> all = new HashMap<>();
|
||||
all.put("foo", "bar");
|
||||
all.put("bar", "baz");
|
||||
map.putAll(all);
|
||||
|
||||
@@ -49,7 +49,7 @@ public class DefaultConversionServiceTests extends TestCase {
|
||||
|
||||
public void testConvertCompatibleTypes() {
|
||||
DefaultConversionService service = new DefaultConversionService();
|
||||
List<Object> lst = new ArrayList<Object>();
|
||||
List<Object> lst = new ArrayList<>();
|
||||
assertSame(lst, service.getConversionExecutor(ArrayList.class, List.class).execute(lst));
|
||||
}
|
||||
|
||||
@@ -250,7 +250,7 @@ public class DefaultConversionServiceTests extends TestCase {
|
||||
DefaultConversionService service = new DefaultConversionService();
|
||||
service.addConverter("princy", new CustomTwoWayConverter());
|
||||
ConversionExecutor executor = service.getConversionExecutor("princy", List.class, Principal[].class);
|
||||
List<String> princyList = new ArrayList<String>();
|
||||
List<String> princyList = new ArrayList<>();
|
||||
princyList.add("princy1");
|
||||
princyList.add("princy2");
|
||||
Principal[] p = (Principal[]) executor.execute(princyList);
|
||||
@@ -272,7 +272,7 @@ public class DefaultConversionServiceTests extends TestCase {
|
||||
return "princy2";
|
||||
}
|
||||
};
|
||||
List<Principal> princyList = new ArrayList<Principal>();
|
||||
List<Principal> princyList = new ArrayList<>();
|
||||
princyList.add(princy1);
|
||||
princyList.add(princy2);
|
||||
String[] p = (String[]) executor.execute(princyList);
|
||||
@@ -373,7 +373,7 @@ public class DefaultConversionServiceTests extends TestCase {
|
||||
DefaultConversionService service = new DefaultConversionService();
|
||||
service.addConverter("princy", new CustomTwoWayConverter());
|
||||
ConversionExecutor executor = service.getConversionExecutor("princy", List.class, List.class);
|
||||
List<String> princyList = new ArrayList<String>();
|
||||
List<String> princyList = new ArrayList<>();
|
||||
princyList.add("princy1");
|
||||
princyList.add("princy2");
|
||||
List<Principal> list = (List<Principal>) executor.execute(princyList);
|
||||
@@ -396,7 +396,7 @@ public class DefaultConversionServiceTests extends TestCase {
|
||||
return "princy2";
|
||||
}
|
||||
};
|
||||
List<Principal> princyList = new ArrayList<Principal>();
|
||||
List<Principal> princyList = new ArrayList<>();
|
||||
princyList.add(princy1);
|
||||
princyList.add(princy2);
|
||||
List<String> list = (List<String>) executor.execute(princyList);
|
||||
@@ -408,7 +408,7 @@ public class DefaultConversionServiceTests extends TestCase {
|
||||
DefaultConversionService service = new DefaultConversionService();
|
||||
service.addConverter("princy", new CustomTwoWayConverter());
|
||||
ConversionExecutor executor = service.getConversionExecutor("princy", List.class, List.class);
|
||||
List<Integer> princyList = new ArrayList<Integer>();
|
||||
List<Integer> princyList = new ArrayList<>();
|
||||
princyList.add(1);
|
||||
try {
|
||||
executor.execute(princyList);
|
||||
@@ -456,7 +456,7 @@ public class DefaultConversionServiceTests extends TestCase {
|
||||
public void testListToArrayConversion() {
|
||||
DefaultConversionService service = new DefaultConversionService();
|
||||
ConversionExecutor executor = service.getConversionExecutor(Collection.class, String[].class);
|
||||
List<String> list = new ArrayList<String>();
|
||||
List<String> list = new ArrayList<>();
|
||||
list.add("1");
|
||||
list.add("2");
|
||||
list.add("3");
|
||||
@@ -470,7 +470,7 @@ public class DefaultConversionServiceTests extends TestCase {
|
||||
public void testSetToListConversion() {
|
||||
DefaultConversionService service = new DefaultConversionService();
|
||||
ConversionExecutor executor = service.getConversionExecutor(Set.class, List.class);
|
||||
Set<String> set = new LinkedHashSet<String>();
|
||||
Set<String> set = new LinkedHashSet<>();
|
||||
set.add("1");
|
||||
set.add("2");
|
||||
set.add("3");
|
||||
@@ -599,7 +599,7 @@ public class DefaultConversionServiceTests extends TestCase {
|
||||
}
|
||||
|
||||
protected Object toObject(String string, Class<?> targetClass) throws Exception {
|
||||
List<Principal> principals = new ArrayList<Principal>();
|
||||
List<Principal> principals = new ArrayList<>();
|
||||
StringTokenizer tokenizer = new StringTokenizer(string, ",");
|
||||
while (tokenizer.hasMoreTokens()) {
|
||||
final String name = tokenizer.nextToken();
|
||||
|
||||
@@ -27,7 +27,7 @@ public class TestBean {
|
||||
|
||||
private Date date;
|
||||
|
||||
private List<Object> list = new ArrayList<Object>();
|
||||
private List<Object> list = new ArrayList<>();
|
||||
|
||||
public boolean isFlag() {
|
||||
return flag;
|
||||
|
||||
@@ -56,7 +56,7 @@ public class MapAdaptableELResolverTests extends TestCase {
|
||||
}
|
||||
|
||||
private class TestMapAdaptable implements MapAdaptable<String, String> {
|
||||
private Map<String, String> map = new HashMap<String, String>();
|
||||
private Map<String, String> map = new HashMap<>();
|
||||
|
||||
public TestMapAdaptable() {
|
||||
map.put("bar", "bar");
|
||||
|
||||
@@ -23,7 +23,7 @@ public class TestBean {
|
||||
private String value = "foo";
|
||||
private int maximum = 2;
|
||||
private TestBean bean;
|
||||
private List<String> list = new ArrayList<String>();
|
||||
private List<String> list = new ArrayList<>();
|
||||
|
||||
public TestBean() {
|
||||
initList();
|
||||
|
||||
@@ -49,7 +49,7 @@ public class DefaultMapperTests extends TestCase {
|
||||
DefaultMapping mapping1 = new DefaultMapping(parser.parseExpression("beep", null), parser.parseExpression(
|
||||
"beep", null));
|
||||
mapper.addMapping(mapping1);
|
||||
Map<String, String> bean1 = new HashMap<String, String>();
|
||||
Map<String, String> bean1 = new HashMap<>();
|
||||
bean1.put("beep", "en");
|
||||
TestBean2 bean2 = new TestBean2();
|
||||
MappingResults results = mapper.map(bean1, bean2);
|
||||
@@ -61,7 +61,7 @@ public class DefaultMapperTests extends TestCase {
|
||||
DefaultMapping mapping1 = new DefaultMapping(parser.parseExpression("boop", null), parser.parseExpression(
|
||||
"boop", null));
|
||||
mapper.addMapping(mapping1);
|
||||
Map<String, String> bean1 = new HashMap<String, String>();
|
||||
Map<String, String> bean1 = new HashMap<>();
|
||||
bean1.put("boop", "bogus");
|
||||
TestBean2 bean2 = new TestBean2();
|
||||
MappingResults results = mapper.map(bean1, bean2);
|
||||
|
||||
@@ -80,7 +80,7 @@ public class MessageContextErrorsTests extends TestCase {
|
||||
}
|
||||
|
||||
public void testAddAllErrors() {
|
||||
MapBindingResult result = new MapBindingResult(new HashMap<Object, Object>(), "object");
|
||||
MapBindingResult result = new MapBindingResult(new HashMap<>(), "object");
|
||||
result.reject("bar", new Object[] { "boop" }, null);
|
||||
result.rejectValue("field", "bar", new Object[] { "boop" }, null);
|
||||
errors.addAllErrors(result);
|
||||
|
||||
@@ -106,7 +106,7 @@ public class AbstractFacesFlowConfiguration implements ApplicationContextAware {
|
||||
@Bean
|
||||
public SimpleUrlHandlerMapping jsrResourceHandlerMapping() {
|
||||
|
||||
Map<String, Object> urlMap = new HashMap<String, Object>();
|
||||
Map<String, Object> urlMap = new HashMap<>();
|
||||
urlMap.put("/javax.faces.resource/**", jsfResourceRequestHandler());
|
||||
if (isRichFacesPresent) {
|
||||
urlMap.put("/rfRes/**", jsfResourceRequestHandler());
|
||||
|
||||
@@ -75,7 +75,7 @@ public class ResourcesBeanDefinitionParser implements BeanDefinitionParser {
|
||||
}
|
||||
|
||||
private void registerHandlerMappings(Element element, Object source, ParserContext parserContext) {
|
||||
Map<String, String> urlMap = new ManagedMap<String, String>();
|
||||
Map<String, String> urlMap = new ManagedMap<>();
|
||||
urlMap.put("/javax.faces.resource/**", SERVLET_RESOURCE_HANDLER_BEAN_NAME);
|
||||
|
||||
if (isRichFacesPresent) {
|
||||
|
||||
@@ -30,7 +30,7 @@ import org.springframework.util.Assert;
|
||||
*/
|
||||
public class ManySelectionTrackingListDataModel<T> extends SerializableListDataModel<T> implements SelectionAware<T> {
|
||||
|
||||
private List<T> selections = new ArrayList<T>();
|
||||
private List<T> selections = new ArrayList<>();
|
||||
|
||||
public ManySelectionTrackingListDataModel() {
|
||||
super();
|
||||
|
||||
@@ -33,7 +33,7 @@ public class OneSelectionTrackingListDataModel<T> extends SerializableListDataMo
|
||||
/**
|
||||
* The list of currently selected row data objects.
|
||||
*/
|
||||
private List<T> selections = new ArrayList<T>();
|
||||
private List<T> selections = new ArrayList<>();
|
||||
|
||||
public OneSelectionTrackingListDataModel() {
|
||||
super();
|
||||
|
||||
@@ -37,7 +37,7 @@ public class SerializableListDataModel<T> extends ListDataModel<T> implements Se
|
||||
|
||||
|
||||
public SerializableListDataModel() {
|
||||
this(new ArrayList<T>());
|
||||
this(new ArrayList<>());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -46,7 +46,7 @@ public class SerializableListDataModel<T> extends ListDataModel<T> implements Se
|
||||
*/
|
||||
public SerializableListDataModel(List<T> list) {
|
||||
if (list == null) {
|
||||
list = new ArrayList<T>();
|
||||
list = new ArrayList<>();
|
||||
}
|
||||
setWrappedData(list);
|
||||
}
|
||||
@@ -58,7 +58,7 @@ public class SerializableListDataModel<T> extends ListDataModel<T> implements Se
|
||||
|
||||
public void setWrappedData(Object data) {
|
||||
if (data == null) {
|
||||
data = new ArrayList<T>();
|
||||
data = new ArrayList<>();
|
||||
}
|
||||
Assert.isInstanceOf(List.class, data, "The data object for " + getClass() + " must be a List");
|
||||
super.setWrappedData(data);
|
||||
|
||||
@@ -107,7 +107,7 @@ public class FlowActionListener implements ActionListener {
|
||||
if (requestContext.getMessageContext().hasErrorMessages()) {
|
||||
isValid = false;
|
||||
if (requestContext.getExternalContext().isAjaxRequest()) {
|
||||
List<String> fragments = new ArrayList<String>();
|
||||
List<String> fragments = new ArrayList<>();
|
||||
String formId = getModelExpression(requestContext).getExpressionString();
|
||||
if (facesContext.getViewRoot().findComponent(formId) != null) {
|
||||
fragments.add(formId);
|
||||
|
||||
@@ -68,7 +68,7 @@ public class FlowFacesContext extends FacesContextWrapper {
|
||||
|
||||
private static final Map<Severity, FacesMessage.Severity> SPRING_SEVERITY_TO_FACES;
|
||||
static {
|
||||
SPRING_SEVERITY_TO_FACES = new HashMap<Severity, FacesMessage.Severity>();
|
||||
SPRING_SEVERITY_TO_FACES = new HashMap<>();
|
||||
SPRING_SEVERITY_TO_FACES.put(Severity.INFO, FacesMessage.SEVERITY_INFO);
|
||||
SPRING_SEVERITY_TO_FACES.put(Severity.WARNING, FacesMessage.SEVERITY_WARN);
|
||||
SPRING_SEVERITY_TO_FACES.put(Severity.ERROR, FacesMessage.SEVERITY_ERROR);
|
||||
@@ -77,7 +77,7 @@ public class FlowFacesContext extends FacesContextWrapper {
|
||||
|
||||
private static final Map<FacesMessage.Severity, Severity> FACES_SEVERITY_TO_SPRING;
|
||||
static {
|
||||
FACES_SEVERITY_TO_SPRING = new HashMap<FacesMessage.Severity, Severity>();
|
||||
FACES_SEVERITY_TO_SPRING = new HashMap<>();
|
||||
for (Map.Entry<Severity, FacesMessage.Severity> entry : SPRING_SEVERITY_TO_FACES.entrySet()) {
|
||||
FACES_SEVERITY_TO_SPRING.put(entry.getValue(), entry.getKey());
|
||||
}
|
||||
@@ -167,7 +167,7 @@ public class FlowFacesContext extends FacesContextWrapper {
|
||||
* Returns an Iterator for all component clientId's for which messages have been added.
|
||||
*/
|
||||
public Iterator<String> getClientIdsWithMessages() {
|
||||
Set<String> clientIds = new LinkedHashSet<String>();
|
||||
Set<String> clientIds = new LinkedHashSet<>();
|
||||
for (Message message : this.context.getMessageContext().getAllMessages()) {
|
||||
Object source = message.getSource();
|
||||
if (source != null && source instanceof String) {
|
||||
@@ -243,7 +243,7 @@ public class FlowFacesContext extends FacesContextWrapper {
|
||||
if (messages == null || messages.length == 0) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
List<FacesMessage> facesMessages = new ArrayList<FacesMessage>();
|
||||
List<FacesMessage> facesMessages = new ArrayList<>();
|
||||
for (Message message : messages) {
|
||||
facesMessages.add(asFacesMessage(message));
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ public class FlowPartialViewContext extends PartialViewContextWrapper {
|
||||
RequestContext requestContext = RequestContextHolder.getRequestContext();
|
||||
String[] fragmentIds = (String[]) requestContext.getFlashScope().get(View.RENDER_FRAGMENTS_ATTRIBUTE);
|
||||
if (fragmentIds != null && fragmentIds.length > 0) {
|
||||
return new ArrayList<String>(Arrays.asList(fragmentIds));
|
||||
return new ArrayList<>(Arrays.asList(fragmentIds));
|
||||
}
|
||||
}
|
||||
return getWrapped().getRenderIds();
|
||||
|
||||
@@ -48,7 +48,7 @@ public class FlowResourceResolver extends ResourceResolver {
|
||||
*/
|
||||
private static final List<String> RESOLVERS_CLASSES;
|
||||
static {
|
||||
List<String> resolvers = new ArrayList<String>();
|
||||
List<String> resolvers = new ArrayList<>();
|
||||
resolvers.add("com.sun.faces.facelets.impl.DefaultResourceResolver");
|
||||
resolvers.add("org.apache.myfaces.view.facelets.impl.DefaultResourceResolver");
|
||||
RESOLVERS_CLASSES = Collections.unmodifiableList(resolvers);
|
||||
|
||||
@@ -51,7 +51,7 @@ public class JsfManagedBeanAwareELExpressionParser extends ELExpressionParser {
|
||||
private static class RequestContextELContextFactory implements ELContextFactory {
|
||||
public ELContext getELContext(Object target) {
|
||||
RequestContext context = (RequestContext) target;
|
||||
List<ELResolver> customResolvers = new ArrayList<ELResolver>();
|
||||
List<ELResolver> customResolvers = new ArrayList<>();
|
||||
customResolvers.add(new RequestContextELResolver(context));
|
||||
customResolvers.add(new FlowResourceELResolver(context));
|
||||
customResolvers.add(new ImplicitFlowVariableELResolver(context));
|
||||
|
||||
@@ -51,11 +51,11 @@ public class SelectionTrackingActionListenerTests extends TestCase {
|
||||
public void setUp() throws Exception {
|
||||
this.jsfMockHelper.setUp();
|
||||
this.viewToTest = new UIViewRoot();
|
||||
List<Object> rows = new ArrayList<Object>();
|
||||
List<Object> rows = new ArrayList<>();
|
||||
rows.add(new TestRowData());
|
||||
rows.add(new TestRowData());
|
||||
rows.add(new TestRowData());
|
||||
this.dataModel = new OneSelectionTrackingListDataModel<Object>(rows);
|
||||
this.dataModel = new OneSelectionTrackingListDataModel<>(rows);
|
||||
}
|
||||
|
||||
protected void tearDown() throws Exception {
|
||||
|
||||
@@ -18,7 +18,7 @@ public class DataModelConverterTests extends TestCase {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public void testConvertListToDataModel() throws Exception {
|
||||
List<Object> sourceList = new ArrayList<Object>();
|
||||
List<Object> sourceList = new ArrayList<>();
|
||||
|
||||
DataModel<Object> resultModel = (DataModel<Object>) this.converter.convertSourceToTargetClass(sourceList,
|
||||
DataModel.class);
|
||||
@@ -29,7 +29,7 @@ public class DataModelConverterTests extends TestCase {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public void testConvertListToListDataModel() throws Exception {
|
||||
List<Object> sourceList = new ArrayList<Object>();
|
||||
List<Object> sourceList = new ArrayList<>();
|
||||
|
||||
DataModel<Object> resultModel = (DataModel<Object>) this.converter.convertSourceToTargetClass(sourceList,
|
||||
ListDataModel.class);
|
||||
@@ -40,7 +40,7 @@ public class DataModelConverterTests extends TestCase {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public void testConvertListToSerializableListDataModel() throws Exception {
|
||||
List<Object> sourceList = new ArrayList<Object>();
|
||||
List<Object> sourceList = new ArrayList<>();
|
||||
|
||||
DataModel<Object> resultModel = (DataModel<Object>) this.converter.convertSourceToTargetClass(sourceList,
|
||||
SerializableListDataModel.class);
|
||||
|
||||
@@ -18,7 +18,7 @@ public class FacesConversionServiceTests extends TestCase {
|
||||
|
||||
public void testGetAbstractType() {
|
||||
ConversionExecutor executor = this.service.getConversionExecutor(List.class, DataModel.class);
|
||||
ArrayList<Object> list = new ArrayList<Object>();
|
||||
ArrayList<Object> list = new ArrayList<>();
|
||||
list.add("foo");
|
||||
executor.execute(list);
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ public class JsfViewTests extends TestCase {
|
||||
JsfView view = (JsfView) this.resolver.resolveViewName("intro", new Locale("EN"));
|
||||
view.setApplicationContext(new StaticWebApplicationContext());
|
||||
view.setServletContext(new MockServletContext());
|
||||
view.render(new HashMap<String, Object>(), new MockHttpServletRequest(), new MockHttpServletResponse());
|
||||
view.render(new HashMap<>(), new MockHttpServletRequest(), new MockHttpServletResponse());
|
||||
}
|
||||
|
||||
private class ResourceCheckingViewHandler extends MockViewHandler {
|
||||
|
||||
@@ -31,7 +31,7 @@ public class FlowActionListenerTests extends TestCase {
|
||||
|
||||
this.listener = new FlowActionListener(this.jsfMock.application().getActionListener());
|
||||
RequestContextHolder.setRequestContext(this.context);
|
||||
LocalAttributeMap<Object> flash = new LocalAttributeMap<Object>();
|
||||
LocalAttributeMap<Object> flash = new LocalAttributeMap<>();
|
||||
EasyMock.expect(this.context.getFlashScope()).andStubReturn(flash);
|
||||
EasyMock.expect(this.context.getCurrentState()).andStubReturn(new MockViewState());
|
||||
EasyMock.replay(new Object[] { this.context });
|
||||
|
||||
@@ -65,7 +65,7 @@ public class FlowELResolverTests extends TestCase {
|
||||
}
|
||||
|
||||
public void testMapAdaptableResolve() throws Exception {
|
||||
LocalAttributeMap<String> base = new LocalAttributeMap<String>();
|
||||
LocalAttributeMap<String> base = new LocalAttributeMap<>();
|
||||
base.put("test", "test");
|
||||
Object actual = this.resolver.getValue(this.elContext, base, "test");
|
||||
assertTrue(this.elContext.isPropertyResolved());
|
||||
|
||||
@@ -193,7 +193,7 @@ public class FlowFacesContextTests extends TestCase {
|
||||
EasyMock.expect(this.requestContext.getMessageContext()).andStubReturn(this.messageContext);
|
||||
EasyMock.replay(new Object[] { this.requestContext });
|
||||
|
||||
List<String> expectedOrderedIds = new ArrayList<String>();
|
||||
List<String> expectedOrderedIds = new ArrayList<>();
|
||||
expectedOrderedIds.add(null);
|
||||
expectedOrderedIds.add("componentId");
|
||||
expectedOrderedIds.add("userMessage");
|
||||
|
||||
@@ -43,7 +43,7 @@ public class FlowResponseStateManagerTests extends TestCase {
|
||||
|
||||
public void testWriteFlowSerializedView() throws Exception {
|
||||
EasyMock.expect(this.flowExecutionContext.getKey()).andReturn(new MockFlowExecutionKey("e1s1"));
|
||||
LocalAttributeMap<Object> viewMap = new LocalAttributeMap<Object>();
|
||||
LocalAttributeMap<Object> viewMap = new LocalAttributeMap<>();
|
||||
EasyMock.expect(this.requestContext.getViewScope()).andStubReturn(viewMap);
|
||||
EasyMock.expect(this.requestContext.getFlowExecutionContext()).andReturn(this.flowExecutionContext);
|
||||
EasyMock.replay(this.requestContext, this.flowExecutionContext);
|
||||
@@ -61,7 +61,7 @@ public class FlowResponseStateManagerTests extends TestCase {
|
||||
public void testGetState() throws Exception {
|
||||
Object state = new Object();
|
||||
|
||||
LocalAttributeMap<Object> viewMap = new LocalAttributeMap<Object>();
|
||||
LocalAttributeMap<Object> viewMap = new LocalAttributeMap<>();
|
||||
viewMap.put(FlowResponseStateManager.FACES_VIEW_STATE, state);
|
||||
EasyMock.expect(this.requestContext.getViewScope()).andStubReturn(viewMap);
|
||||
EasyMock.replay(this.requestContext);
|
||||
|
||||
@@ -7,7 +7,7 @@ public class JSFManagedBean {
|
||||
|
||||
String prop1;
|
||||
JSFModel model;
|
||||
List<String> values = new ArrayList<String>();
|
||||
List<String> values = new ArrayList<>();
|
||||
|
||||
public JSFModel getModel() {
|
||||
return this.model;
|
||||
|
||||
@@ -76,10 +76,10 @@ public class JsfFinalResponseActionTests extends TestCase {
|
||||
ext.setNativeRequest(new MockHttpServletRequest());
|
||||
ext.setNativeResponse(new MockHttpServletResponse());
|
||||
EasyMock.expect(this.context.getExternalContext()).andStubReturn(ext);
|
||||
LocalAttributeMap<Object> requestMap = new LocalAttributeMap<Object>();
|
||||
LocalAttributeMap<Object> requestMap = new LocalAttributeMap<>();
|
||||
EasyMock.expect(this.context.getFlashScope()).andStubReturn(requestMap);
|
||||
EasyMock.expect(this.context.getRequestParameters()).andStubReturn(
|
||||
new LocalParameterMap(new HashMap<String, Object>()));
|
||||
new LocalParameterMap(new HashMap<>()));
|
||||
}
|
||||
|
||||
public void testRender() throws Exception {
|
||||
@@ -119,7 +119,7 @@ public class JsfFinalResponseActionTests extends TestCase {
|
||||
|
||||
private class TrackingPhaseListener implements PhaseListener {
|
||||
|
||||
private final List<String> phaseCallbacks = new ArrayList<String>();
|
||||
private final List<String> phaseCallbacks = new ArrayList<>();
|
||||
|
||||
public void afterPhase(PhaseEvent event) {
|
||||
String phaseCallback = "AFTER_" + event.getPhaseId();
|
||||
|
||||
@@ -27,7 +27,7 @@ public class JsfUtilsTests extends AbstractJsfTestCase {
|
||||
}
|
||||
|
||||
public void testBeforeListenersCalledInForwardOrder() throws Exception {
|
||||
List<OrderVerifyingPhaseListener> list = new ArrayList<OrderVerifyingPhaseListener>();
|
||||
List<OrderVerifyingPhaseListener> list = new ArrayList<>();
|
||||
MockLifecycle lifecycle = new MockLifecycle();
|
||||
PhaseListener listener1 = new OrderVerifyingPhaseListener(null, list);
|
||||
lifecycle.addPhaseListener(listener1);
|
||||
@@ -42,7 +42,7 @@ public class JsfUtilsTests extends AbstractJsfTestCase {
|
||||
}
|
||||
|
||||
public void testAfterListenersCalledInReverseOrder() throws Exception {
|
||||
List<OrderVerifyingPhaseListener> list = new ArrayList<OrderVerifyingPhaseListener>();
|
||||
List<OrderVerifyingPhaseListener> list = new ArrayList<>();
|
||||
MockLifecycle lifecycle = new MockLifecycle();
|
||||
PhaseListener listener1 = new OrderVerifyingPhaseListener(list, null);
|
||||
lifecycle.addPhaseListener(listener1);
|
||||
|
||||
@@ -54,7 +54,7 @@ public class JsfViewFactoryTests extends TestCase {
|
||||
|
||||
private final RequestContext context = EasyMock.createMock(RequestContext.class);
|
||||
|
||||
private final LocalAttributeMap<Object> flashMap = new LocalAttributeMap<Object>();
|
||||
private final LocalAttributeMap<Object> flashMap = new LocalAttributeMap<>();
|
||||
|
||||
private final ViewHandler viewHandler = new MockViewHandler();
|
||||
|
||||
@@ -81,7 +81,7 @@ public class JsfViewFactoryTests extends TestCase {
|
||||
EasyMock.expect(this.context.getFlashScope()).andStubReturn(this.flashMap);
|
||||
EasyMock.expect(this.context.getExternalContext()).andStubReturn(this.extContext);
|
||||
EasyMock.expect(this.context.getRequestParameters()).andStubReturn(
|
||||
new LocalParameterMap(new HashMap<String, Object>()));
|
||||
new LocalParameterMap(new HashMap<>()));
|
||||
}
|
||||
|
||||
protected void tearDown() throws Exception {
|
||||
@@ -302,7 +302,7 @@ public class JsfViewFactoryTests extends TestCase {
|
||||
|
||||
private class TrackingPhaseListener implements PhaseListener {
|
||||
|
||||
private final List<String> phaseCallbacks = new ArrayList<String>();
|
||||
private final List<String> phaseCallbacks = new ArrayList<>();
|
||||
|
||||
public void afterPhase(PhaseEvent event) {
|
||||
String phaseCallback = "AFTER_" + event.getPhaseId();
|
||||
|
||||
@@ -32,11 +32,11 @@ import javax.faces.context.ExternalContext;
|
||||
|
||||
public class MockJsfExternalContext extends ExternalContext {
|
||||
|
||||
private final Map<String, Object> applicationMap = new HashMap<String, Object>();
|
||||
private final Map<String, Object> applicationMap = new HashMap<>();
|
||||
|
||||
private final Map<String, Object> sessionMap = new HashMap<String, Object>();
|
||||
private final Map<String, Object> sessionMap = new HashMap<>();
|
||||
|
||||
private Map<String, Object> requestMap = new HashMap<String, Object>();
|
||||
private Map<String, Object> requestMap = new HashMap<>();
|
||||
|
||||
private Map<String, String> requestParameterMap = Collections.emptyMap();
|
||||
|
||||
|
||||
@@ -93,8 +93,8 @@ public class CompositeAction extends AbstractAction {
|
||||
public Event doExecute(RequestContext context) throws Exception {
|
||||
Action[] actions = getActions();
|
||||
String eventId = getEventFactorySupport().getSuccessEventId();
|
||||
MutableAttributeMap<Object> eventAttributes = new LocalAttributeMap<Object>();
|
||||
List<Event> actionResults = new ArrayList<Event>(actions.length);
|
||||
MutableAttributeMap<Object> eventAttributes = new LocalAttributeMap<>();
|
||||
List<Event> actionResults = new ArrayList<>(actions.length);
|
||||
for (Action action : actions) {
|
||||
Event result = action.execute(context);
|
||||
actionResults.add(result);
|
||||
|
||||
@@ -55,7 +55,7 @@ public class FlowDefinitionRedirectAction extends AbstractAction {
|
||||
if (index != -1) {
|
||||
flowDefinitionId = encodedRedirect.substring(0, index);
|
||||
String[] parameters = StringUtils.delimitedListToStringArray(encodedRedirect.substring(index + 1), "&");
|
||||
executionInput = new LocalAttributeMap<String>(parameters.length, 1);
|
||||
executionInput = new LocalAttributeMap<>(parameters.length, 1);
|
||||
for (String nameAndValue : parameters) {
|
||||
index = nameAndValue.indexOf('=');
|
||||
if (index != -1) {
|
||||
|
||||
@@ -50,11 +50,11 @@ import org.springframework.webflow.engine.model.registry.FlowModelHolder;
|
||||
*/
|
||||
public class FlowDefinitionRegistryBuilder {
|
||||
|
||||
private final List<FlowLocation> flowLocations = new ArrayList<FlowLocation>();
|
||||
private final List<FlowLocation> flowLocations = new ArrayList<>();
|
||||
|
||||
private final List<String> flowLocationPatterns = new ArrayList<String>();
|
||||
private final List<String> flowLocationPatterns = new ArrayList<>();
|
||||
|
||||
private final List<FlowBuilderInfo> flowBuilderInfos = new ArrayList<FlowBuilderInfo>();
|
||||
private final List<FlowBuilderInfo> flowBuilderInfos = new ArrayList<>();
|
||||
|
||||
private FlowBuilderServices flowBuilderServices;
|
||||
|
||||
@@ -246,7 +246,7 @@ public class FlowDefinitionRegistryBuilder {
|
||||
|
||||
private void registerFlowLocationPatterns(DefaultFlowRegistry flowRegistry) {
|
||||
for (String pattern : this.flowLocationPatterns) {
|
||||
AttributeMap<Object> attributes = new LocalAttributeMap<Object>();
|
||||
AttributeMap<Object> attributes = new LocalAttributeMap<>();
|
||||
updateFlowAttributes(attributes);
|
||||
FlowDefinitionResource[] resources;
|
||||
try {
|
||||
@@ -313,8 +313,8 @@ public class FlowDefinitionRegistryBuilder {
|
||||
this.path = path;
|
||||
this.id = id;
|
||||
this.attributes = (attributes != null) ?
|
||||
new LocalAttributeMap<Object>(attributes) :
|
||||
new LocalAttributeMap<Object>(new HashMap<String, Object>());
|
||||
new LocalAttributeMap<>(attributes) :
|
||||
new LocalAttributeMap<>(new HashMap<>());
|
||||
}
|
||||
|
||||
public String getPath() {
|
||||
@@ -342,8 +342,8 @@ public class FlowDefinitionRegistryBuilder {
|
||||
this.builder = builder;
|
||||
this.id = id;
|
||||
this.attributes = (attributes != null) ?
|
||||
new LocalAttributeMap<Object>(attributes) :
|
||||
new LocalAttributeMap<Object>(new HashMap<String, Object>());
|
||||
new LocalAttributeMap<>(attributes) :
|
||||
new LocalAttributeMap<>(new HashMap<>());
|
||||
}
|
||||
|
||||
public FlowBuilder getBuilder() {
|
||||
|
||||
@@ -51,7 +51,7 @@ class FlowExecutionListenerLoaderBeanDefinitionParser extends AbstractSingleBean
|
||||
* criteria
|
||||
*/
|
||||
private Map<RuntimeBeanReference, String> parseListenersWithCriteria(List<Element> listeners) {
|
||||
Map<RuntimeBeanReference, String> listenersWithCriteria = new ManagedMap<RuntimeBeanReference, String>(
|
||||
Map<RuntimeBeanReference, String> listenersWithCriteria = new ManagedMap<>(
|
||||
listeners.size());
|
||||
for (Element listenerElement : listeners) {
|
||||
RuntimeBeanReference ref = new RuntimeBeanReference(listenerElement.getAttribute("ref"));
|
||||
|
||||
@@ -91,7 +91,7 @@ class FlowExecutorBeanDefinitionParser extends AbstractSingleBeanDefinitionParse
|
||||
private Set<Object> parseFlowExecutionAttributes(Element element) {
|
||||
Element executionAttributesElement = DomUtils.getChildElementByTagName(element, "flow-execution-attributes");
|
||||
if (executionAttributesElement != null) {
|
||||
HashSet<Object> attributes = new HashSet<Object>();
|
||||
HashSet<Object> attributes = new HashSet<>();
|
||||
Element redirectElement = DomUtils.getChildElementByTagName(executionAttributesElement,
|
||||
"always-redirect-on-pause");
|
||||
if (redirectElement != null) {
|
||||
|
||||
@@ -49,7 +49,7 @@ public class FlowExecutorBuilder {
|
||||
|
||||
private Integer maxFlowExecutionSnapshots;
|
||||
|
||||
private LocalAttributeMap<Object> executionAttributes = new LocalAttributeMap<Object>();
|
||||
private LocalAttributeMap<Object> executionAttributes = new LocalAttributeMap<>();
|
||||
|
||||
private ConditionalFlowExecutionListenerLoader listenerLoader;
|
||||
|
||||
@@ -214,7 +214,7 @@ public class FlowExecutorBuilder {
|
||||
}
|
||||
|
||||
private LocalAttributeMap<Object> getExecutionAttributes() {
|
||||
LocalAttributeMap<Object> attributes = new LocalAttributeMap<Object>(this.executionAttributes.asMap());
|
||||
LocalAttributeMap<Object> attributes = new LocalAttributeMap<>(this.executionAttributes.asMap());
|
||||
if (!attributes.contains("alwaysRedirectOnPause")) {
|
||||
attributes.put("alwaysRedirectOnPause", true);
|
||||
}
|
||||
|
||||
@@ -161,7 +161,7 @@ class FlowExecutorFactoryBean implements FactoryBean<FlowExecutor>, BeanClassLoa
|
||||
}
|
||||
|
||||
private MutableAttributeMap<Object> createFlowExecutionAttributes() {
|
||||
LocalAttributeMap<Object> executionAttributes = new LocalAttributeMap<Object>();
|
||||
LocalAttributeMap<Object> executionAttributes = new LocalAttributeMap<>();
|
||||
if (flowExecutionAttributes != null) {
|
||||
for (FlowElementAttribute attribute : flowExecutionAttributes) {
|
||||
executionAttributes.put(attribute.getName(), getConvertedValue(attribute));
|
||||
|
||||
@@ -81,7 +81,7 @@ class FlowRegistryBeanDefinitionParser extends AbstractSingleBeanDefinitionParse
|
||||
if (locationElements.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
List<FlowLocation> locations = new ArrayList<FlowLocation>(locationElements.size());
|
||||
List<FlowLocation> locations = new ArrayList<>(locationElements.size());
|
||||
for (Element locationElement : locationElements) {
|
||||
String id = locationElement.getAttribute("id");
|
||||
String path = locationElement.getAttribute("path");
|
||||
@@ -95,7 +95,7 @@ class FlowRegistryBeanDefinitionParser extends AbstractSingleBeanDefinitionParse
|
||||
if (locationPatternElements.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
List<String> locationPatterns = new ArrayList<String>(locationPatternElements.size());
|
||||
List<String> locationPatterns = new ArrayList<>(locationPatternElements.size());
|
||||
for (Element locationPatternElement : locationPatternElements) {
|
||||
String value = locationPatternElement.getAttribute("value");
|
||||
locationPatterns.add(value);
|
||||
@@ -108,7 +108,7 @@ class FlowRegistryBeanDefinitionParser extends AbstractSingleBeanDefinitionParse
|
||||
if (definitionAttributesElement != null) {
|
||||
List<Element> attributeElements = DomUtils.getChildElementsByTagName(definitionAttributesElement,
|
||||
"attribute");
|
||||
Set<FlowElementAttribute> attributes = new HashSet<FlowElementAttribute>(attributeElements.size());
|
||||
Set<FlowElementAttribute> attributes = new HashSet<>(attributeElements.size());
|
||||
for (Element attributeElement : attributeElements) {
|
||||
String name = attributeElement.getAttribute("name");
|
||||
String value = attributeElement.getAttribute("value");
|
||||
@@ -126,7 +126,7 @@ class FlowRegistryBeanDefinitionParser extends AbstractSingleBeanDefinitionParse
|
||||
if (builderElements.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
List<FlowBuilderInfo> builders = new ArrayList<FlowBuilderInfo>(builderElements.size());
|
||||
List<FlowBuilderInfo> builders = new ArrayList<>(builderElements.size());
|
||||
for (Element builderElement : builderElements) {
|
||||
String id = builderElement.getAttribute("id");
|
||||
String className = builderElement.getAttribute("class");
|
||||
|
||||
@@ -213,12 +213,12 @@ class FlowRegistryFactoryBean implements FactoryBean<FlowDefinitionRegistry>, Be
|
||||
private AttributeMap<Object> getFlowAttributes(Set<FlowElementAttribute> attributes) {
|
||||
MutableAttributeMap<Object> flowAttributes = null;
|
||||
if (flowBuilderServices.getDevelopment()) {
|
||||
flowAttributes = new LocalAttributeMap<Object>(1 + attributes.size(), 1);
|
||||
flowAttributes = new LocalAttributeMap<>(1 + attributes.size(), 1);
|
||||
flowAttributes.put("development", true);
|
||||
}
|
||||
if (!attributes.isEmpty()) {
|
||||
if (flowAttributes == null) {
|
||||
flowAttributes = new LocalAttributeMap<Object>(attributes.size(), 1);
|
||||
flowAttributes = new LocalAttributeMap<>(attributes.size(), 1);
|
||||
}
|
||||
for (FlowElementAttribute attribute : attributes) {
|
||||
flowAttributes.put(attribute.getName(), getConvertedValue(attribute));
|
||||
|
||||
@@ -30,7 +30,7 @@ import org.springframework.core.NamedThreadLocal;
|
||||
*/
|
||||
public final class ExternalContextHolder {
|
||||
|
||||
private static final ThreadLocal<ExternalContext> externalContextHolder = new NamedThreadLocal<ExternalContext>(
|
||||
private static final ThreadLocal<ExternalContext> externalContextHolder = new NamedThreadLocal<>(
|
||||
"Flow ExternalContext");
|
||||
|
||||
/**
|
||||
@@ -53,4 +53,4 @@ public final class ExternalContextHolder {
|
||||
private ExternalContextHolder() {
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ public class HttpServletRequestParameterMap extends StringKeyedMapAdapter<Object
|
||||
protected Iterator<String> getAttributeNames() {
|
||||
if (request instanceof MultipartHttpServletRequest) {
|
||||
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
|
||||
CompositeIterator<String> iterator = new CompositeIterator<String>();
|
||||
CompositeIterator<String> iterator = new CompositeIterator<>();
|
||||
iterator.add(multipartRequest.getFileMap().keySet().iterator());
|
||||
iterator.add(getRequestParameterNames());
|
||||
return iterator;
|
||||
|
||||
@@ -241,7 +241,7 @@ public class ServletExternalContext implements ExternalContext {
|
||||
public void requestFlowDefinitionRedirect(String flowId, MutableAttributeMap<?> input) throws IllegalStateException {
|
||||
assertResponseAllowed();
|
||||
flowDefinitionRedirectFlowId = flowId;
|
||||
flowDefinitionRedirectFlowInput = new LocalAttributeMap<Object>();
|
||||
flowDefinitionRedirectFlowInput = new LocalAttributeMap<>();
|
||||
if (input != null) {
|
||||
flowDefinitionRedirectFlowInput.putAll(input);
|
||||
}
|
||||
@@ -354,9 +354,9 @@ public class ServletExternalContext implements ExternalContext {
|
||||
this.request = request;
|
||||
this.response = response;
|
||||
this.requestParameterMap = new LocalParameterMap(new HttpServletRequestParameterMap(request));
|
||||
this.requestMap = new LocalAttributeMap<Object>(new HttpServletRequestMap(request));
|
||||
this.sessionMap = new LocalSharedAttributeMap<Object>(new HttpSessionMap(request));
|
||||
this.applicationMap = new LocalSharedAttributeMap<Object>(new HttpServletContextMap(context));
|
||||
this.requestMap = new LocalAttributeMap<>(new HttpServletRequestMap(request));
|
||||
this.sessionMap = new LocalSharedAttributeMap<>(new HttpSessionMap(request));
|
||||
this.applicationMap = new LocalSharedAttributeMap<>(new HttpServletContextMap(context));
|
||||
this.flowUrlHandler = flowUrlHandler;
|
||||
}
|
||||
|
||||
|
||||
@@ -72,6 +72,6 @@ public class HttpSessionMapBindingListener implements HttpSessionBindingListener
|
||||
* Create a attribute map binding event for given HTTP session binding event.
|
||||
*/
|
||||
private AttributeMapBindingEvent getContextBindingEvent(HttpSessionBindingEvent event) {
|
||||
return new AttributeMapBindingEvent(new LocalAttributeMap<Object>(sessionMap), event.getName(), listener);
|
||||
return new AttributeMapBindingEvent(new LocalAttributeMap<>(sessionMap), event.getName(), listener);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ public class ContainedConversation implements Conversation, Serializable {
|
||||
this.container = container;
|
||||
this.id = id;
|
||||
this.lock = lock;
|
||||
this.attributes = new HashMap<Object, Object>();
|
||||
this.attributes = new HashMap<>();
|
||||
}
|
||||
|
||||
protected void setContainer(ConversationContainer container) {
|
||||
|
||||
@@ -65,7 +65,7 @@ public class ConversationContainer implements Serializable {
|
||||
public ConversationContainer(int maxConversations, String sessionKey) {
|
||||
this.maxConversations = maxConversations;
|
||||
this.sessionKey = sessionKey;
|
||||
this.conversations = new CopyOnWriteArrayList<ContainedConversation>();
|
||||
this.conversations = new CopyOnWriteArrayList<>();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -42,7 +42,7 @@ public abstract class AnnotatedObject implements Annotated {
|
||||
/**
|
||||
* Additional properties further describing this object. The properties set in this map may be arbitrary.
|
||||
*/
|
||||
private LocalAttributeMap<Object> attributes = new LocalAttributeMap<Object>();
|
||||
private LocalAttributeMap<Object> attributes = new LocalAttributeMap<>();
|
||||
|
||||
// implementing Annotated
|
||||
|
||||
@@ -76,4 +76,4 @@ public abstract class AnnotatedObject implements Annotated {
|
||||
attributes.put(DESCRIPTION_PROPERTY, description);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ public class CollectionUtils {
|
||||
/**
|
||||
* The shared, singleton empty attribute map instance.
|
||||
*/
|
||||
public static final AttributeMap<Object> EMPTY_ATTRIBUTE_MAP = new LocalAttributeMap<Object>(
|
||||
public static final AttributeMap<Object> EMPTY_ATTRIBUTE_MAP = new LocalAttributeMap<>(
|
||||
Collections.<String, Object> emptyMap());
|
||||
|
||||
/**
|
||||
@@ -58,7 +58,7 @@ public class CollectionUtils {
|
||||
* @return the iterator
|
||||
*/
|
||||
public static <E> Iterator<E> toIterator(Enumeration<E> enumeration) {
|
||||
return new EnumerationIterator<E>(enumeration);
|
||||
return new EnumerationIterator<>(enumeration);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -68,7 +68,7 @@ public class CollectionUtils {
|
||||
* @return the unmodifiable map with a single element
|
||||
*/
|
||||
public static <V> AttributeMap<V> singleEntryMap(String attributeName, V attributeValue) {
|
||||
return new LocalAttributeMap<V>(attributeName, attributeValue);
|
||||
return new LocalAttributeMap<>(attributeName, attributeValue);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -215,12 +215,12 @@ public class LocalAttributeMap<V> implements MutableAttributeMap<V>, Serializabl
|
||||
|
||||
public AttributeMap<V> union(AttributeMap<? extends V> attributes) {
|
||||
if (attributes == null) {
|
||||
return new LocalAttributeMap<V>(getMapInternal());
|
||||
return new LocalAttributeMap<>(getMapInternal());
|
||||
} else {
|
||||
Map<String, V> map = createTargetMap();
|
||||
map.putAll(getMapInternal());
|
||||
map.putAll(attributes.asMap());
|
||||
return new LocalAttributeMap<V>(map);
|
||||
return new LocalAttributeMap<>(map);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -284,7 +284,7 @@ public class LocalAttributeMap<V> implements MutableAttributeMap<V>, Serializabl
|
||||
*/
|
||||
protected void initAttributes(Map<String, V> attributes) {
|
||||
this.attributes = attributes;
|
||||
attributeAccessor = new MapAccessor<String, V>(this.attributes);
|
||||
attributeAccessor = new MapAccessor<>(this.attributes);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -301,7 +301,7 @@ public class LocalAttributeMap<V> implements MutableAttributeMap<V>, Serializabl
|
||||
* @return the target map
|
||||
*/
|
||||
protected Map<String, V> createTargetMap() {
|
||||
return new HashMap<String, V>();
|
||||
return new HashMap<>();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -311,7 +311,7 @@ public class LocalAttributeMap<V> implements MutableAttributeMap<V>, Serializabl
|
||||
* @return the target map
|
||||
*/
|
||||
protected Map<String, V> createTargetMap(int size, int loadFactor) {
|
||||
return new HashMap<String, V>(size, loadFactor);
|
||||
return new HashMap<>(size, loadFactor);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -335,7 +335,7 @@ public class LocalAttributeMap<V> implements MutableAttributeMap<V>, Serializabl
|
||||
|
||||
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
|
||||
in.defaultReadObject();
|
||||
attributeAccessor = new MapAccessor<String, V>(attributes);
|
||||
attributeAccessor = new MapAccessor<>(attributes);
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
|
||||
@@ -254,7 +254,7 @@ public class LocalParameterMap implements ParameterMap, Serializable {
|
||||
}
|
||||
|
||||
public AttributeMap<Object> asAttributeMap() {
|
||||
return new LocalAttributeMap<Object>(getMapInternal());
|
||||
return new LocalAttributeMap<>(getMapInternal());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -263,7 +263,7 @@ public class LocalParameterMap implements ParameterMap, Serializable {
|
||||
*/
|
||||
protected void initParameters(Map<String, Object> parameters) {
|
||||
this.parameters = parameters;
|
||||
parameterAccessor = new MapAccessor<String, Object>(this.parameters);
|
||||
parameterAccessor = new MapAccessor<>(this.parameters);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -289,7 +289,7 @@ public class LocalParameterMap implements ParameterMap, Serializable {
|
||||
@SuppressWarnings("unchecked")
|
||||
private <T> T[] convert(String[] parameters, Class<? extends T> targetElementType)
|
||||
throws ConversionExecutionException {
|
||||
List<T> list = new ArrayList<T>(parameters.length);
|
||||
List<T> list = new ArrayList<>(parameters.length);
|
||||
ConversionExecutor converter = conversionService.getConversionExecutor(String.class, targetElementType);
|
||||
for (String parameter : parameters) {
|
||||
list.add((T) converter.execute(parameter));
|
||||
@@ -313,11 +313,11 @@ public class LocalParameterMap implements ParameterMap, Serializable {
|
||||
|
||||
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
|
||||
in.defaultReadObject();
|
||||
parameterAccessor = new MapAccessor<String, Object>(parameters);
|
||||
parameterAccessor = new MapAccessor<>(parameters);
|
||||
conversionService = DEFAULT_CONVERSION_SERVICE;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return StylerUtils.style(parameters);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ public class FlowDefinitionRegistryImpl implements FlowDefinitionRegistry {
|
||||
private FlowDefinitionRegistry parent;
|
||||
|
||||
public FlowDefinitionRegistryImpl() {
|
||||
flowDefinitions = new TreeMap<String, FlowDefinitionHolder>();
|
||||
flowDefinitions = new TreeMap<>();
|
||||
}
|
||||
|
||||
// implementing FlowDefinitionLocator
|
||||
|
||||
@@ -43,7 +43,7 @@ public class ActionList implements Iterable<Action> {
|
||||
/**
|
||||
* The lists of actions.
|
||||
*/
|
||||
private List<Action> actions = new LinkedList<Action>();
|
||||
private List<Action> actions = new LinkedList<>();
|
||||
|
||||
/**
|
||||
* Add an action to this list.
|
||||
|
||||
@@ -113,7 +113,7 @@ public class EndState extends State {
|
||||
* execution request context into a newly created empty map.
|
||||
*/
|
||||
protected LocalAttributeMap<Object> createSessionOutput(RequestContext context) {
|
||||
LocalAttributeMap<Object> output = new LocalAttributeMap<Object>();
|
||||
LocalAttributeMap<Object> output = new LocalAttributeMap<>();
|
||||
if (outputMapper != null) {
|
||||
MappingResults results = outputMapper.map(context, output);
|
||||
if (results != null && results.hasErrorResults()) {
|
||||
@@ -127,4 +127,4 @@ public class EndState extends State {
|
||||
creator.append("finalResponseAction", finalResponseAction).append("outputMapper", outputMapper);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@ public class Flow extends AnnotatedObject implements FlowDefinition {
|
||||
/**
|
||||
* The set of state definitions for this flow.
|
||||
*/
|
||||
private Set<State> states = new LinkedHashSet<State>(9);
|
||||
private Set<State> states = new LinkedHashSet<>(9);
|
||||
|
||||
/**
|
||||
* The default start state for this flow.
|
||||
@@ -133,7 +133,7 @@ public class Flow extends AnnotatedObject implements FlowDefinition {
|
||||
/**
|
||||
* The set of flow variables created by this flow.
|
||||
*/
|
||||
private Map<String, FlowVariable> variables = new LinkedHashMap<String, FlowVariable>();
|
||||
private Map<String, FlowVariable> variables = new LinkedHashMap<>();
|
||||
|
||||
/**
|
||||
* The mapper to map flow input attributes.
|
||||
@@ -215,7 +215,7 @@ public class Flow extends AnnotatedObject implements FlowDefinition {
|
||||
}
|
||||
|
||||
public String[] getPossibleOutcomes() {
|
||||
List<String> possibleOutcomes = new ArrayList<String>();
|
||||
List<String> possibleOutcomes = new ArrayList<>();
|
||||
for (State state : states) {
|
||||
if (state instanceof EndState) {
|
||||
possibleOutcomes.add(state.getId());
|
||||
|
||||
@@ -37,7 +37,7 @@ public class FlowExecutionExceptionHandlerSet {
|
||||
/**
|
||||
* The set of exception handlers.
|
||||
*/
|
||||
private List<FlowExecutionExceptionHandler> exceptionHandlers = new LinkedList<FlowExecutionExceptionHandler>();
|
||||
private List<FlowExecutionExceptionHandler> exceptionHandlers = new LinkedList<>();
|
||||
|
||||
/**
|
||||
* Add a state exception handler to this set.
|
||||
|
||||
@@ -92,7 +92,7 @@ public class SubflowState extends TransitionableState {
|
||||
if (subflowAttributeMapper != null) {
|
||||
flowInput = subflowAttributeMapper.createSubflowInput(context);
|
||||
} else {
|
||||
flowInput = new LocalAttributeMap<Object>();
|
||||
flowInput = new LocalAttributeMap<>();
|
||||
}
|
||||
Flow subflow = (Flow) this.subflow.getValue(context);
|
||||
if (logger.isDebugEnabled()) {
|
||||
@@ -121,4 +121,4 @@ public class SubflowState extends TransitionableState {
|
||||
super.appendToString(creator);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ public class TransitionSet implements Iterable<Transition> {
|
||||
/**
|
||||
* The set of transitions.
|
||||
*/
|
||||
private List<Transition> transitions = new LinkedList<Transition>();
|
||||
private List<Transition> transitions = new LinkedList<>();
|
||||
|
||||
/**
|
||||
* Add a transition to this set.
|
||||
|
||||
@@ -53,7 +53,7 @@ public class ViewState extends TransitionableState {
|
||||
/**
|
||||
* The set of view variables created by this view state.
|
||||
*/
|
||||
private Map<String, ViewVariable> variables = new LinkedHashMap<String, ViewVariable>();
|
||||
private Map<String, ViewVariable> variables = new LinkedHashMap<>();
|
||||
|
||||
/**
|
||||
* Whether or not a redirect should occur before the view is rendered.
|
||||
|
||||
@@ -16,7 +16,7 @@ import org.springframework.util.Assert;
|
||||
*/
|
||||
public class BinderConfiguration {
|
||||
|
||||
private Set<Binding> bindings = new LinkedHashSet<Binding>();
|
||||
private Set<Binding> bindings = new LinkedHashSet<>();
|
||||
|
||||
/**
|
||||
* Adds a new binding to this binding configuration.
|
||||
|
||||
@@ -314,7 +314,7 @@ public class FlowModelFlowBuilder extends AbstractFlowBuilder {
|
||||
private Resource[] parseContextResources(List<BeanImportModel> beanImports) {
|
||||
if (beanImports != null && !beanImports.isEmpty()) {
|
||||
Resource flowResource = flowModelHolder.getFlowModelResource();
|
||||
List<Resource> resources = new ArrayList<Resource>(beanImports.size());
|
||||
List<Resource> resources = new ArrayList<>(beanImports.size());
|
||||
for (BeanImportModel beanImport : getFlowModel().getBeanImports()) {
|
||||
try {
|
||||
resources.add(flowResource.createRelative(beanImport.getResource()));
|
||||
@@ -669,7 +669,7 @@ public class FlowModelFlowBuilder extends AbstractFlowBuilder {
|
||||
|
||||
private ViewVariable[] parseViewVariables(List<VarModel> vars) {
|
||||
if (vars != null && !vars.isEmpty()) {
|
||||
List<ViewVariable> variables = new ArrayList<ViewVariable>(vars.size());
|
||||
List<ViewVariable> variables = new ArrayList<>(vars.size());
|
||||
for (VarModel varModel : vars) {
|
||||
variables.add(parseViewVariable(varModel));
|
||||
}
|
||||
@@ -688,7 +688,7 @@ public class FlowModelFlowBuilder extends AbstractFlowBuilder {
|
||||
|
||||
private Transition[] parseIfs(List<IfModel> ifModels) {
|
||||
if (ifModels != null && !ifModels.isEmpty()) {
|
||||
List<Transition> transitions = new ArrayList<Transition>(ifModels.size());
|
||||
List<Transition> transitions = new ArrayList<>(ifModels.size());
|
||||
for (IfModel ifModel : ifModels) {
|
||||
transitions.addAll(Arrays.asList(parseIf(ifModel)));
|
||||
}
|
||||
@@ -756,7 +756,7 @@ public class FlowModelFlowBuilder extends AbstractFlowBuilder {
|
||||
private FlowExecutionExceptionHandler[] parseTransitionExecutingExceptionHandlers(
|
||||
List<TransitionModel> transitionModels) {
|
||||
if (transitionModels != null && !transitionModels.isEmpty()) {
|
||||
List<FlowExecutionExceptionHandler> exceptionHandlers = new ArrayList<FlowExecutionExceptionHandler>(
|
||||
List<FlowExecutionExceptionHandler> exceptionHandlers = new ArrayList<>(
|
||||
transitionModels.size());
|
||||
for (TransitionModel model : transitionModels) {
|
||||
if (StringUtils.hasText(model.getOnException())) {
|
||||
@@ -785,7 +785,7 @@ public class FlowModelFlowBuilder extends AbstractFlowBuilder {
|
||||
private FlowExecutionExceptionHandler[] parseCustomExceptionHandlers(
|
||||
List<ExceptionHandlerModel> exceptionHandlerModels) {
|
||||
if (exceptionHandlerModels != null && !exceptionHandlerModels.isEmpty()) {
|
||||
List<FlowExecutionExceptionHandler> exceptionHandlers = new ArrayList<FlowExecutionExceptionHandler>(
|
||||
List<FlowExecutionExceptionHandler> exceptionHandlers = new ArrayList<>(
|
||||
exceptionHandlerModels.size());
|
||||
for (ExceptionHandlerModel exceptionHandlerModel : exceptionHandlerModels) {
|
||||
exceptionHandlers.add(parseCustomExceptionHandler(exceptionHandlerModel));
|
||||
@@ -803,7 +803,7 @@ public class FlowModelFlowBuilder extends AbstractFlowBuilder {
|
||||
|
||||
private Transition[] parseTransitions(List<TransitionModel> transitionModels) {
|
||||
if (transitionModels != null && !transitionModels.isEmpty()) {
|
||||
List<Transition> transitions = new ArrayList<Transition>(transitionModels.size());
|
||||
List<Transition> transitions = new ArrayList<>(transitionModels.size());
|
||||
if (transitionModels != null) {
|
||||
for (TransitionModel transition : transitionModels) {
|
||||
if (!StringUtils.hasText(transition.getOnException())) {
|
||||
@@ -846,7 +846,7 @@ public class FlowModelFlowBuilder extends AbstractFlowBuilder {
|
||||
|
||||
private Action[] parseActions(List<AbstractActionModel> actionModels) {
|
||||
if (actionModels != null && !actionModels.isEmpty()) {
|
||||
List<AnnotatedAction> actions = new ArrayList<AnnotatedAction>(actionModels.size());
|
||||
List<AnnotatedAction> actions = new ArrayList<>(actionModels.size());
|
||||
for (AbstractActionModel actionModel : actionModels) {
|
||||
Action action;
|
||||
if (actionModel instanceof EvaluateModel) {
|
||||
@@ -912,13 +912,13 @@ public class FlowModelFlowBuilder extends AbstractFlowBuilder {
|
||||
|
||||
private MutableAttributeMap<Object> parseMetaAttributes(List<AttributeModel> attributeModels) {
|
||||
if (attributeModels != null && !attributeModels.isEmpty()) {
|
||||
LocalAttributeMap<Object> attributes = new LocalAttributeMap<Object>();
|
||||
LocalAttributeMap<Object> attributes = new LocalAttributeMap<>();
|
||||
for (AttributeModel attributeModel : attributeModels) {
|
||||
parseAndPutMetaAttribute(attributeModel, attributes);
|
||||
}
|
||||
return attributes;
|
||||
} else {
|
||||
return new LocalAttributeMap<Object>();
|
||||
return new LocalAttributeMap<>();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -147,9 +147,9 @@ public class FlowExecutionImpl implements FlowExecution, Externalizable {
|
||||
status = FlowExecutionStatus.NOT_STARTED;
|
||||
listeners = new FlowExecutionListeners();
|
||||
attributes = CollectionUtils.EMPTY_ATTRIBUTE_MAP;
|
||||
flowSessions = new LinkedList<FlowSessionImpl>();
|
||||
conversationScope = new LocalAttributeMap<Object>();
|
||||
conversationScope.put(FLASH_SCOPE_ATTRIBUTE, new LocalAttributeMap<Object>());
|
||||
flowSessions = new LinkedList<>();
|
||||
conversationScope = new LocalAttributeMap<>();
|
||||
conversationScope.put(FLASH_SCOPE_ATTRIBUTE, new LocalAttributeMap<>());
|
||||
}
|
||||
|
||||
public String getCaption() {
|
||||
@@ -357,7 +357,7 @@ public class FlowExecutionImpl implements FlowExecution, Externalizable {
|
||||
status = FlowExecutionStatus.ACTIVE;
|
||||
}
|
||||
if (input == null) {
|
||||
input = new LocalAttributeMap<Object>();
|
||||
input = new LocalAttributeMap<>();
|
||||
}
|
||||
if (hasEmbeddedModeAttribute(input)) {
|
||||
session.setEmbeddedMode();
|
||||
|
||||
@@ -107,7 +107,7 @@ public class FlowExecutionImplFactory implements FlowExecutionFactory {
|
||||
}
|
||||
execution.setKey(flowExecutionKey);
|
||||
if (conversationScope == null) {
|
||||
conversationScope = new LocalAttributeMap<Object>();
|
||||
conversationScope = new LocalAttributeMap<>();
|
||||
}
|
||||
execution.setConversationScope(conversationScope);
|
||||
execution.setAttributes(executionAttributes);
|
||||
|
||||
@@ -61,7 +61,7 @@ class FlowSessionImpl implements FlowSession, Externalizable {
|
||||
/**
|
||||
* The session data model ("flow scope").
|
||||
*/
|
||||
private MutableAttributeMap<Object> scope = new LocalAttributeMap<Object>();
|
||||
private MutableAttributeMap<Object> scope = new LocalAttributeMap<>();
|
||||
|
||||
/**
|
||||
* The parent session of this session (may be <code>null</code> if this is a root session.)
|
||||
@@ -246,7 +246,7 @@ class FlowSessionImpl implements FlowSession, Externalizable {
|
||||
* Initialize the view scope data structure.
|
||||
*/
|
||||
private void initViewScope() {
|
||||
scope.put(VIEW_SCOPE_ATTRIBUTE, new LocalAttributeMap<Object>());
|
||||
scope.put(VIEW_SCOPE_ATTRIBUTE, new LocalAttributeMap<>());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -64,12 +64,12 @@ class RequestControlContextImpl implements RequestControlContext {
|
||||
/**
|
||||
* The request scope data map. Never null, initially empty.
|
||||
*/
|
||||
private LocalAttributeMap<Object> requestScope = new LocalAttributeMap<Object>();
|
||||
private LocalAttributeMap<Object> requestScope = new LocalAttributeMap<>();
|
||||
|
||||
/**
|
||||
* Holder for contextual properties describing the currently executing request; never null, initially empty.
|
||||
*/
|
||||
private LocalAttributeMap<Object> attributes = new LocalAttributeMap<Object>();
|
||||
private LocalAttributeMap<Object> attributes = new LocalAttributeMap<>();
|
||||
|
||||
/**
|
||||
* The current event being processed by this flow; initially null.
|
||||
|
||||
@@ -101,7 +101,7 @@ public abstract class AbstractModel implements Model {
|
||||
return child;
|
||||
}
|
||||
if (!addAtEnd) {
|
||||
parent = new LinkedList<T>(parent);
|
||||
parent = new LinkedList<>(parent);
|
||||
Collections.reverse(parent);
|
||||
}
|
||||
for (T parentModel : parent) {
|
||||
@@ -138,7 +138,7 @@ public abstract class AbstractModel implements Model {
|
||||
if (list == null) {
|
||||
return null;
|
||||
}
|
||||
LinkedList<T> copy = new LinkedList<T>();
|
||||
LinkedList<T> copy = new LinkedList<>();
|
||||
for (T model : list) {
|
||||
copy.add((T) model.createCopy());
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ public class XmlFlowModelBuilder implements FlowModelBuilder {
|
||||
|
||||
private FlowModel flowModel;
|
||||
|
||||
private final List<FlowModelHolder> parentHolders = new ArrayList<FlowModelHolder>(4);
|
||||
private final List<FlowModelHolder> parentHolders = new ArrayList<>(4);
|
||||
|
||||
/**
|
||||
* Create a new XML flow model builder that will parse the XML document at the specified resource location and use
|
||||
@@ -228,7 +228,7 @@ public class XmlFlowModelBuilder implements FlowModelBuilder {
|
||||
if (attributeElements.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
LinkedList<AttributeModel> attributes = new LinkedList<AttributeModel>();
|
||||
LinkedList<AttributeModel> attributes = new LinkedList<>();
|
||||
for (Element element2 : attributeElements) {
|
||||
attributes.add(parseAttribute(element2));
|
||||
}
|
||||
@@ -240,7 +240,7 @@ public class XmlFlowModelBuilder implements FlowModelBuilder {
|
||||
if (varElements.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
LinkedList<VarModel> vars = new LinkedList<VarModel>();
|
||||
LinkedList<VarModel> vars = new LinkedList<>();
|
||||
for (Element element2 : varElements) {
|
||||
vars.add(parseVar(element2));
|
||||
}
|
||||
@@ -252,7 +252,7 @@ public class XmlFlowModelBuilder implements FlowModelBuilder {
|
||||
if (inputElements.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
LinkedList<InputModel> inputs = new LinkedList<InputModel>();
|
||||
LinkedList<InputModel> inputs = new LinkedList<>();
|
||||
for (Element element2 : inputElements) {
|
||||
inputs.add(parseInput(element2));
|
||||
}
|
||||
@@ -264,7 +264,7 @@ public class XmlFlowModelBuilder implements FlowModelBuilder {
|
||||
if (outputElements.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
LinkedList<OutputModel> outputs = new LinkedList<OutputModel>();
|
||||
LinkedList<OutputModel> outputs = new LinkedList<>();
|
||||
for (Element element2 : outputElements) {
|
||||
outputs.add(parseOutput(element2));
|
||||
}
|
||||
@@ -277,7 +277,7 @@ public class XmlFlowModelBuilder implements FlowModelBuilder {
|
||||
if (actionElements.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
LinkedList<AbstractActionModel> actions = new LinkedList<AbstractActionModel>();
|
||||
LinkedList<AbstractActionModel> actions = new LinkedList<>();
|
||||
for (Element element2 : actionElements) {
|
||||
actions.add(parseAction(element2));
|
||||
}
|
||||
@@ -290,7 +290,7 @@ public class XmlFlowModelBuilder implements FlowModelBuilder {
|
||||
if (stateElements.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
LinkedList<AbstractStateModel> states = new LinkedList<AbstractStateModel>();
|
||||
LinkedList<AbstractStateModel> states = new LinkedList<>();
|
||||
for (Element element2 : stateElements) {
|
||||
states.add(parseState(element2));
|
||||
}
|
||||
@@ -302,7 +302,7 @@ public class XmlFlowModelBuilder implements FlowModelBuilder {
|
||||
if (transitionElements.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
LinkedList<TransitionModel> transitions = new LinkedList<TransitionModel>();
|
||||
LinkedList<TransitionModel> transitions = new LinkedList<>();
|
||||
for (Element element2 : transitionElements) {
|
||||
transitions.add(parseTransition(element2));
|
||||
}
|
||||
@@ -314,7 +314,7 @@ public class XmlFlowModelBuilder implements FlowModelBuilder {
|
||||
if (exceptionHandlerElements.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
LinkedList<ExceptionHandlerModel> exceptionHandlers = new LinkedList<ExceptionHandlerModel>();
|
||||
LinkedList<ExceptionHandlerModel> exceptionHandlers = new LinkedList<>();
|
||||
for (Element element2 : exceptionHandlerElements) {
|
||||
exceptionHandlers.add(parseExceptionHandler(element2));
|
||||
}
|
||||
@@ -326,7 +326,7 @@ public class XmlFlowModelBuilder implements FlowModelBuilder {
|
||||
if (importElements.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
LinkedList<BeanImportModel> beanImports = new LinkedList<BeanImportModel>();
|
||||
LinkedList<BeanImportModel> beanImports = new LinkedList<>();
|
||||
for (Element element2 : importElements) {
|
||||
beanImports.add(parseBeanImport(element2));
|
||||
}
|
||||
@@ -338,7 +338,7 @@ public class XmlFlowModelBuilder implements FlowModelBuilder {
|
||||
if (ifElements.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
LinkedList<IfModel> ifs = new LinkedList<IfModel>();
|
||||
LinkedList<IfModel> ifs = new LinkedList<>();
|
||||
for (Element element2 : ifElements) {
|
||||
ifs.add(parseIf(element2));
|
||||
}
|
||||
@@ -511,7 +511,7 @@ public class XmlFlowModelBuilder implements FlowModelBuilder {
|
||||
if (bindingElements.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
LinkedList<BindingModel> bindings = new LinkedList<BindingModel>();
|
||||
LinkedList<BindingModel> bindings = new LinkedList<>();
|
||||
for (Element element2 : bindingElements) {
|
||||
bindings.add(parseBinding(element2));
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ public class FlowModelRegistryImpl implements FlowModelRegistry, FlowModelHolder
|
||||
private FlowModelRegistry parent;
|
||||
|
||||
public FlowModelRegistryImpl() {
|
||||
flowModels = new TreeMap<String, FlowModelHolder>();
|
||||
flowModels = new TreeMap<>();
|
||||
}
|
||||
|
||||
// implementing FlowModelLocator
|
||||
|
||||
@@ -51,7 +51,7 @@ public final class GenericSubflowAttributeMapper implements SubflowAttributeMapp
|
||||
|
||||
public MutableAttributeMap<Object> createSubflowInput(RequestContext context) {
|
||||
if (inputMapper != null) {
|
||||
LocalAttributeMap<Object> input = new LocalAttributeMap<Object>();
|
||||
LocalAttributeMap<Object> input = new LocalAttributeMap<>();
|
||||
MappingResults results = inputMapper.map(context, input);
|
||||
if (results != null && results.hasErrorResults()) {
|
||||
throw new FlowInputMappingException(context.getActiveFlow().getId(), context.getCurrentState().getId(),
|
||||
@@ -59,7 +59,7 @@ public final class GenericSubflowAttributeMapper implements SubflowAttributeMapp
|
||||
}
|
||||
return input;
|
||||
} else {
|
||||
return new LocalAttributeMap<Object>();
|
||||
return new LocalAttributeMap<>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,4 +77,4 @@ public final class GenericSubflowAttributeMapper implements SubflowAttributeMapp
|
||||
return new ToStringCreator(this).append("inputMapper", inputMapper).append("outputMapper", outputMapper)
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ public class TransitionCriteriaChain implements TransitionCriteria {
|
||||
/**
|
||||
* The ordered chain of TransitionCriteria objects.
|
||||
*/
|
||||
private List<TransitionCriteria> criteriaChain = new LinkedList<TransitionCriteria>();
|
||||
private List<TransitionCriteria> criteriaChain = new LinkedList<>();
|
||||
|
||||
/**
|
||||
* Creates an initially empty transition criteria chain.
|
||||
|
||||
@@ -30,7 +30,7 @@ import org.springframework.core.NamedThreadLocal;
|
||||
*/
|
||||
public class RequestContextHolder {
|
||||
|
||||
private static final ThreadLocal<RequestContext> requestContextHolder = new NamedThreadLocal<RequestContext>(
|
||||
private static final ThreadLocal<RequestContext> requestContextHolder = new NamedThreadLocal<>(
|
||||
"Flow RequestContext");
|
||||
|
||||
/**
|
||||
|
||||
@@ -41,7 +41,7 @@ class ConditionalFlowExecutionListenerHolder {
|
||||
/**
|
||||
* The listener criteria set.
|
||||
*/
|
||||
private Set<FlowExecutionListenerCriteria> criteriaSet = new LinkedHashSet<FlowExecutionListenerCriteria>(3);
|
||||
private Set<FlowExecutionListenerCriteria> criteriaSet = new LinkedHashSet<>(3);
|
||||
|
||||
/**
|
||||
* Create a new conditional flow execution listener holder.
|
||||
|
||||
@@ -43,7 +43,7 @@ public class ConditionalFlowExecutionListenerLoader implements FlowExecutionList
|
||||
* The list of flow execution listeners containing {@link ConditionalFlowExecutionListenerHolder} objects. The list
|
||||
* determines the conditions in which a single flow execution listener applies.
|
||||
*/
|
||||
private List<ConditionalFlowExecutionListenerHolder> listeners = new LinkedList<ConditionalFlowExecutionListenerHolder>();
|
||||
private List<ConditionalFlowExecutionListenerHolder> listeners = new LinkedList<>();
|
||||
|
||||
/**
|
||||
* Add a listener that will listen to executions to flows matching the specified criteria.
|
||||
@@ -75,7 +75,7 @@ public class ConditionalFlowExecutionListenerLoader implements FlowExecutionList
|
||||
*/
|
||||
public FlowExecutionListener[] getListeners(FlowDefinition flowDefinition) {
|
||||
Assert.notNull(flowDefinition, "The Flow to load listeners for cannot be null");
|
||||
List<FlowExecutionListener> listenersToAttach = new LinkedList<FlowExecutionListener>();
|
||||
List<FlowExecutionListener> listenersToAttach = new LinkedList<>();
|
||||
for (ConditionalFlowExecutionListenerHolder listenerHolder : listeners) {
|
||||
if (listenerHolder.listenerAppliesTo(flowDefinition)) {
|
||||
listenersToAttach.add(listenerHolder.getListener());
|
||||
|
||||
@@ -34,13 +34,13 @@ class SimpleFlowExecutionSnapshotGroup implements FlowExecutionSnapshotGroup, Se
|
||||
/**
|
||||
* The snapshot map; the key is a snapshot id, and the value is a {@link FlowExecutionSnapshot} object.
|
||||
*/
|
||||
private Map<Serializable, FlowExecutionSnapshot> snapshots = new HashMap<Serializable, FlowExecutionSnapshot>();
|
||||
private Map<Serializable, FlowExecutionSnapshot> snapshots = new HashMap<>();
|
||||
|
||||
/**
|
||||
* An ordered list of snapshot ids. Each snapshot id represents an pointer to a {@link FlowExecutionSnapshot} in the
|
||||
* map. The first element is the oldest snapshot and the last is the youngest.
|
||||
*/
|
||||
private LinkedList<Serializable> snapshotIds = new LinkedList<Serializable>();
|
||||
private LinkedList<Serializable> snapshotIds = new LinkedList<>();
|
||||
|
||||
/**
|
||||
* The maximum number of snapshots allowed in this group. -1 indicates no max limit.
|
||||
@@ -127,4 +127,4 @@ class SimpleFlowExecutionSnapshotGroup implements FlowExecutionSnapshotGroup, Se
|
||||
snapshots.remove(snapshotIds.removeFirst());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@ public class ImplicitFlowVariableELResolver extends ELResolver {
|
||||
}
|
||||
|
||||
private static final class ImplicitVariables {
|
||||
private static final Map<String, PropertyResolver> vars = new HashMap<String, PropertyResolver>();
|
||||
private static final Map<String, PropertyResolver> vars = new HashMap<>();
|
||||
|
||||
private static final PropertyResolver requestContextResolver = new PropertyResolver() {
|
||||
protected Object doResolve(ELContext elContext, RequestContext requestContext, Object property) {
|
||||
|
||||
@@ -52,7 +52,7 @@ public class WebFlowELExpressionParser extends ELExpressionParser {
|
||||
private static class RequestContextELContextFactory implements ELContextFactory {
|
||||
public ELContext getELContext(Object target) {
|
||||
RequestContext context = (RequestContext) target;
|
||||
List<ELResolver> customResolvers = new ArrayList<ELResolver>();
|
||||
List<ELResolver> customResolvers = new ArrayList<>();
|
||||
customResolvers.add(new RequestContextELResolver(context));
|
||||
customResolvers.add(new FlowResourceELResolver(context));
|
||||
customResolvers.add(new ImplicitFlowVariableELResolver(context));
|
||||
|
||||
@@ -47,7 +47,7 @@ import org.springframework.webflow.execution.RequestContextHolder;
|
||||
*/
|
||||
public class FlowVariablePropertyAccessor implements PropertyAccessor {
|
||||
|
||||
private static Map<String, FlowVariableAccessor> variables = new HashMap<String, FlowVariableAccessor>();
|
||||
private static Map<String, FlowVariableAccessor> variables = new HashMap<>();
|
||||
|
||||
static {
|
||||
variables.put("currentUser", new FlowVariableAccessor() {
|
||||
|
||||
@@ -44,7 +44,7 @@ public class FlowController implements Controller, ApplicationContextAware, Init
|
||||
|
||||
private FlowHandlerAdapter flowHandlerAdapter;
|
||||
|
||||
private Map<String, FlowHandler> flowHandlers = new HashMap<String, FlowHandler>();
|
||||
private Map<String, FlowHandler> flowHandlers = new HashMap<>();
|
||||
|
||||
private boolean customFlowHandlerAdapterSet;
|
||||
|
||||
|
||||
@@ -308,7 +308,7 @@ public class FlowHandlerAdapter extends WebContentGenerator implements HandlerAd
|
||||
if (parameterMap.size() == 0) {
|
||||
return null;
|
||||
}
|
||||
LocalAttributeMap<Object> inputMap = new LocalAttributeMap<Object>(parameterMap.size(), 1);
|
||||
LocalAttributeMap<Object> inputMap = new LocalAttributeMap<>(parameterMap.size(), 1);
|
||||
for (Map.Entry<String, String[]> entry : parameterMap.entrySet()) {
|
||||
String[] values = entry.getValue();
|
||||
inputMap.put(entry.getKey(), values.length == 1 ? values[0] : values);
|
||||
|
||||
@@ -188,7 +188,7 @@ public abstract class AbstractMvcView implements View {
|
||||
}
|
||||
|
||||
public void render() throws IOException {
|
||||
Map<String, Object> model = new HashMap<String, Object>();
|
||||
Map<String, Object> model = new HashMap<>();
|
||||
model.putAll(flowScopes());
|
||||
exposeBindingModel(model);
|
||||
model.put("flowRequestContext", requestContext);
|
||||
@@ -530,7 +530,7 @@ public abstract class AbstractMvcView implements View {
|
||||
* Check if the remaining nested properties are valid Java identifiers.
|
||||
*/
|
||||
private boolean checkModelProperty(String expression, Object model) {
|
||||
List<String> propertyNames = new ArrayList<String>();
|
||||
List<String> propertyNames = new ArrayList<>();
|
||||
while (true) {
|
||||
int index = PropertyAccessorUtils.getFirstNestedPropertySeparatorIndex(expression);
|
||||
String nestedProperty = index != -1 ? expression.substring(0, index) : expression;
|
||||
|
||||
@@ -98,7 +98,7 @@ public class AjaxTiles3View extends TilesView {
|
||||
|
||||
Definition compositeDefinition = container.getDefinitionsFactory().getDefinition(getUrl(), tilesRequest);
|
||||
|
||||
Map<String, Attribute> flattenedAttributeMap = new HashMap<String, Attribute>();
|
||||
Map<String, Attribute> flattenedAttributeMap = new HashMap<>();
|
||||
flattenAttributeMap(container, tilesRequest, flattenedAttributeMap, compositeDefinition);
|
||||
addRuntimeAttributes(container, tilesRequest, flattenedAttributeMap);
|
||||
|
||||
@@ -143,7 +143,7 @@ public class AjaxTiles3View extends TilesView {
|
||||
protected void flattenAttributeMap(BasicTilesContainer container, Request tilesRequest,
|
||||
Map<String, Attribute> resultMap, Definition definition) {
|
||||
|
||||
Set<String> attributeNames = new HashSet<String>();
|
||||
Set<String> attributeNames = new HashSet<>();
|
||||
if (definition.getLocalAttributeNames() != null) {
|
||||
attributeNames.addAll(definition.getLocalAttributeNames());
|
||||
}
|
||||
@@ -179,7 +179,7 @@ public class AjaxTiles3View extends TilesView {
|
||||
Request tilesRequest, Map<String, Attribute> resultMap) {
|
||||
|
||||
AttributeContext attributeContext = container.getAttributeContext(tilesRequest);
|
||||
Set<String> attributeNames = new HashSet<String>();
|
||||
Set<String> attributeNames = new HashSet<>();
|
||||
if (attributeContext.getLocalAttributeNames() != null) {
|
||||
attributeNames.addAll(attributeContext.getLocalAttributeNames());
|
||||
}
|
||||
|
||||
@@ -288,7 +288,7 @@ public class BindingModel extends AbstractErrors implements BindingResult {
|
||||
if (messages == null || messages.length == 0) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
ArrayList<T> errors = new ArrayList<T>(messages.length);
|
||||
ArrayList<T> errors = new ArrayList<>(messages.length);
|
||||
for (Message message : messages) {
|
||||
T error = errorFactory.get(objectName, message);
|
||||
if (error != null) {
|
||||
|
||||
@@ -119,7 +119,7 @@ public class SecurityFlowExecutionListener extends FlowExecutionListenerAdapter
|
||||
}
|
||||
|
||||
private AbstractAccessDecisionManager createManagerWithSpringSecurity3(SecurityRule rule) {
|
||||
List<AccessDecisionVoter> voters = new ArrayList<AccessDecisionVoter>();
|
||||
List<AccessDecisionVoter> voters = new ArrayList<>();
|
||||
voters.add(new RoleVoter());
|
||||
Class<?> managerType;
|
||||
if (rule.getComparisonType() == SecurityRule.COMPARISON_ANY) {
|
||||
@@ -146,7 +146,7 @@ public class SecurityFlowExecutionListener extends FlowExecutionListenerAdapter
|
||||
* @return list of ConfigAttributes for Spring Security
|
||||
*/
|
||||
protected Collection<ConfigAttribute> getConfigAttributes(SecurityRule rule) {
|
||||
List<ConfigAttribute> configAttributes = new ArrayList<ConfigAttribute>();
|
||||
List<ConfigAttribute> configAttributes = new ArrayList<>();
|
||||
for (String attribute : rule.getAttributes()) {
|
||||
configAttributes.add(new SecurityConfig(attribute));
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ public class SecurityRule {
|
||||
* @return comma parsed Collection
|
||||
*/
|
||||
public static Collection<String> commaDelimitedListToSecurityAttributes(String attributes) {
|
||||
Collection<String> attrs = new HashSet<String>();
|
||||
Collection<String> attrs = new HashSet<>();
|
||||
for (String attribute : attributes.split(",")) {
|
||||
attribute = attribute.trim();
|
||||
if (!"".equals(attribute)) {
|
||||
|
||||
@@ -42,15 +42,15 @@ public class MockExternalContext implements ExternalContext {
|
||||
|
||||
private ParameterMap requestParameterMap = new MockParameterMap();
|
||||
|
||||
private MutableAttributeMap<Object> requestMap = new LocalAttributeMap<Object>();
|
||||
private MutableAttributeMap<Object> requestMap = new LocalAttributeMap<>();
|
||||
|
||||
private SharedAttributeMap<Object> sessionMap = new LocalSharedAttributeMap<Object>(
|
||||
new SharedMapDecorator<String, Object>(new HashMap<String, Object>()));
|
||||
private SharedAttributeMap<Object> sessionMap = new LocalSharedAttributeMap<>(
|
||||
new SharedMapDecorator<>(new HashMap<>()));
|
||||
|
||||
private SharedAttributeMap<Object> globalSessionMap = sessionMap;
|
||||
|
||||
private SharedAttributeMap<Object> applicationMap = new LocalSharedAttributeMap<Object>(
|
||||
new SharedMapDecorator<String, Object>(new HashMap<String, Object>()));
|
||||
private SharedAttributeMap<Object> applicationMap = new LocalSharedAttributeMap<>(
|
||||
new SharedMapDecorator<>(new HashMap<>()));
|
||||
|
||||
private Object nativeContext = new Object();
|
||||
|
||||
@@ -183,7 +183,7 @@ public class MockExternalContext implements ExternalContext {
|
||||
|
||||
public void requestFlowDefinitionRedirect(String flowId, MutableAttributeMap<?> input) throws IllegalStateException {
|
||||
flowDefinitionRedirectFlowId = flowId;
|
||||
flowDefinitionRedirectFlowInput = new LocalAttributeMap<Object>();
|
||||
flowDefinitionRedirectFlowInput = new LocalAttributeMap<>();
|
||||
if (input != null) {
|
||||
flowDefinitionRedirectFlowInput.putAll(input);
|
||||
}
|
||||
|
||||
@@ -42,11 +42,11 @@ public class MockFlowExecutionContext implements FlowExecutionContext {
|
||||
|
||||
private FlowSession activeSession;
|
||||
|
||||
private MutableAttributeMap<Object> flashScope = new LocalAttributeMap<Object>();
|
||||
private MutableAttributeMap<Object> flashScope = new LocalAttributeMap<>();
|
||||
|
||||
private MutableAttributeMap<Object> conversationScope = new LocalAttributeMap<Object>();
|
||||
private MutableAttributeMap<Object> conversationScope = new LocalAttributeMap<>();
|
||||
|
||||
private MutableAttributeMap<Object> attributes = new LocalAttributeMap<Object>();
|
||||
private MutableAttributeMap<Object> attributes = new LocalAttributeMap<>();
|
||||
|
||||
private FlowExecutionOutcome outcome;
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user