diff --git a/spring-binding/src/main/java/org/springframework/binding/collection/AbstractCachingMapDecorator.java b/spring-binding/src/main/java/org/springframework/binding/collection/AbstractCachingMapDecorator.java index c03f2b22..5830d8be 100644 --- a/spring-binding/src/main/java/org/springframework/binding/collection/AbstractCachingMapDecorator.java +++ b/spring-binding/src/main/java/org/springframework/binding/collection/AbstractCachingMapDecorator.java @@ -55,7 +55,7 @@ public abstract class AbstractCachingMapDecorator implements Map, Se * @param weak whether to use weak references for keys and values */ public AbstractCachingMapDecorator(boolean weak) { - Map internalMap = (weak ? new WeakHashMap() : new HashMap()); + Map 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 implements Map, Se * @param size the initial cache size */ public AbstractCachingMapDecorator(boolean weak, int size) { - Map internalMap = weak ? new WeakHashMap (size) : new HashMap(size); + Map internalMap = weak ? new WeakHashMap (size) : new HashMap<>(size); this.targetMap = Collections.synchronizedMap(internalMap); this.synchronize = true; this.weak = weak; @@ -161,11 +161,11 @@ public abstract class AbstractCachingMapDecorator implements Map, Se public Set keySet() { if (this.synchronize) { synchronized (this.targetMap) { - return new LinkedHashSet(this.targetMap.keySet()); + return new LinkedHashSet<>(this.targetMap.keySet()); } } else { - return new LinkedHashSet(this.targetMap.keySet()); + return new LinkedHashSet<>(this.targetMap.keySet()); } } @@ -182,7 +182,7 @@ public abstract class AbstractCachingMapDecorator implements Map, Se @SuppressWarnings("unchecked") private Collection valuesCopy() { - LinkedList values = new LinkedList(); + LinkedList values = new LinkedList<>(); for (Iterator it = this.targetMap.values().iterator(); it.hasNext();) { Object value = it.next(); if (value instanceof Reference) { @@ -210,7 +210,7 @@ public abstract class AbstractCachingMapDecorator implements Map, Se @SuppressWarnings("unchecked") private Set> entryCopy() { - Map entries = new LinkedHashMap(); + Map entries = new LinkedHashMap<>(); for (Iterator> it = this.targetMap.entrySet().iterator(); it.hasNext();) { Entry entry = it.next(); Object value = entry.getValue(); @@ -238,7 +238,7 @@ public abstract class AbstractCachingMapDecorator implements Map, Se newValue = NULL_VALUE; } else if (useWeakValue(key, value)) { - newValue = new WeakReference(newValue); + newValue = new WeakReference<>(newValue); } return unwrapReturnValue(this.targetMap.put(key, newValue)); } diff --git a/spring-binding/src/main/java/org/springframework/binding/convert/service/GenericConversionService.java b/spring-binding/src/main/java/org/springframework/binding/convert/service/GenericConversionService.java index 36a6f3a7..6f1316fa 100644 --- a/spring-binding/src/main/java/org/springframework/binding/convert/service/GenericConversionService.java +++ b/spring-binding/src/main/java/org/springframework/binding/convert/service/GenericConversionService.java @@ -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 customConverters = new HashMap(); + private final Map customConverters = new HashMap<>(); /** * Indexes classes by well-known aliases. diff --git a/spring-binding/src/main/java/org/springframework/binding/expression/el/ELExpressionParser.java b/spring-binding/src/main/java/org/springframework/binding/expression/el/ELExpressionParser.java index 0746415c..0e01cfba 100644 --- a/spring-binding/src/main/java/org/springframework/binding/expression/el/ELExpressionParser.java +++ b/spring-binding/src/main/java/org/springframework/binding/expression/el/ELExpressionParser.java @@ -190,7 +190,7 @@ public class ELExpressionParser implements ExpressionParser { } private static class VariableMapperImpl extends VariableMapper { - private Map variables = new HashMap(); + private Map variables = new HashMap<>(); public ValueExpression resolveVariable(String name) { return variables.get(name); diff --git a/spring-binding/src/main/java/org/springframework/binding/expression/spel/SpringELExpression.java b/spring-binding/src/main/java/org/springframework/binding/expression/spel/SpringELExpression.java index 4db662e7..d8310522 100644 --- a/spring-binding/src/main/java/org/springframework/binding/expression/spel/SpringELExpression.java +++ b/spring-binding/src/main/java/org/springframework/binding/expression/spel/SpringELExpression.java @@ -155,7 +155,7 @@ public class SpringELExpression implements Expression { if (expressionVariables == null) { return Collections.emptyMap(); } - Map variableValues = new HashMap(expressionVariables.size()); + Map variableValues = new HashMap<>(expressionVariables.size()); for (Map.Entry var : expressionVariables.entrySet()) { variableValues.put(var.getKey(), var.getValue().getValue(rootObject)); } diff --git a/spring-binding/src/main/java/org/springframework/binding/expression/spel/SpringELExpressionParser.java b/spring-binding/src/main/java/org/springframework/binding/expression/spel/SpringELExpressionParser.java index 89d47211..caca9e55 100644 --- a/spring-binding/src/main/java/org/springframework/binding/expression/spel/SpringELExpressionParser.java +++ b/spring-binding/src/main/java/org/springframework/binding/expression/spel/SpringELExpressionParser.java @@ -47,7 +47,7 @@ public class SpringELExpressionParser implements ExpressionParser { private final ConversionService conversionService; - private final List propertyAccessors = new ArrayList(); + private final List 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 result = new HashMap(expressionVars.length); + Map result = new HashMap<>(expressionVars.length); for (ExpressionVariable var : expressionVars) { result.put(var.getName(), parseExpression(var.getValueExpression(), var.getParserContext())); } diff --git a/spring-binding/src/main/java/org/springframework/binding/expression/support/AbstractExpressionParser.java b/spring-binding/src/main/java/org/springframework/binding/expression/support/AbstractExpressionParser.java index 3c06e6bb..097e1f34 100644 --- a/spring-binding/src/main/java/org/springframework/binding/expression/support/AbstractExpressionParser.java +++ b/spring-binding/src/main/java/org/springframework/binding/expression/support/AbstractExpressionParser.java @@ -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 expressions = new LinkedList(); + List 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 variableExpressions = new HashMap(variables.length, 1); + Map variableExpressions = new HashMap<>(variables.length, 1); for (ExpressionVariable var : variables) { variableExpressions.put(var.getName(), parseExpression(var.getValueExpression(), var.getParserContext())); } diff --git a/spring-binding/src/main/java/org/springframework/binding/expression/support/FluentParserContext.java b/spring-binding/src/main/java/org/springframework/binding/expression/support/FluentParserContext.java index 4a9f54bd..27ab5590 100644 --- a/spring-binding/src/main/java/org/springframework/binding/expression/support/FluentParserContext.java +++ b/spring-binding/src/main/java/org/springframework/binding/expression/support/FluentParserContext.java @@ -114,6 +114,6 @@ public class FluentParserContext implements ParserContext { } private void init() { - expressionVariables = new ArrayList(); + expressionVariables = new ArrayList<>(); } } diff --git a/spring-binding/src/main/java/org/springframework/binding/mapping/impl/DefaultMapper.java b/spring-binding/src/main/java/org/springframework/binding/mapping/impl/DefaultMapper.java index 4a2a857c..251c4f68 100644 --- a/spring-binding/src/main/java/org/springframework/binding/mapping/impl/DefaultMapper.java +++ b/spring-binding/src/main/java/org/springframework/binding/mapping/impl/DefaultMapper.java @@ -35,7 +35,7 @@ public class DefaultMapper implements Mapper { private static final Log logger = LogFactory.getLog(DefaultMapper.class); - private List mappings = new ArrayList(); + private List mappings = new ArrayList<>(); /** * Add a mapping to this mapper. diff --git a/spring-binding/src/main/java/org/springframework/binding/mapping/impl/DefaultMappingContext.java b/spring-binding/src/main/java/org/springframework/binding/mapping/impl/DefaultMappingContext.java index cf655c2a..5df32d95 100644 --- a/spring-binding/src/main/java/org/springframework/binding/mapping/impl/DefaultMappingContext.java +++ b/spring-binding/src/main/java/org/springframework/binding/mapping/impl/DefaultMappingContext.java @@ -50,7 +50,7 @@ public class DefaultMappingContext { public DefaultMappingContext(Object source, Object target) { this.source = source; this.target = target; - this.mappingResults = new ArrayList(); + this.mappingResults = new ArrayList<>(); } /** diff --git a/spring-binding/src/main/java/org/springframework/binding/mapping/impl/DefaultMappingResults.java b/spring-binding/src/main/java/org/springframework/binding/mapping/impl/DefaultMappingResults.java index e61b1b40..4377c3ab 100644 --- a/spring-binding/src/main/java/org/springframework/binding/mapping/impl/DefaultMappingResults.java +++ b/spring-binding/src/main/java/org/springframework/binding/mapping/impl/DefaultMappingResults.java @@ -69,7 +69,7 @@ public class DefaultMappingResults implements MappingResults { } public List getErrorResults() { - List errorResults = new ArrayList(); + List errorResults = new ArrayList<>(); for (MappingResult result : mappingResults) { if (result.isError()) { errorResults.add(result); @@ -79,7 +79,7 @@ public class DefaultMappingResults implements MappingResults { } public List getResults(MappingResultsCriteria criteria) { - List results = new ArrayList(); + List results = new ArrayList<>(); for (MappingResult result : mappingResults) { if (criteria.test(result)) { results.add(result); diff --git a/spring-binding/src/main/java/org/springframework/binding/message/DefaultMessageContext.java b/spring-binding/src/main/java/org/springframework/binding/message/DefaultMessageContext.java index c2f745b5..8c12ebd2 100644 --- a/spring-binding/src/main/java/org/springframework/binding/message/DefaultMessageContext.java +++ b/spring-binding/src/main/java/org/springframework/binding/message/DefaultMessageContext.java @@ -48,7 +48,7 @@ public class DefaultMessageContext implements StateManageableMessageContext { new LinkedHashMap>()) { protected List create(Object source) { - return new ArrayList(); + return new ArrayList<>(); } }; @@ -75,7 +75,7 @@ public class DefaultMessageContext implements StateManageableMessageContext { // implementing message context public Message[] getAllMessages() { - List messages = new ArrayList(); + List messages = new ArrayList<>(); for (List list : sourceMessages.values()) { messages.addAll(list); } @@ -88,7 +88,7 @@ public class DefaultMessageContext implements StateManageableMessageContext { } public Message[] getMessagesByCriteria(MessageCriteria criteria) { - List messages = new ArrayList(); + List messages = new ArrayList<>(); for (List sourceMessages : this.sourceMessages.values()) { for (Message message : sourceMessages) { if (criteria.test(message)) { diff --git a/spring-binding/src/main/java/org/springframework/binding/message/MessageBuilder.java b/spring-binding/src/main/java/org/springframework/binding/message/MessageBuilder.java index f05e3130..fe1ea33c 100644 --- a/spring-binding/src/main/java/org/springframework/binding/message/MessageBuilder.java +++ b/spring-binding/src/main/java/org/springframework/binding/message/MessageBuilder.java @@ -44,11 +44,11 @@ public class MessageBuilder { private Object source; - private Set codes = new LinkedHashSet(); + private Set codes = new LinkedHashSet<>(); private Severity severity; - private List args = new ArrayList(); + private List args = new ArrayList<>(); private String defaultText; diff --git a/spring-binding/src/main/java/org/springframework/binding/message/MessageContextErrors.java b/spring-binding/src/main/java/org/springframework/binding/message/MessageContextErrors.java index b28922d6..ab30320c 100644 --- a/spring-binding/src/main/java/org/springframework/binding/message/MessageContextErrors.java +++ b/spring-binding/src/main/java/org/springframework/binding/message/MessageContextErrors.java @@ -119,7 +119,7 @@ public class MessageContextErrors extends AbstractErrors { if (messages.length == 0) { return Collections.emptyList(); } - List errors = new ArrayList(messages.length); + List 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 errors = new ArrayList(messages.length); + List errors = new ArrayList<>(messages.length); for (Message message : messages) { errors.add(new FieldError(objectName, (String) message.getSource(), message.getText())); } diff --git a/spring-binding/src/main/java/org/springframework/binding/method/Parameters.java b/spring-binding/src/main/java/org/springframework/binding/method/Parameters.java index a3cb1019..5ed12bc1 100644 --- a/spring-binding/src/main/java/org/springframework/binding/method/Parameters.java +++ b/spring-binding/src/main/java/org/springframework/binding/method/Parameters.java @@ -49,7 +49,7 @@ public class Parameters { * @param size the size */ public Parameters(int size) { - this.parameters = new ArrayList(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(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(parameters.length); + this.parameters = new ArrayList<>(parameters.length); addAll(parameters); } diff --git a/spring-binding/src/test/java/org/springframework/binding/collection/MapAccessorTests.java b/spring-binding/src/test/java/org/springframework/binding/collection/MapAccessorTests.java index 827ac801..dd3a2629 100644 --- a/spring-binding/src/test/java/org/springframework/binding/collection/MapAccessorTests.java +++ b/spring-binding/src/test/java/org/springframework/binding/collection/MapAccessorTests.java @@ -9,11 +9,11 @@ public class MapAccessorTests extends TestCase { private MapAccessor accessor; protected void setUp() throws Exception { - Map map = new HashMap(); + Map map = new HashMap<>(); map.put("string", "hello"); map.put("integer", 9); map.put("null", null); - this.accessor = new MapAccessor(map); + this.accessor = new MapAccessor<>(map); } public void testAccessNullAttribute() { diff --git a/spring-binding/src/test/java/org/springframework/binding/collection/SharedMapDecoratorTests.java b/spring-binding/src/test/java/org/springframework/binding/collection/SharedMapDecoratorTests.java index 83dde7ec..9c24cbfa 100644 --- a/spring-binding/src/test/java/org/springframework/binding/collection/SharedMapDecoratorTests.java +++ b/spring-binding/src/test/java/org/springframework/binding/collection/SharedMapDecoratorTests.java @@ -27,8 +27,8 @@ import junit.framework.TestCase; */ public class SharedMapDecoratorTests extends TestCase { - private SharedMapDecorator map = new SharedMapDecorator( - new HashMap()); + private SharedMapDecorator 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 all = new HashMap(); + Map all = new HashMap<>(); all.put("foo", "bar"); all.put("bar", "baz"); map.putAll(all); diff --git a/spring-binding/src/test/java/org/springframework/binding/collection/StringKeyedMapAdapterTests.java b/spring-binding/src/test/java/org/springframework/binding/collection/StringKeyedMapAdapterTests.java index d739289d..fa5edeca 100644 --- a/spring-binding/src/test/java/org/springframework/binding/collection/StringKeyedMapAdapterTests.java +++ b/spring-binding/src/test/java/org/springframework/binding/collection/StringKeyedMapAdapterTests.java @@ -28,7 +28,7 @@ import junit.framework.TestCase; */ public class StringKeyedMapAdapterTests extends TestCase { - private Map contents = new HashMap(); + private Map contents = new HashMap<>(); private StringKeyedMapAdapter map = new StringKeyedMapAdapter() { @@ -67,7 +67,7 @@ public class StringKeyedMapAdapterTests extends TestCase { } public void testPutAll() { - Map all = new HashMap(); + Map all = new HashMap<>(); all.put("foo", "bar"); all.put("bar", "baz"); map.putAll(all); diff --git a/spring-binding/src/test/java/org/springframework/binding/convert/service/DefaultConversionServiceTests.java b/spring-binding/src/test/java/org/springframework/binding/convert/service/DefaultConversionServiceTests.java index f4552ae6..5253c4b8 100644 --- a/spring-binding/src/test/java/org/springframework/binding/convert/service/DefaultConversionServiceTests.java +++ b/spring-binding/src/test/java/org/springframework/binding/convert/service/DefaultConversionServiceTests.java @@ -49,7 +49,7 @@ public class DefaultConversionServiceTests extends TestCase { public void testConvertCompatibleTypes() { DefaultConversionService service = new DefaultConversionService(); - List lst = new ArrayList(); + List 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 princyList = new ArrayList(); + List 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 princyList = new ArrayList(); + List 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 princyList = new ArrayList(); + List princyList = new ArrayList<>(); princyList.add("princy1"); princyList.add("princy2"); List list = (List) executor.execute(princyList); @@ -396,7 +396,7 @@ public class DefaultConversionServiceTests extends TestCase { return "princy2"; } }; - List princyList = new ArrayList(); + List princyList = new ArrayList<>(); princyList.add(princy1); princyList.add(princy2); List list = (List) 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 princyList = new ArrayList(); + List 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 list = new ArrayList(); + List 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 set = new LinkedHashSet(); + Set 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 principals = new ArrayList(); + List principals = new ArrayList<>(); StringTokenizer tokenizer = new StringTokenizer(string, ","); while (tokenizer.hasMoreTokens()) { final String name = tokenizer.nextToken(); diff --git a/spring-binding/src/test/java/org/springframework/binding/expression/beanwrapper/TestBean.java b/spring-binding/src/test/java/org/springframework/binding/expression/beanwrapper/TestBean.java index 7fde4ef7..ee9be418 100644 --- a/spring-binding/src/test/java/org/springframework/binding/expression/beanwrapper/TestBean.java +++ b/spring-binding/src/test/java/org/springframework/binding/expression/beanwrapper/TestBean.java @@ -27,7 +27,7 @@ public class TestBean { private Date date; - private List list = new ArrayList(); + private List list = new ArrayList<>(); public boolean isFlag() { return flag; diff --git a/spring-binding/src/test/java/org/springframework/binding/expression/el/MapAdaptableELResolverTests.java b/spring-binding/src/test/java/org/springframework/binding/expression/el/MapAdaptableELResolverTests.java index e848d429..1c9cc9a5 100644 --- a/spring-binding/src/test/java/org/springframework/binding/expression/el/MapAdaptableELResolverTests.java +++ b/spring-binding/src/test/java/org/springframework/binding/expression/el/MapAdaptableELResolverTests.java @@ -56,7 +56,7 @@ public class MapAdaptableELResolverTests extends TestCase { } private class TestMapAdaptable implements MapAdaptable { - private Map map = new HashMap(); + private Map map = new HashMap<>(); public TestMapAdaptable() { map.put("bar", "bar"); diff --git a/spring-binding/src/test/java/org/springframework/binding/expression/el/TestBean.java b/spring-binding/src/test/java/org/springframework/binding/expression/el/TestBean.java index 8b010b7d..5a5c3ff1 100644 --- a/spring-binding/src/test/java/org/springframework/binding/expression/el/TestBean.java +++ b/spring-binding/src/test/java/org/springframework/binding/expression/el/TestBean.java @@ -23,7 +23,7 @@ public class TestBean { private String value = "foo"; private int maximum = 2; private TestBean bean; - private List list = new ArrayList(); + private List list = new ArrayList<>(); public TestBean() { initList(); diff --git a/spring-binding/src/test/java/org/springframework/binding/mapping/DefaultMapperTests.java b/spring-binding/src/test/java/org/springframework/binding/mapping/DefaultMapperTests.java index d0bd8efc..d3d54f6e 100644 --- a/spring-binding/src/test/java/org/springframework/binding/mapping/DefaultMapperTests.java +++ b/spring-binding/src/test/java/org/springframework/binding/mapping/DefaultMapperTests.java @@ -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 bean1 = new HashMap(); + Map 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 bean1 = new HashMap(); + Map bean1 = new HashMap<>(); bean1.put("boop", "bogus"); TestBean2 bean2 = new TestBean2(); MappingResults results = mapper.map(bean1, bean2); diff --git a/spring-binding/src/test/java/org/springframework/binding/message/MessageContextErrorsTests.java b/spring-binding/src/test/java/org/springframework/binding/message/MessageContextErrorsTests.java index e416ad67..197139b4 100644 --- a/spring-binding/src/test/java/org/springframework/binding/message/MessageContextErrorsTests.java +++ b/spring-binding/src/test/java/org/springframework/binding/message/MessageContextErrorsTests.java @@ -80,7 +80,7 @@ public class MessageContextErrorsTests extends TestCase { } public void testAddAllErrors() { - MapBindingResult result = new MapBindingResult(new HashMap(), "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); diff --git a/spring-faces/src/main/java/org/springframework/faces/config/AbstractFacesFlowConfiguration.java b/spring-faces/src/main/java/org/springframework/faces/config/AbstractFacesFlowConfiguration.java index d76563b8..4526e07a 100644 --- a/spring-faces/src/main/java/org/springframework/faces/config/AbstractFacesFlowConfiguration.java +++ b/spring-faces/src/main/java/org/springframework/faces/config/AbstractFacesFlowConfiguration.java @@ -106,7 +106,7 @@ public class AbstractFacesFlowConfiguration implements ApplicationContextAware { @Bean public SimpleUrlHandlerMapping jsrResourceHandlerMapping() { - Map urlMap = new HashMap(); + Map urlMap = new HashMap<>(); urlMap.put("/javax.faces.resource/**", jsfResourceRequestHandler()); if (isRichFacesPresent) { urlMap.put("/rfRes/**", jsfResourceRequestHandler()); diff --git a/spring-faces/src/main/java/org/springframework/faces/config/ResourcesBeanDefinitionParser.java b/spring-faces/src/main/java/org/springframework/faces/config/ResourcesBeanDefinitionParser.java index 99035784..0b77794b 100644 --- a/spring-faces/src/main/java/org/springframework/faces/config/ResourcesBeanDefinitionParser.java +++ b/spring-faces/src/main/java/org/springframework/faces/config/ResourcesBeanDefinitionParser.java @@ -75,7 +75,7 @@ public class ResourcesBeanDefinitionParser implements BeanDefinitionParser { } private void registerHandlerMappings(Element element, Object source, ParserContext parserContext) { - Map urlMap = new ManagedMap(); + Map urlMap = new ManagedMap<>(); urlMap.put("/javax.faces.resource/**", SERVLET_RESOURCE_HANDLER_BEAN_NAME); if (isRichFacesPresent) { diff --git a/spring-faces/src/main/java/org/springframework/faces/model/ManySelectionTrackingListDataModel.java b/spring-faces/src/main/java/org/springframework/faces/model/ManySelectionTrackingListDataModel.java index 4e174e65..bd5cdda7 100644 --- a/spring-faces/src/main/java/org/springframework/faces/model/ManySelectionTrackingListDataModel.java +++ b/spring-faces/src/main/java/org/springframework/faces/model/ManySelectionTrackingListDataModel.java @@ -30,7 +30,7 @@ import org.springframework.util.Assert; */ public class ManySelectionTrackingListDataModel extends SerializableListDataModel implements SelectionAware { - private List selections = new ArrayList(); + private List selections = new ArrayList<>(); public ManySelectionTrackingListDataModel() { super(); diff --git a/spring-faces/src/main/java/org/springframework/faces/model/OneSelectionTrackingListDataModel.java b/spring-faces/src/main/java/org/springframework/faces/model/OneSelectionTrackingListDataModel.java index a1612141..7fad91ef 100644 --- a/spring-faces/src/main/java/org/springframework/faces/model/OneSelectionTrackingListDataModel.java +++ b/spring-faces/src/main/java/org/springframework/faces/model/OneSelectionTrackingListDataModel.java @@ -33,7 +33,7 @@ public class OneSelectionTrackingListDataModel extends SerializableListDataMo /** * The list of currently selected row data objects. */ - private List selections = new ArrayList(); + private List selections = new ArrayList<>(); public OneSelectionTrackingListDataModel() { super(); diff --git a/spring-faces/src/main/java/org/springframework/faces/model/SerializableListDataModel.java b/spring-faces/src/main/java/org/springframework/faces/model/SerializableListDataModel.java index e9cd793e..59e31b5b 100644 --- a/spring-faces/src/main/java/org/springframework/faces/model/SerializableListDataModel.java +++ b/spring-faces/src/main/java/org/springframework/faces/model/SerializableListDataModel.java @@ -37,7 +37,7 @@ public class SerializableListDataModel extends ListDataModel implements Se public SerializableListDataModel() { - this(new ArrayList()); + this(new ArrayList<>()); } /** @@ -46,7 +46,7 @@ public class SerializableListDataModel extends ListDataModel implements Se */ public SerializableListDataModel(List list) { if (list == null) { - list = new ArrayList(); + list = new ArrayList<>(); } setWrappedData(list); } @@ -58,7 +58,7 @@ public class SerializableListDataModel extends ListDataModel implements Se public void setWrappedData(Object data) { if (data == null) { - data = new ArrayList(); + data = new ArrayList<>(); } Assert.isInstanceOf(List.class, data, "The data object for " + getClass() + " must be a List"); super.setWrappedData(data); diff --git a/spring-faces/src/main/java/org/springframework/faces/webflow/FlowActionListener.java b/spring-faces/src/main/java/org/springframework/faces/webflow/FlowActionListener.java index 0c2f6ba9..a7ce2963 100644 --- a/spring-faces/src/main/java/org/springframework/faces/webflow/FlowActionListener.java +++ b/spring-faces/src/main/java/org/springframework/faces/webflow/FlowActionListener.java @@ -107,7 +107,7 @@ public class FlowActionListener implements ActionListener { if (requestContext.getMessageContext().hasErrorMessages()) { isValid = false; if (requestContext.getExternalContext().isAjaxRequest()) { - List fragments = new ArrayList(); + List fragments = new ArrayList<>(); String formId = getModelExpression(requestContext).getExpressionString(); if (facesContext.getViewRoot().findComponent(formId) != null) { fragments.add(formId); diff --git a/spring-faces/src/main/java/org/springframework/faces/webflow/FlowFacesContext.java b/spring-faces/src/main/java/org/springframework/faces/webflow/FlowFacesContext.java index 9c960861..fb10532a 100644 --- a/spring-faces/src/main/java/org/springframework/faces/webflow/FlowFacesContext.java +++ b/spring-faces/src/main/java/org/springframework/faces/webflow/FlowFacesContext.java @@ -68,7 +68,7 @@ public class FlowFacesContext extends FacesContextWrapper { private static final Map SPRING_SEVERITY_TO_FACES; static { - SPRING_SEVERITY_TO_FACES = new HashMap(); + 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 FACES_SEVERITY_TO_SPRING; static { - FACES_SEVERITY_TO_SPRING = new HashMap(); + FACES_SEVERITY_TO_SPRING = new HashMap<>(); for (Map.Entry 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 getClientIdsWithMessages() { - Set clientIds = new LinkedHashSet(); + Set 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 facesMessages = new ArrayList(); + List facesMessages = new ArrayList<>(); for (Message message : messages) { facesMessages.add(asFacesMessage(message)); } diff --git a/spring-faces/src/main/java/org/springframework/faces/webflow/FlowPartialViewContext.java b/spring-faces/src/main/java/org/springframework/faces/webflow/FlowPartialViewContext.java index f84a39a9..49c3240b 100644 --- a/spring-faces/src/main/java/org/springframework/faces/webflow/FlowPartialViewContext.java +++ b/spring-faces/src/main/java/org/springframework/faces/webflow/FlowPartialViewContext.java @@ -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(Arrays.asList(fragmentIds)); + return new ArrayList<>(Arrays.asList(fragmentIds)); } } return getWrapped().getRenderIds(); diff --git a/spring-faces/src/main/java/org/springframework/faces/webflow/FlowResourceResolver.java b/spring-faces/src/main/java/org/springframework/faces/webflow/FlowResourceResolver.java index 71dc05fa..b9aa2d28 100644 --- a/spring-faces/src/main/java/org/springframework/faces/webflow/FlowResourceResolver.java +++ b/spring-faces/src/main/java/org/springframework/faces/webflow/FlowResourceResolver.java @@ -48,7 +48,7 @@ public class FlowResourceResolver extends ResourceResolver { */ private static final List RESOLVERS_CLASSES; static { - List resolvers = new ArrayList(); + List 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); diff --git a/spring-faces/src/main/java/org/springframework/faces/webflow/JsfManagedBeanAwareELExpressionParser.java b/spring-faces/src/main/java/org/springframework/faces/webflow/JsfManagedBeanAwareELExpressionParser.java index 4f23b4f5..46892547 100644 --- a/spring-faces/src/main/java/org/springframework/faces/webflow/JsfManagedBeanAwareELExpressionParser.java +++ b/spring-faces/src/main/java/org/springframework/faces/webflow/JsfManagedBeanAwareELExpressionParser.java @@ -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 customResolvers = new ArrayList(); + List customResolvers = new ArrayList<>(); customResolvers.add(new RequestContextELResolver(context)); customResolvers.add(new FlowResourceELResolver(context)); customResolvers.add(new ImplicitFlowVariableELResolver(context)); diff --git a/spring-faces/src/test/java/org/springframework/faces/model/SelectionTrackingActionListenerTests.java b/spring-faces/src/test/java/org/springframework/faces/model/SelectionTrackingActionListenerTests.java index 4ade2a69..6b80b728 100644 --- a/spring-faces/src/test/java/org/springframework/faces/model/SelectionTrackingActionListenerTests.java +++ b/spring-faces/src/test/java/org/springframework/faces/model/SelectionTrackingActionListenerTests.java @@ -51,11 +51,11 @@ public class SelectionTrackingActionListenerTests extends TestCase { public void setUp() throws Exception { this.jsfMockHelper.setUp(); this.viewToTest = new UIViewRoot(); - List rows = new ArrayList(); + List rows = new ArrayList<>(); rows.add(new TestRowData()); rows.add(new TestRowData()); rows.add(new TestRowData()); - this.dataModel = new OneSelectionTrackingListDataModel(rows); + this.dataModel = new OneSelectionTrackingListDataModel<>(rows); } protected void tearDown() throws Exception { diff --git a/spring-faces/src/test/java/org/springframework/faces/model/converter/DataModelConverterTests.java b/spring-faces/src/test/java/org/springframework/faces/model/converter/DataModelConverterTests.java index cefb53bc..5465e0d7 100644 --- a/spring-faces/src/test/java/org/springframework/faces/model/converter/DataModelConverterTests.java +++ b/spring-faces/src/test/java/org/springframework/faces/model/converter/DataModelConverterTests.java @@ -18,7 +18,7 @@ public class DataModelConverterTests extends TestCase { @SuppressWarnings("unchecked") public void testConvertListToDataModel() throws Exception { - List sourceList = new ArrayList(); + List sourceList = new ArrayList<>(); DataModel resultModel = (DataModel) this.converter.convertSourceToTargetClass(sourceList, DataModel.class); @@ -29,7 +29,7 @@ public class DataModelConverterTests extends TestCase { @SuppressWarnings("unchecked") public void testConvertListToListDataModel() throws Exception { - List sourceList = new ArrayList(); + List sourceList = new ArrayList<>(); DataModel resultModel = (DataModel) this.converter.convertSourceToTargetClass(sourceList, ListDataModel.class); @@ -40,7 +40,7 @@ public class DataModelConverterTests extends TestCase { @SuppressWarnings("unchecked") public void testConvertListToSerializableListDataModel() throws Exception { - List sourceList = new ArrayList(); + List sourceList = new ArrayList<>(); DataModel resultModel = (DataModel) this.converter.convertSourceToTargetClass(sourceList, SerializableListDataModel.class); diff --git a/spring-faces/src/test/java/org/springframework/faces/model/converter/FacesConversionServiceTests.java b/spring-faces/src/test/java/org/springframework/faces/model/converter/FacesConversionServiceTests.java index 76ec0ae1..4c1813ba 100644 --- a/spring-faces/src/test/java/org/springframework/faces/model/converter/FacesConversionServiceTests.java +++ b/spring-faces/src/test/java/org/springframework/faces/model/converter/FacesConversionServiceTests.java @@ -18,7 +18,7 @@ public class FacesConversionServiceTests extends TestCase { public void testGetAbstractType() { ConversionExecutor executor = this.service.getConversionExecutor(List.class, DataModel.class); - ArrayList list = new ArrayList(); + ArrayList list = new ArrayList<>(); list.add("foo"); executor.execute(list); } diff --git a/spring-faces/src/test/java/org/springframework/faces/mvc/JsfViewTests.java b/spring-faces/src/test/java/org/springframework/faces/mvc/JsfViewTests.java index abec8737..bf6eeec7 100644 --- a/spring-faces/src/test/java/org/springframework/faces/mvc/JsfViewTests.java +++ b/spring-faces/src/test/java/org/springframework/faces/mvc/JsfViewTests.java @@ -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(), new MockHttpServletRequest(), new MockHttpServletResponse()); + view.render(new HashMap<>(), new MockHttpServletRequest(), new MockHttpServletResponse()); } private class ResourceCheckingViewHandler extends MockViewHandler { diff --git a/spring-faces/src/test/java/org/springframework/faces/webflow/FlowActionListenerTests.java b/spring-faces/src/test/java/org/springframework/faces/webflow/FlowActionListenerTests.java index caae5f3f..c4b72780 100644 --- a/spring-faces/src/test/java/org/springframework/faces/webflow/FlowActionListenerTests.java +++ b/spring-faces/src/test/java/org/springframework/faces/webflow/FlowActionListenerTests.java @@ -31,7 +31,7 @@ public class FlowActionListenerTests extends TestCase { this.listener = new FlowActionListener(this.jsfMock.application().getActionListener()); RequestContextHolder.setRequestContext(this.context); - LocalAttributeMap flash = new LocalAttributeMap(); + LocalAttributeMap flash = new LocalAttributeMap<>(); EasyMock.expect(this.context.getFlashScope()).andStubReturn(flash); EasyMock.expect(this.context.getCurrentState()).andStubReturn(new MockViewState()); EasyMock.replay(new Object[] { this.context }); diff --git a/spring-faces/src/test/java/org/springframework/faces/webflow/FlowELResolverTests.java b/spring-faces/src/test/java/org/springframework/faces/webflow/FlowELResolverTests.java index f74f70fc..31bfb86b 100644 --- a/spring-faces/src/test/java/org/springframework/faces/webflow/FlowELResolverTests.java +++ b/spring-faces/src/test/java/org/springframework/faces/webflow/FlowELResolverTests.java @@ -65,7 +65,7 @@ public class FlowELResolverTests extends TestCase { } public void testMapAdaptableResolve() throws Exception { - LocalAttributeMap base = new LocalAttributeMap(); + LocalAttributeMap base = new LocalAttributeMap<>(); base.put("test", "test"); Object actual = this.resolver.getValue(this.elContext, base, "test"); assertTrue(this.elContext.isPropertyResolved()); diff --git a/spring-faces/src/test/java/org/springframework/faces/webflow/FlowFacesContextTests.java b/spring-faces/src/test/java/org/springframework/faces/webflow/FlowFacesContextTests.java index b20a78ec..ba9242cd 100644 --- a/spring-faces/src/test/java/org/springframework/faces/webflow/FlowFacesContextTests.java +++ b/spring-faces/src/test/java/org/springframework/faces/webflow/FlowFacesContextTests.java @@ -193,7 +193,7 @@ public class FlowFacesContextTests extends TestCase { EasyMock.expect(this.requestContext.getMessageContext()).andStubReturn(this.messageContext); EasyMock.replay(new Object[] { this.requestContext }); - List expectedOrderedIds = new ArrayList(); + List expectedOrderedIds = new ArrayList<>(); expectedOrderedIds.add(null); expectedOrderedIds.add("componentId"); expectedOrderedIds.add("userMessage"); diff --git a/spring-faces/src/test/java/org/springframework/faces/webflow/FlowResponseStateManagerTests.java b/spring-faces/src/test/java/org/springframework/faces/webflow/FlowResponseStateManagerTests.java index 001ab21f..cc9d55ed 100644 --- a/spring-faces/src/test/java/org/springframework/faces/webflow/FlowResponseStateManagerTests.java +++ b/spring-faces/src/test/java/org/springframework/faces/webflow/FlowResponseStateManagerTests.java @@ -43,7 +43,7 @@ public class FlowResponseStateManagerTests extends TestCase { public void testWriteFlowSerializedView() throws Exception { EasyMock.expect(this.flowExecutionContext.getKey()).andReturn(new MockFlowExecutionKey("e1s1")); - LocalAttributeMap viewMap = new LocalAttributeMap(); + LocalAttributeMap 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 viewMap = new LocalAttributeMap(); + LocalAttributeMap viewMap = new LocalAttributeMap<>(); viewMap.put(FlowResponseStateManager.FACES_VIEW_STATE, state); EasyMock.expect(this.requestContext.getViewScope()).andStubReturn(viewMap); EasyMock.replay(this.requestContext); diff --git a/spring-faces/src/test/java/org/springframework/faces/webflow/JSFManagedBean.java b/spring-faces/src/test/java/org/springframework/faces/webflow/JSFManagedBean.java index 09fd1ef3..c8410608 100644 --- a/spring-faces/src/test/java/org/springframework/faces/webflow/JSFManagedBean.java +++ b/spring-faces/src/test/java/org/springframework/faces/webflow/JSFManagedBean.java @@ -7,7 +7,7 @@ public class JSFManagedBean { String prop1; JSFModel model; - List values = new ArrayList(); + List values = new ArrayList<>(); public JSFModel getModel() { return this.model; diff --git a/spring-faces/src/test/java/org/springframework/faces/webflow/JsfFinalResponseActionTests.java b/spring-faces/src/test/java/org/springframework/faces/webflow/JsfFinalResponseActionTests.java index bd4c1056..f28f513b 100644 --- a/spring-faces/src/test/java/org/springframework/faces/webflow/JsfFinalResponseActionTests.java +++ b/spring-faces/src/test/java/org/springframework/faces/webflow/JsfFinalResponseActionTests.java @@ -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 requestMap = new LocalAttributeMap(); + LocalAttributeMap requestMap = new LocalAttributeMap<>(); EasyMock.expect(this.context.getFlashScope()).andStubReturn(requestMap); EasyMock.expect(this.context.getRequestParameters()).andStubReturn( - new LocalParameterMap(new HashMap())); + 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 phaseCallbacks = new ArrayList(); + private final List phaseCallbacks = new ArrayList<>(); public void afterPhase(PhaseEvent event) { String phaseCallback = "AFTER_" + event.getPhaseId(); diff --git a/spring-faces/src/test/java/org/springframework/faces/webflow/JsfUtilsTests.java b/spring-faces/src/test/java/org/springframework/faces/webflow/JsfUtilsTests.java index 8a7f65a1..23ee0622 100644 --- a/spring-faces/src/test/java/org/springframework/faces/webflow/JsfUtilsTests.java +++ b/spring-faces/src/test/java/org/springframework/faces/webflow/JsfUtilsTests.java @@ -27,7 +27,7 @@ public class JsfUtilsTests extends AbstractJsfTestCase { } public void testBeforeListenersCalledInForwardOrder() throws Exception { - List list = new ArrayList(); + List 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 list = new ArrayList(); + List list = new ArrayList<>(); MockLifecycle lifecycle = new MockLifecycle(); PhaseListener listener1 = new OrderVerifyingPhaseListener(list, null); lifecycle.addPhaseListener(listener1); diff --git a/spring-faces/src/test/java/org/springframework/faces/webflow/JsfViewFactoryTests.java b/spring-faces/src/test/java/org/springframework/faces/webflow/JsfViewFactoryTests.java index e13bdca8..5f1eaf1d 100644 --- a/spring-faces/src/test/java/org/springframework/faces/webflow/JsfViewFactoryTests.java +++ b/spring-faces/src/test/java/org/springframework/faces/webflow/JsfViewFactoryTests.java @@ -54,7 +54,7 @@ public class JsfViewFactoryTests extends TestCase { private final RequestContext context = EasyMock.createMock(RequestContext.class); - private final LocalAttributeMap flashMap = new LocalAttributeMap(); + private final LocalAttributeMap 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())); + 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 phaseCallbacks = new ArrayList(); + private final List phaseCallbacks = new ArrayList<>(); public void afterPhase(PhaseEvent event) { String phaseCallback = "AFTER_" + event.getPhaseId(); diff --git a/spring-faces/src/test/java/org/springframework/faces/webflow/MockJsfExternalContext.java b/spring-faces/src/test/java/org/springframework/faces/webflow/MockJsfExternalContext.java index c3913d21..80f8f5fe 100644 --- a/spring-faces/src/test/java/org/springframework/faces/webflow/MockJsfExternalContext.java +++ b/spring-faces/src/test/java/org/springframework/faces/webflow/MockJsfExternalContext.java @@ -32,11 +32,11 @@ import javax.faces.context.ExternalContext; public class MockJsfExternalContext extends ExternalContext { - private final Map applicationMap = new HashMap(); + private final Map applicationMap = new HashMap<>(); - private final Map sessionMap = new HashMap(); + private final Map sessionMap = new HashMap<>(); - private Map requestMap = new HashMap(); + private Map requestMap = new HashMap<>(); private Map requestParameterMap = Collections.emptyMap(); diff --git a/spring-webflow/src/main/java/org/springframework/webflow/action/CompositeAction.java b/spring-webflow/src/main/java/org/springframework/webflow/action/CompositeAction.java index 2420ebe3..0ce567ea 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/action/CompositeAction.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/action/CompositeAction.java @@ -93,8 +93,8 @@ public class CompositeAction extends AbstractAction { public Event doExecute(RequestContext context) throws Exception { Action[] actions = getActions(); String eventId = getEventFactorySupport().getSuccessEventId(); - MutableAttributeMap eventAttributes = new LocalAttributeMap(); - List actionResults = new ArrayList(actions.length); + MutableAttributeMap eventAttributes = new LocalAttributeMap<>(); + List actionResults = new ArrayList<>(actions.length); for (Action action : actions) { Event result = action.execute(context); actionResults.add(result); diff --git a/spring-webflow/src/main/java/org/springframework/webflow/action/FlowDefinitionRedirectAction.java b/spring-webflow/src/main/java/org/springframework/webflow/action/FlowDefinitionRedirectAction.java index 3228e1ec..d1fcdae7 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/action/FlowDefinitionRedirectAction.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/action/FlowDefinitionRedirectAction.java @@ -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(parameters.length, 1); + executionInput = new LocalAttributeMap<>(parameters.length, 1); for (String nameAndValue : parameters) { index = nameAndValue.indexOf('='); if (index != -1) { diff --git a/spring-webflow/src/main/java/org/springframework/webflow/config/FlowDefinitionRegistryBuilder.java b/spring-webflow/src/main/java/org/springframework/webflow/config/FlowDefinitionRegistryBuilder.java index f4fb7b74..50c7ae32 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/config/FlowDefinitionRegistryBuilder.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/config/FlowDefinitionRegistryBuilder.java @@ -50,11 +50,11 @@ import org.springframework.webflow.engine.model.registry.FlowModelHolder; */ public class FlowDefinitionRegistryBuilder { - private final List flowLocations = new ArrayList(); + private final List flowLocations = new ArrayList<>(); - private final List flowLocationPatterns = new ArrayList(); + private final List flowLocationPatterns = new ArrayList<>(); - private final List flowBuilderInfos = new ArrayList(); + private final List flowBuilderInfos = new ArrayList<>(); private FlowBuilderServices flowBuilderServices; @@ -246,7 +246,7 @@ public class FlowDefinitionRegistryBuilder { private void registerFlowLocationPatterns(DefaultFlowRegistry flowRegistry) { for (String pattern : this.flowLocationPatterns) { - AttributeMap attributes = new LocalAttributeMap(); + AttributeMap 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(attributes) : - new LocalAttributeMap(new HashMap()); + 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(attributes) : - new LocalAttributeMap(new HashMap()); + new LocalAttributeMap<>(attributes) : + new LocalAttributeMap<>(new HashMap<>()); } public FlowBuilder getBuilder() { diff --git a/spring-webflow/src/main/java/org/springframework/webflow/config/FlowExecutionListenerLoaderBeanDefinitionParser.java b/spring-webflow/src/main/java/org/springframework/webflow/config/FlowExecutionListenerLoaderBeanDefinitionParser.java index 1e5c06e8..4fbe493e 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/config/FlowExecutionListenerLoaderBeanDefinitionParser.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/config/FlowExecutionListenerLoaderBeanDefinitionParser.java @@ -51,7 +51,7 @@ class FlowExecutionListenerLoaderBeanDefinitionParser extends AbstractSingleBean * criteria */ private Map parseListenersWithCriteria(List listeners) { - Map listenersWithCriteria = new ManagedMap( + Map listenersWithCriteria = new ManagedMap<>( listeners.size()); for (Element listenerElement : listeners) { RuntimeBeanReference ref = new RuntimeBeanReference(listenerElement.getAttribute("ref")); diff --git a/spring-webflow/src/main/java/org/springframework/webflow/config/FlowExecutorBeanDefinitionParser.java b/spring-webflow/src/main/java/org/springframework/webflow/config/FlowExecutorBeanDefinitionParser.java index 090a7795..5ade2faf 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/config/FlowExecutorBeanDefinitionParser.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/config/FlowExecutorBeanDefinitionParser.java @@ -91,7 +91,7 @@ class FlowExecutorBeanDefinitionParser extends AbstractSingleBeanDefinitionParse private Set parseFlowExecutionAttributes(Element element) { Element executionAttributesElement = DomUtils.getChildElementByTagName(element, "flow-execution-attributes"); if (executionAttributesElement != null) { - HashSet attributes = new HashSet(); + HashSet attributes = new HashSet<>(); Element redirectElement = DomUtils.getChildElementByTagName(executionAttributesElement, "always-redirect-on-pause"); if (redirectElement != null) { diff --git a/spring-webflow/src/main/java/org/springframework/webflow/config/FlowExecutorBuilder.java b/spring-webflow/src/main/java/org/springframework/webflow/config/FlowExecutorBuilder.java index 35a5788a..4caca1eb 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/config/FlowExecutorBuilder.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/config/FlowExecutorBuilder.java @@ -49,7 +49,7 @@ public class FlowExecutorBuilder { private Integer maxFlowExecutionSnapshots; - private LocalAttributeMap executionAttributes = new LocalAttributeMap(); + private LocalAttributeMap executionAttributes = new LocalAttributeMap<>(); private ConditionalFlowExecutionListenerLoader listenerLoader; @@ -214,7 +214,7 @@ public class FlowExecutorBuilder { } private LocalAttributeMap getExecutionAttributes() { - LocalAttributeMap attributes = new LocalAttributeMap(this.executionAttributes.asMap()); + LocalAttributeMap attributes = new LocalAttributeMap<>(this.executionAttributes.asMap()); if (!attributes.contains("alwaysRedirectOnPause")) { attributes.put("alwaysRedirectOnPause", true); } diff --git a/spring-webflow/src/main/java/org/springframework/webflow/config/FlowExecutorFactoryBean.java b/spring-webflow/src/main/java/org/springframework/webflow/config/FlowExecutorFactoryBean.java index 52eb90ee..06caf314 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/config/FlowExecutorFactoryBean.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/config/FlowExecutorFactoryBean.java @@ -161,7 +161,7 @@ class FlowExecutorFactoryBean implements FactoryBean, BeanClassLoa } private MutableAttributeMap createFlowExecutionAttributes() { - LocalAttributeMap executionAttributes = new LocalAttributeMap(); + LocalAttributeMap executionAttributes = new LocalAttributeMap<>(); if (flowExecutionAttributes != null) { for (FlowElementAttribute attribute : flowExecutionAttributes) { executionAttributes.put(attribute.getName(), getConvertedValue(attribute)); diff --git a/spring-webflow/src/main/java/org/springframework/webflow/config/FlowRegistryBeanDefinitionParser.java b/spring-webflow/src/main/java/org/springframework/webflow/config/FlowRegistryBeanDefinitionParser.java index 689b8a53..12b5bb3b 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/config/FlowRegistryBeanDefinitionParser.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/config/FlowRegistryBeanDefinitionParser.java @@ -81,7 +81,7 @@ class FlowRegistryBeanDefinitionParser extends AbstractSingleBeanDefinitionParse if (locationElements.isEmpty()) { return Collections.emptyList(); } - List locations = new ArrayList(locationElements.size()); + List 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 locationPatterns = new ArrayList(locationPatternElements.size()); + List 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 attributeElements = DomUtils.getChildElementsByTagName(definitionAttributesElement, "attribute"); - Set attributes = new HashSet(attributeElements.size()); + Set 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 builders = new ArrayList(builderElements.size()); + List builders = new ArrayList<>(builderElements.size()); for (Element builderElement : builderElements) { String id = builderElement.getAttribute("id"); String className = builderElement.getAttribute("class"); diff --git a/spring-webflow/src/main/java/org/springframework/webflow/config/FlowRegistryFactoryBean.java b/spring-webflow/src/main/java/org/springframework/webflow/config/FlowRegistryFactoryBean.java index 3e742f87..12bc4419 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/config/FlowRegistryFactoryBean.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/config/FlowRegistryFactoryBean.java @@ -213,12 +213,12 @@ class FlowRegistryFactoryBean implements FactoryBean, Be private AttributeMap getFlowAttributes(Set attributes) { MutableAttributeMap flowAttributes = null; if (flowBuilderServices.getDevelopment()) { - flowAttributes = new LocalAttributeMap(1 + attributes.size(), 1); + flowAttributes = new LocalAttributeMap<>(1 + attributes.size(), 1); flowAttributes.put("development", true); } if (!attributes.isEmpty()) { if (flowAttributes == null) { - flowAttributes = new LocalAttributeMap(attributes.size(), 1); + flowAttributes = new LocalAttributeMap<>(attributes.size(), 1); } for (FlowElementAttribute attribute : attributes) { flowAttributes.put(attribute.getName(), getConvertedValue(attribute)); diff --git a/spring-webflow/src/main/java/org/springframework/webflow/context/ExternalContextHolder.java b/spring-webflow/src/main/java/org/springframework/webflow/context/ExternalContextHolder.java index 03dbf823..9bdd4dd5 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/context/ExternalContextHolder.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/context/ExternalContextHolder.java @@ -30,7 +30,7 @@ import org.springframework.core.NamedThreadLocal; */ public final class ExternalContextHolder { - private static final ThreadLocal externalContextHolder = new NamedThreadLocal( + private static final ThreadLocal externalContextHolder = new NamedThreadLocal<>( "Flow ExternalContext"); /** @@ -53,4 +53,4 @@ public final class ExternalContextHolder { private ExternalContextHolder() { } -} +} diff --git a/spring-webflow/src/main/java/org/springframework/webflow/context/servlet/HttpServletRequestParameterMap.java b/spring-webflow/src/main/java/org/springframework/webflow/context/servlet/HttpServletRequestParameterMap.java index 3db2ca0d..186873c0 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/context/servlet/HttpServletRequestParameterMap.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/context/servlet/HttpServletRequestParameterMap.java @@ -81,7 +81,7 @@ public class HttpServletRequestParameterMap extends StringKeyedMapAdapter getAttributeNames() { if (request instanceof MultipartHttpServletRequest) { MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; - CompositeIterator iterator = new CompositeIterator(); + CompositeIterator iterator = new CompositeIterator<>(); iterator.add(multipartRequest.getFileMap().keySet().iterator()); iterator.add(getRequestParameterNames()); return iterator; diff --git a/spring-webflow/src/main/java/org/springframework/webflow/context/servlet/ServletExternalContext.java b/spring-webflow/src/main/java/org/springframework/webflow/context/servlet/ServletExternalContext.java index 9604accd..5818829f 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/context/servlet/ServletExternalContext.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/context/servlet/ServletExternalContext.java @@ -241,7 +241,7 @@ public class ServletExternalContext implements ExternalContext { public void requestFlowDefinitionRedirect(String flowId, MutableAttributeMap input) throws IllegalStateException { assertResponseAllowed(); flowDefinitionRedirectFlowId = flowId; - flowDefinitionRedirectFlowInput = new LocalAttributeMap(); + 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(new HttpServletRequestMap(request)); - this.sessionMap = new LocalSharedAttributeMap(new HttpSessionMap(request)); - this.applicationMap = new LocalSharedAttributeMap(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; } diff --git a/spring-webflow/src/main/java/org/springframework/webflow/context/web/HttpSessionMapBindingListener.java b/spring-webflow/src/main/java/org/springframework/webflow/context/web/HttpSessionMapBindingListener.java index a857c198..2a2f99ca 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/context/web/HttpSessionMapBindingListener.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/context/web/HttpSessionMapBindingListener.java @@ -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(sessionMap), event.getName(), listener); + return new AttributeMapBindingEvent(new LocalAttributeMap<>(sessionMap), event.getName(), listener); } -} +} diff --git a/spring-webflow/src/main/java/org/springframework/webflow/conversation/impl/ContainedConversation.java b/spring-webflow/src/main/java/org/springframework/webflow/conversation/impl/ContainedConversation.java index 8edd5fd8..c8bd590e 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/conversation/impl/ContainedConversation.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/conversation/impl/ContainedConversation.java @@ -55,7 +55,7 @@ public class ContainedConversation implements Conversation, Serializable { this.container = container; this.id = id; this.lock = lock; - this.attributes = new HashMap(); + this.attributes = new HashMap<>(); } protected void setContainer(ConversationContainer container) { diff --git a/spring-webflow/src/main/java/org/springframework/webflow/conversation/impl/ConversationContainer.java b/spring-webflow/src/main/java/org/springframework/webflow/conversation/impl/ConversationContainer.java index acfdf1cb..85aac6d6 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/conversation/impl/ConversationContainer.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/conversation/impl/ConversationContainer.java @@ -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(); + this.conversations = new CopyOnWriteArrayList<>(); } /** diff --git a/spring-webflow/src/main/java/org/springframework/webflow/core/AnnotatedObject.java b/spring-webflow/src/main/java/org/springframework/webflow/core/AnnotatedObject.java index b7cb406a..711148c8 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/core/AnnotatedObject.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/core/AnnotatedObject.java @@ -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 attributes = new LocalAttributeMap(); + private LocalAttributeMap attributes = new LocalAttributeMap<>(); // implementing Annotated @@ -76,4 +76,4 @@ public abstract class AnnotatedObject implements Annotated { attributes.put(DESCRIPTION_PROPERTY, description); } -} +} diff --git a/spring-webflow/src/main/java/org/springframework/webflow/core/collection/CollectionUtils.java b/spring-webflow/src/main/java/org/springframework/webflow/core/collection/CollectionUtils.java index d67eb1d0..179d4595 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/core/collection/CollectionUtils.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/core/collection/CollectionUtils.java @@ -38,7 +38,7 @@ public class CollectionUtils { /** * The shared, singleton empty attribute map instance. */ - public static final AttributeMap EMPTY_ATTRIBUTE_MAP = new LocalAttributeMap( + public static final AttributeMap EMPTY_ATTRIBUTE_MAP = new LocalAttributeMap<>( Collections. emptyMap()); /** @@ -58,7 +58,7 @@ public class CollectionUtils { * @return the iterator */ public static Iterator toIterator(Enumeration enumeration) { - return new EnumerationIterator(enumeration); + return new EnumerationIterator<>(enumeration); } /** @@ -68,7 +68,7 @@ public class CollectionUtils { * @return the unmodifiable map with a single element */ public static AttributeMap singleEntryMap(String attributeName, V attributeValue) { - return new LocalAttributeMap(attributeName, attributeValue); + return new LocalAttributeMap<>(attributeName, attributeValue); } /** diff --git a/spring-webflow/src/main/java/org/springframework/webflow/core/collection/LocalAttributeMap.java b/spring-webflow/src/main/java/org/springframework/webflow/core/collection/LocalAttributeMap.java index fd1b36b8..4fdef1b2 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/core/collection/LocalAttributeMap.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/core/collection/LocalAttributeMap.java @@ -215,12 +215,12 @@ public class LocalAttributeMap implements MutableAttributeMap, Serializabl public AttributeMap union(AttributeMap attributes) { if (attributes == null) { - return new LocalAttributeMap(getMapInternal()); + return new LocalAttributeMap<>(getMapInternal()); } else { Map map = createTargetMap(); map.putAll(getMapInternal()); map.putAll(attributes.asMap()); - return new LocalAttributeMap(map); + return new LocalAttributeMap<>(map); } } @@ -284,7 +284,7 @@ public class LocalAttributeMap implements MutableAttributeMap, Serializabl */ protected void initAttributes(Map attributes) { this.attributes = attributes; - attributeAccessor = new MapAccessor(this.attributes); + attributeAccessor = new MapAccessor<>(this.attributes); } /** @@ -301,7 +301,7 @@ public class LocalAttributeMap implements MutableAttributeMap, Serializabl * @return the target map */ protected Map createTargetMap() { - return new HashMap(); + return new HashMap<>(); } /** @@ -311,7 +311,7 @@ public class LocalAttributeMap implements MutableAttributeMap, Serializabl * @return the target map */ protected Map createTargetMap(int size, int loadFactor) { - return new HashMap(size, loadFactor); + return new HashMap<>(size, loadFactor); } @SuppressWarnings("unchecked") @@ -335,7 +335,7 @@ public class LocalAttributeMap implements MutableAttributeMap, Serializabl private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); - attributeAccessor = new MapAccessor(attributes); + attributeAccessor = new MapAccessor<>(attributes); } public String toString() { diff --git a/spring-webflow/src/main/java/org/springframework/webflow/core/collection/LocalParameterMap.java b/spring-webflow/src/main/java/org/springframework/webflow/core/collection/LocalParameterMap.java index e135270c..8dd69bc4 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/core/collection/LocalParameterMap.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/core/collection/LocalParameterMap.java @@ -254,7 +254,7 @@ public class LocalParameterMap implements ParameterMap, Serializable { } public AttributeMap asAttributeMap() { - return new LocalAttributeMap(getMapInternal()); + return new LocalAttributeMap<>(getMapInternal()); } /** @@ -263,7 +263,7 @@ public class LocalParameterMap implements ParameterMap, Serializable { */ protected void initParameters(Map parameters) { this.parameters = parameters; - parameterAccessor = new MapAccessor(this.parameters); + parameterAccessor = new MapAccessor<>(this.parameters); } /** @@ -289,7 +289,7 @@ public class LocalParameterMap implements ParameterMap, Serializable { @SuppressWarnings("unchecked") private T[] convert(String[] parameters, Class targetElementType) throws ConversionExecutionException { - List list = new ArrayList(parameters.length); + List 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(parameters); + parameterAccessor = new MapAccessor<>(parameters); conversionService = DEFAULT_CONVERSION_SERVICE; } public String toString() { return StylerUtils.style(parameters); } -} +} diff --git a/spring-webflow/src/main/java/org/springframework/webflow/definition/registry/FlowDefinitionRegistryImpl.java b/spring-webflow/src/main/java/org/springframework/webflow/definition/registry/FlowDefinitionRegistryImpl.java index 880d9f27..cd385c11 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/definition/registry/FlowDefinitionRegistryImpl.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/definition/registry/FlowDefinitionRegistryImpl.java @@ -45,7 +45,7 @@ public class FlowDefinitionRegistryImpl implements FlowDefinitionRegistry { private FlowDefinitionRegistry parent; public FlowDefinitionRegistryImpl() { - flowDefinitions = new TreeMap(); + flowDefinitions = new TreeMap<>(); } // implementing FlowDefinitionLocator diff --git a/spring-webflow/src/main/java/org/springframework/webflow/engine/ActionList.java b/spring-webflow/src/main/java/org/springframework/webflow/engine/ActionList.java index 0c7306c3..37dbdcc3 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/engine/ActionList.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/engine/ActionList.java @@ -43,7 +43,7 @@ public class ActionList implements Iterable { /** * The lists of actions. */ - private List actions = new LinkedList(); + private List actions = new LinkedList<>(); /** * Add an action to this list. diff --git a/spring-webflow/src/main/java/org/springframework/webflow/engine/EndState.java b/spring-webflow/src/main/java/org/springframework/webflow/engine/EndState.java index 5f4b868c..9fbe940d 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/engine/EndState.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/engine/EndState.java @@ -113,7 +113,7 @@ public class EndState extends State { * execution request context into a newly created empty map. */ protected LocalAttributeMap createSessionOutput(RequestContext context) { - LocalAttributeMap output = new LocalAttributeMap(); + LocalAttributeMap 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); } -} +} diff --git a/spring-webflow/src/main/java/org/springframework/webflow/engine/Flow.java b/spring-webflow/src/main/java/org/springframework/webflow/engine/Flow.java index 0c995854..e5d01089 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/engine/Flow.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/engine/Flow.java @@ -123,7 +123,7 @@ public class Flow extends AnnotatedObject implements FlowDefinition { /** * The set of state definitions for this flow. */ - private Set states = new LinkedHashSet(9); + private Set 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 variables = new LinkedHashMap(); + private Map 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 possibleOutcomes = new ArrayList(); + List possibleOutcomes = new ArrayList<>(); for (State state : states) { if (state instanceof EndState) { possibleOutcomes.add(state.getId()); diff --git a/spring-webflow/src/main/java/org/springframework/webflow/engine/FlowExecutionExceptionHandlerSet.java b/spring-webflow/src/main/java/org/springframework/webflow/engine/FlowExecutionExceptionHandlerSet.java index 8ea71d02..3f251d22 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/engine/FlowExecutionExceptionHandlerSet.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/engine/FlowExecutionExceptionHandlerSet.java @@ -37,7 +37,7 @@ public class FlowExecutionExceptionHandlerSet { /** * The set of exception handlers. */ - private List exceptionHandlers = new LinkedList(); + private List exceptionHandlers = new LinkedList<>(); /** * Add a state exception handler to this set. diff --git a/spring-webflow/src/main/java/org/springframework/webflow/engine/SubflowState.java b/spring-webflow/src/main/java/org/springframework/webflow/engine/SubflowState.java index 13e817af..170f8e84 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/engine/SubflowState.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/engine/SubflowState.java @@ -92,7 +92,7 @@ public class SubflowState extends TransitionableState { if (subflowAttributeMapper != null) { flowInput = subflowAttributeMapper.createSubflowInput(context); } else { - flowInput = new LocalAttributeMap(); + 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); } -} +} diff --git a/spring-webflow/src/main/java/org/springframework/webflow/engine/TransitionSet.java b/spring-webflow/src/main/java/org/springframework/webflow/engine/TransitionSet.java index 93ac4ccc..4532691d 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/engine/TransitionSet.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/engine/TransitionSet.java @@ -36,7 +36,7 @@ public class TransitionSet implements Iterable { /** * The set of transitions. */ - private List transitions = new LinkedList(); + private List transitions = new LinkedList<>(); /** * Add a transition to this set. diff --git a/spring-webflow/src/main/java/org/springframework/webflow/engine/ViewState.java b/spring-webflow/src/main/java/org/springframework/webflow/engine/ViewState.java index 43e58354..f4ccf8a2 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/engine/ViewState.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/engine/ViewState.java @@ -53,7 +53,7 @@ public class ViewState extends TransitionableState { /** * The set of view variables created by this view state. */ - private Map variables = new LinkedHashMap(); + private Map variables = new LinkedHashMap<>(); /** * Whether or not a redirect should occur before the view is rendered. diff --git a/spring-webflow/src/main/java/org/springframework/webflow/engine/builder/BinderConfiguration.java b/spring-webflow/src/main/java/org/springframework/webflow/engine/builder/BinderConfiguration.java index 8f353253..392b7bce 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/engine/builder/BinderConfiguration.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/engine/builder/BinderConfiguration.java @@ -16,7 +16,7 @@ import org.springframework.util.Assert; */ public class BinderConfiguration { - private Set bindings = new LinkedHashSet(); + private Set bindings = new LinkedHashSet<>(); /** * Adds a new binding to this binding configuration. diff --git a/spring-webflow/src/main/java/org/springframework/webflow/engine/builder/model/FlowModelFlowBuilder.java b/spring-webflow/src/main/java/org/springframework/webflow/engine/builder/model/FlowModelFlowBuilder.java index 33debf78..dc776894 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/engine/builder/model/FlowModelFlowBuilder.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/engine/builder/model/FlowModelFlowBuilder.java @@ -314,7 +314,7 @@ public class FlowModelFlowBuilder extends AbstractFlowBuilder { private Resource[] parseContextResources(List beanImports) { if (beanImports != null && !beanImports.isEmpty()) { Resource flowResource = flowModelHolder.getFlowModelResource(); - List resources = new ArrayList(beanImports.size()); + List 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 vars) { if (vars != null && !vars.isEmpty()) { - List variables = new ArrayList(vars.size()); + List 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 ifModels) { if (ifModels != null && !ifModels.isEmpty()) { - List transitions = new ArrayList(ifModels.size()); + List 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 transitionModels) { if (transitionModels != null && !transitionModels.isEmpty()) { - List exceptionHandlers = new ArrayList( + List 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 exceptionHandlerModels) { if (exceptionHandlerModels != null && !exceptionHandlerModels.isEmpty()) { - List exceptionHandlers = new ArrayList( + List 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 transitionModels) { if (transitionModels != null && !transitionModels.isEmpty()) { - List transitions = new ArrayList(transitionModels.size()); + List 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 actionModels) { if (actionModels != null && !actionModels.isEmpty()) { - List actions = new ArrayList(actionModels.size()); + List 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 parseMetaAttributes(List attributeModels) { if (attributeModels != null && !attributeModels.isEmpty()) { - LocalAttributeMap attributes = new LocalAttributeMap(); + LocalAttributeMap attributes = new LocalAttributeMap<>(); for (AttributeModel attributeModel : attributeModels) { parseAndPutMetaAttribute(attributeModel, attributes); } return attributes; } else { - return new LocalAttributeMap(); + return new LocalAttributeMap<>(); } } diff --git a/spring-webflow/src/main/java/org/springframework/webflow/engine/impl/FlowExecutionImpl.java b/spring-webflow/src/main/java/org/springframework/webflow/engine/impl/FlowExecutionImpl.java index 9ae9482b..9ea23e39 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/engine/impl/FlowExecutionImpl.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/engine/impl/FlowExecutionImpl.java @@ -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(); - conversationScope = new LocalAttributeMap(); - conversationScope.put(FLASH_SCOPE_ATTRIBUTE, new LocalAttributeMap()); + 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(); + input = new LocalAttributeMap<>(); } if (hasEmbeddedModeAttribute(input)) { session.setEmbeddedMode(); diff --git a/spring-webflow/src/main/java/org/springframework/webflow/engine/impl/FlowExecutionImplFactory.java b/spring-webflow/src/main/java/org/springframework/webflow/engine/impl/FlowExecutionImplFactory.java index 98bab900..470c1fc8 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/engine/impl/FlowExecutionImplFactory.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/engine/impl/FlowExecutionImplFactory.java @@ -107,7 +107,7 @@ public class FlowExecutionImplFactory implements FlowExecutionFactory { } execution.setKey(flowExecutionKey); if (conversationScope == null) { - conversationScope = new LocalAttributeMap(); + conversationScope = new LocalAttributeMap<>(); } execution.setConversationScope(conversationScope); execution.setAttributes(executionAttributes); diff --git a/spring-webflow/src/main/java/org/springframework/webflow/engine/impl/FlowSessionImpl.java b/spring-webflow/src/main/java/org/springframework/webflow/engine/impl/FlowSessionImpl.java index 153bd2a2..5631c9af 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/engine/impl/FlowSessionImpl.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/engine/impl/FlowSessionImpl.java @@ -61,7 +61,7 @@ class FlowSessionImpl implements FlowSession, Externalizable { /** * The session data model ("flow scope"). */ - private MutableAttributeMap scope = new LocalAttributeMap(); + private MutableAttributeMap scope = new LocalAttributeMap<>(); /** * The parent session of this session (may be null 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()); + scope.put(VIEW_SCOPE_ATTRIBUTE, new LocalAttributeMap<>()); } /** diff --git a/spring-webflow/src/main/java/org/springframework/webflow/engine/impl/RequestControlContextImpl.java b/spring-webflow/src/main/java/org/springframework/webflow/engine/impl/RequestControlContextImpl.java index b6dd1dba..38286fde 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/engine/impl/RequestControlContextImpl.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/engine/impl/RequestControlContextImpl.java @@ -64,12 +64,12 @@ class RequestControlContextImpl implements RequestControlContext { /** * The request scope data map. Never null, initially empty. */ - private LocalAttributeMap requestScope = new LocalAttributeMap(); + private LocalAttributeMap requestScope = new LocalAttributeMap<>(); /** * Holder for contextual properties describing the currently executing request; never null, initially empty. */ - private LocalAttributeMap attributes = new LocalAttributeMap(); + private LocalAttributeMap attributes = new LocalAttributeMap<>(); /** * The current event being processed by this flow; initially null. diff --git a/spring-webflow/src/main/java/org/springframework/webflow/engine/model/AbstractModel.java b/spring-webflow/src/main/java/org/springframework/webflow/engine/model/AbstractModel.java index a7c6f910..b5120e7b 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/engine/model/AbstractModel.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/engine/model/AbstractModel.java @@ -101,7 +101,7 @@ public abstract class AbstractModel implements Model { return child; } if (!addAtEnd) { - parent = new LinkedList(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 copy = new LinkedList(); + LinkedList copy = new LinkedList<>(); for (T model : list) { copy.add((T) model.createCopy()); } diff --git a/spring-webflow/src/main/java/org/springframework/webflow/engine/model/builder/xml/XmlFlowModelBuilder.java b/spring-webflow/src/main/java/org/springframework/webflow/engine/model/builder/xml/XmlFlowModelBuilder.java index b4f5e4dd..2ac69dcd 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/engine/model/builder/xml/XmlFlowModelBuilder.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/engine/model/builder/xml/XmlFlowModelBuilder.java @@ -82,7 +82,7 @@ public class XmlFlowModelBuilder implements FlowModelBuilder { private FlowModel flowModel; - private final List parentHolders = new ArrayList(4); + private final List 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 attributes = new LinkedList(); + LinkedList 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 vars = new LinkedList(); + LinkedList 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 inputs = new LinkedList(); + LinkedList 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 outputs = new LinkedList(); + LinkedList 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 actions = new LinkedList(); + LinkedList 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 states = new LinkedList(); + LinkedList 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 transitions = new LinkedList(); + LinkedList 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 exceptionHandlers = new LinkedList(); + LinkedList 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 beanImports = new LinkedList(); + LinkedList 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 ifs = new LinkedList(); + LinkedList 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 bindings = new LinkedList(); + LinkedList bindings = new LinkedList<>(); for (Element element2 : bindingElements) { bindings.add(parseBinding(element2)); } diff --git a/spring-webflow/src/main/java/org/springframework/webflow/engine/model/registry/FlowModelRegistryImpl.java b/spring-webflow/src/main/java/org/springframework/webflow/engine/model/registry/FlowModelRegistryImpl.java index 23b009c5..43b04335 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/engine/model/registry/FlowModelRegistryImpl.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/engine/model/registry/FlowModelRegistryImpl.java @@ -42,7 +42,7 @@ public class FlowModelRegistryImpl implements FlowModelRegistry, FlowModelHolder private FlowModelRegistry parent; public FlowModelRegistryImpl() { - flowModels = new TreeMap(); + flowModels = new TreeMap<>(); } // implementing FlowModelLocator diff --git a/spring-webflow/src/main/java/org/springframework/webflow/engine/support/GenericSubflowAttributeMapper.java b/spring-webflow/src/main/java/org/springframework/webflow/engine/support/GenericSubflowAttributeMapper.java index 19625627..4f793c01 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/engine/support/GenericSubflowAttributeMapper.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/engine/support/GenericSubflowAttributeMapper.java @@ -51,7 +51,7 @@ public final class GenericSubflowAttributeMapper implements SubflowAttributeMapp public MutableAttributeMap createSubflowInput(RequestContext context) { if (inputMapper != null) { - LocalAttributeMap input = new LocalAttributeMap(); + LocalAttributeMap 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(); + return new LocalAttributeMap<>(); } } @@ -77,4 +77,4 @@ public final class GenericSubflowAttributeMapper implements SubflowAttributeMapp return new ToStringCreator(this).append("inputMapper", inputMapper).append("outputMapper", outputMapper) .toString(); } -} +} diff --git a/spring-webflow/src/main/java/org/springframework/webflow/engine/support/TransitionCriteriaChain.java b/spring-webflow/src/main/java/org/springframework/webflow/engine/support/TransitionCriteriaChain.java index 90e85712..f6bda725 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/engine/support/TransitionCriteriaChain.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/engine/support/TransitionCriteriaChain.java @@ -36,7 +36,7 @@ public class TransitionCriteriaChain implements TransitionCriteria { /** * The ordered chain of TransitionCriteria objects. */ - private List criteriaChain = new LinkedList(); + private List criteriaChain = new LinkedList<>(); /** * Creates an initially empty transition criteria chain. diff --git a/spring-webflow/src/main/java/org/springframework/webflow/execution/RequestContextHolder.java b/spring-webflow/src/main/java/org/springframework/webflow/execution/RequestContextHolder.java index 2b10ce6c..a342333c 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/execution/RequestContextHolder.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/execution/RequestContextHolder.java @@ -30,7 +30,7 @@ import org.springframework.core.NamedThreadLocal; */ public class RequestContextHolder { - private static final ThreadLocal requestContextHolder = new NamedThreadLocal( + private static final ThreadLocal requestContextHolder = new NamedThreadLocal<>( "Flow RequestContext"); /** diff --git a/spring-webflow/src/main/java/org/springframework/webflow/execution/factory/ConditionalFlowExecutionListenerHolder.java b/spring-webflow/src/main/java/org/springframework/webflow/execution/factory/ConditionalFlowExecutionListenerHolder.java index dd886af8..775afe29 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/execution/factory/ConditionalFlowExecutionListenerHolder.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/execution/factory/ConditionalFlowExecutionListenerHolder.java @@ -41,7 +41,7 @@ class ConditionalFlowExecutionListenerHolder { /** * The listener criteria set. */ - private Set criteriaSet = new LinkedHashSet(3); + private Set criteriaSet = new LinkedHashSet<>(3); /** * Create a new conditional flow execution listener holder. diff --git a/spring-webflow/src/main/java/org/springframework/webflow/execution/factory/ConditionalFlowExecutionListenerLoader.java b/spring-webflow/src/main/java/org/springframework/webflow/execution/factory/ConditionalFlowExecutionListenerLoader.java index afad1943..a4bf27cd 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/execution/factory/ConditionalFlowExecutionListenerLoader.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/execution/factory/ConditionalFlowExecutionListenerLoader.java @@ -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 listeners = new LinkedList(); + private List 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 listenersToAttach = new LinkedList(); + List listenersToAttach = new LinkedList<>(); for (ConditionalFlowExecutionListenerHolder listenerHolder : listeners) { if (listenerHolder.listenerAppliesTo(flowDefinition)) { listenersToAttach.add(listenerHolder.getListener()); diff --git a/spring-webflow/src/main/java/org/springframework/webflow/execution/repository/impl/SimpleFlowExecutionSnapshotGroup.java b/spring-webflow/src/main/java/org/springframework/webflow/execution/repository/impl/SimpleFlowExecutionSnapshotGroup.java index dfd32d69..2baed1b6 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/execution/repository/impl/SimpleFlowExecutionSnapshotGroup.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/execution/repository/impl/SimpleFlowExecutionSnapshotGroup.java @@ -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 snapshots = new HashMap(); + private Map 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 snapshotIds = new LinkedList(); + private LinkedList 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()); } -} +} diff --git a/spring-webflow/src/main/java/org/springframework/webflow/expression/el/ImplicitFlowVariableELResolver.java b/spring-webflow/src/main/java/org/springframework/webflow/expression/el/ImplicitFlowVariableELResolver.java index c2e6af16..344f4868 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/expression/el/ImplicitFlowVariableELResolver.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/expression/el/ImplicitFlowVariableELResolver.java @@ -129,7 +129,7 @@ public class ImplicitFlowVariableELResolver extends ELResolver { } private static final class ImplicitVariables { - private static final Map vars = new HashMap(); + private static final Map vars = new HashMap<>(); private static final PropertyResolver requestContextResolver = new PropertyResolver() { protected Object doResolve(ELContext elContext, RequestContext requestContext, Object property) { diff --git a/spring-webflow/src/main/java/org/springframework/webflow/expression/el/WebFlowELExpressionParser.java b/spring-webflow/src/main/java/org/springframework/webflow/expression/el/WebFlowELExpressionParser.java index 86b6e666..5ea2cd0e 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/expression/el/WebFlowELExpressionParser.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/expression/el/WebFlowELExpressionParser.java @@ -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 customResolvers = new ArrayList(); + List customResolvers = new ArrayList<>(); customResolvers.add(new RequestContextELResolver(context)); customResolvers.add(new FlowResourceELResolver(context)); customResolvers.add(new ImplicitFlowVariableELResolver(context)); diff --git a/spring-webflow/src/main/java/org/springframework/webflow/expression/spel/FlowVariablePropertyAccessor.java b/spring-webflow/src/main/java/org/springframework/webflow/expression/spel/FlowVariablePropertyAccessor.java index f12f0231..9571e474 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/expression/spel/FlowVariablePropertyAccessor.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/expression/spel/FlowVariablePropertyAccessor.java @@ -47,7 +47,7 @@ import org.springframework.webflow.execution.RequestContextHolder; */ public class FlowVariablePropertyAccessor implements PropertyAccessor { - private static Map variables = new HashMap(); + private static Map variables = new HashMap<>(); static { variables.put("currentUser", new FlowVariableAccessor() { diff --git a/spring-webflow/src/main/java/org/springframework/webflow/mvc/servlet/FlowController.java b/spring-webflow/src/main/java/org/springframework/webflow/mvc/servlet/FlowController.java index aaced904..3ee995ad 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/mvc/servlet/FlowController.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/mvc/servlet/FlowController.java @@ -44,7 +44,7 @@ public class FlowController implements Controller, ApplicationContextAware, Init private FlowHandlerAdapter flowHandlerAdapter; - private Map flowHandlers = new HashMap(); + private Map flowHandlers = new HashMap<>(); private boolean customFlowHandlerAdapterSet; diff --git a/spring-webflow/src/main/java/org/springframework/webflow/mvc/servlet/FlowHandlerAdapter.java b/spring-webflow/src/main/java/org/springframework/webflow/mvc/servlet/FlowHandlerAdapter.java index 3f436b22..e5e94d18 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/mvc/servlet/FlowHandlerAdapter.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/mvc/servlet/FlowHandlerAdapter.java @@ -308,7 +308,7 @@ public class FlowHandlerAdapter extends WebContentGenerator implements HandlerAd if (parameterMap.size() == 0) { return null; } - LocalAttributeMap inputMap = new LocalAttributeMap(parameterMap.size(), 1); + LocalAttributeMap inputMap = new LocalAttributeMap<>(parameterMap.size(), 1); for (Map.Entry entry : parameterMap.entrySet()) { String[] values = entry.getValue(); inputMap.put(entry.getKey(), values.length == 1 ? values[0] : values); diff --git a/spring-webflow/src/main/java/org/springframework/webflow/mvc/view/AbstractMvcView.java b/spring-webflow/src/main/java/org/springframework/webflow/mvc/view/AbstractMvcView.java index 718da83f..c98814a4 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/mvc/view/AbstractMvcView.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/mvc/view/AbstractMvcView.java @@ -188,7 +188,7 @@ public abstract class AbstractMvcView implements View { } public void render() throws IOException { - Map model = new HashMap(); + Map 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 propertyNames = new ArrayList(); + List propertyNames = new ArrayList<>(); while (true) { int index = PropertyAccessorUtils.getFirstNestedPropertySeparatorIndex(expression); String nestedProperty = index != -1 ? expression.substring(0, index) : expression; diff --git a/spring-webflow/src/main/java/org/springframework/webflow/mvc/view/AjaxTiles3View.java b/spring-webflow/src/main/java/org/springframework/webflow/mvc/view/AjaxTiles3View.java index 88c018c4..2dd60991 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/mvc/view/AjaxTiles3View.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/mvc/view/AjaxTiles3View.java @@ -98,7 +98,7 @@ public class AjaxTiles3View extends TilesView { Definition compositeDefinition = container.getDefinitionsFactory().getDefinition(getUrl(), tilesRequest); - Map flattenedAttributeMap = new HashMap(); + Map 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 resultMap, Definition definition) { - Set attributeNames = new HashSet(); + Set attributeNames = new HashSet<>(); if (definition.getLocalAttributeNames() != null) { attributeNames.addAll(definition.getLocalAttributeNames()); } @@ -179,7 +179,7 @@ public class AjaxTiles3View extends TilesView { Request tilesRequest, Map resultMap) { AttributeContext attributeContext = container.getAttributeContext(tilesRequest); - Set attributeNames = new HashSet(); + Set attributeNames = new HashSet<>(); if (attributeContext.getLocalAttributeNames() != null) { attributeNames.addAll(attributeContext.getLocalAttributeNames()); } diff --git a/spring-webflow/src/main/java/org/springframework/webflow/mvc/view/BindingModel.java b/spring-webflow/src/main/java/org/springframework/webflow/mvc/view/BindingModel.java index ac12febf..d3247157 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/mvc/view/BindingModel.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/mvc/view/BindingModel.java @@ -288,7 +288,7 @@ public class BindingModel extends AbstractErrors implements BindingResult { if (messages == null || messages.length == 0) { return Collections.emptyList(); } - ArrayList errors = new ArrayList(messages.length); + ArrayList errors = new ArrayList<>(messages.length); for (Message message : messages) { T error = errorFactory.get(objectName, message); if (error != null) { diff --git a/spring-webflow/src/main/java/org/springframework/webflow/security/SecurityFlowExecutionListener.java b/spring-webflow/src/main/java/org/springframework/webflow/security/SecurityFlowExecutionListener.java index 2583e0db..f98744ed 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/security/SecurityFlowExecutionListener.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/security/SecurityFlowExecutionListener.java @@ -119,7 +119,7 @@ public class SecurityFlowExecutionListener extends FlowExecutionListenerAdapter } private AbstractAccessDecisionManager createManagerWithSpringSecurity3(SecurityRule rule) { - List voters = new ArrayList(); + List 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 getConfigAttributes(SecurityRule rule) { - List configAttributes = new ArrayList(); + List configAttributes = new ArrayList<>(); for (String attribute : rule.getAttributes()) { configAttributes.add(new SecurityConfig(attribute)); } diff --git a/spring-webflow/src/main/java/org/springframework/webflow/security/SecurityRule.java b/spring-webflow/src/main/java/org/springframework/webflow/security/SecurityRule.java index 5bd428c1..50812c36 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/security/SecurityRule.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/security/SecurityRule.java @@ -61,7 +61,7 @@ public class SecurityRule { * @return comma parsed Collection */ public static Collection commaDelimitedListToSecurityAttributes(String attributes) { - Collection attrs = new HashSet(); + Collection attrs = new HashSet<>(); for (String attribute : attributes.split(",")) { attribute = attribute.trim(); if (!"".equals(attribute)) { diff --git a/spring-webflow/src/main/java/org/springframework/webflow/test/MockExternalContext.java b/spring-webflow/src/main/java/org/springframework/webflow/test/MockExternalContext.java index 778a5073..99295e4f 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/test/MockExternalContext.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/test/MockExternalContext.java @@ -42,15 +42,15 @@ public class MockExternalContext implements ExternalContext { private ParameterMap requestParameterMap = new MockParameterMap(); - private MutableAttributeMap requestMap = new LocalAttributeMap(); + private MutableAttributeMap requestMap = new LocalAttributeMap<>(); - private SharedAttributeMap sessionMap = new LocalSharedAttributeMap( - new SharedMapDecorator(new HashMap())); + private SharedAttributeMap sessionMap = new LocalSharedAttributeMap<>( + new SharedMapDecorator<>(new HashMap<>())); private SharedAttributeMap globalSessionMap = sessionMap; - private SharedAttributeMap applicationMap = new LocalSharedAttributeMap( - new SharedMapDecorator(new HashMap())); + private SharedAttributeMap 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(); + flowDefinitionRedirectFlowInput = new LocalAttributeMap<>(); if (input != null) { flowDefinitionRedirectFlowInput.putAll(input); } diff --git a/spring-webflow/src/main/java/org/springframework/webflow/test/MockFlowExecutionContext.java b/spring-webflow/src/main/java/org/springframework/webflow/test/MockFlowExecutionContext.java index 1173ba19..f72a22ad 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/test/MockFlowExecutionContext.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/test/MockFlowExecutionContext.java @@ -42,11 +42,11 @@ public class MockFlowExecutionContext implements FlowExecutionContext { private FlowSession activeSession; - private MutableAttributeMap flashScope = new LocalAttributeMap(); + private MutableAttributeMap flashScope = new LocalAttributeMap<>(); - private MutableAttributeMap conversationScope = new LocalAttributeMap(); + private MutableAttributeMap conversationScope = new LocalAttributeMap<>(); - private MutableAttributeMap attributes = new LocalAttributeMap(); + private MutableAttributeMap attributes = new LocalAttributeMap<>(); private FlowExecutionOutcome outcome; diff --git a/spring-webflow/src/main/java/org/springframework/webflow/test/MockFlowSession.java b/spring-webflow/src/main/java/org/springframework/webflow/test/MockFlowSession.java index 1d4c2ccc..2d6739a3 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/test/MockFlowSession.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/test/MockFlowSession.java @@ -44,7 +44,7 @@ public class MockFlowSession implements FlowSession { private State state; - private MutableAttributeMap scope = new LocalAttributeMap(); + private MutableAttributeMap scope = new LocalAttributeMap<>(); private FlowSession parent; @@ -181,7 +181,7 @@ public class MockFlowSession implements FlowSession { // internal helpers private void initViewScope() { - scope.put(VIEW_MAP_ATTRIBUTE, new LocalAttributeMap()); + scope.put(VIEW_MAP_ATTRIBUTE, new LocalAttributeMap<>()); } private void destroyViewScope() { diff --git a/spring-webflow/src/main/java/org/springframework/webflow/test/MockParameterMap.java b/spring-webflow/src/main/java/org/springframework/webflow/test/MockParameterMap.java index 92b6d2ef..b2c51c9f 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/test/MockParameterMap.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/test/MockParameterMap.java @@ -36,7 +36,7 @@ public class MockParameterMap extends LocalParameterMap { * Creates a new parameter map, initially empty. */ public MockParameterMap() { - super(new HashMap()); + super(new HashMap<>()); } /** diff --git a/spring-webflow/src/main/java/org/springframework/webflow/test/MockRequestContext.java b/spring-webflow/src/main/java/org/springframework/webflow/test/MockRequestContext.java index 0be064e8..9ae29e40 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/test/MockRequestContext.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/test/MockRequestContext.java @@ -55,9 +55,9 @@ public class MockRequestContext implements RequestContext { private MessageContext messageContext; - private MutableAttributeMap requestScope = new LocalAttributeMap(); + private MutableAttributeMap requestScope = new LocalAttributeMap<>(); - private MutableAttributeMap attributes = new LocalAttributeMap(); + private MutableAttributeMap attributes = new LocalAttributeMap<>(); private Event currentEvent; diff --git a/spring-webflow/src/main/java/org/springframework/webflow/validation/WebFlowMessageCodesResolver.java b/spring-webflow/src/main/java/org/springframework/webflow/validation/WebFlowMessageCodesResolver.java index f592a2ed..94a31cd0 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/validation/WebFlowMessageCodesResolver.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/validation/WebFlowMessageCodesResolver.java @@ -82,8 +82,8 @@ public class WebFlowMessageCodesResolver implements MessageCodesResolver { * @return the list of codes */ public String[] resolveMessageCodes(String errorCode, String objectName, String field, Class fieldType) { - List codeList = new ArrayList(); - List fieldList = new ArrayList(); + List codeList = new ArrayList<>(); + List fieldList = new ArrayList<>(); buildFieldList(field, fieldList); for (String fieldInList : fieldList) { codeList.add(postProcessMessageCode(objectName + CODE_SEPARATOR + fieldInList + CODE_SEPARATOR + errorCode)); diff --git a/spring-webflow/src/main/resources/org/springframework/webflow/upgrade/spring-webflow-1.0-to-2.0.xsl b/spring-webflow/src/main/resources/org/springframework/webflow/upgrade/spring-webflow-1.0-to-2.0.xsl index 7830baab..ed21cad3 100644 --- a/spring-webflow/src/main/resources/org/springframework/webflow/upgrade/spring-webflow-1.0-to-2.0.xsl +++ b/spring-webflow/src/main/resources/org/springframework/webflow/upgrade/spring-webflow-1.0-to-2.0.xsl @@ -134,7 +134,7 @@ . - ( + <>( diff --git a/spring-webflow/src/test/java/org/springframework/webflow/TestBean.java b/spring-webflow/src/test/java/org/springframework/webflow/TestBean.java index b3a228e2..909da881 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/TestBean.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/TestBean.java @@ -53,7 +53,7 @@ public class TestBean implements Serializable { public Map getEmptyMap() { if (emptyMap == null) { - emptyMap = new HashMap(); + emptyMap = new HashMap<>(); emptyMap.put("foo", null); } return emptyMap; diff --git a/spring-webflow/src/test/java/org/springframework/webflow/action/AbstractActionTests.java b/spring-webflow/src/test/java/org/springframework/webflow/action/AbstractActionTests.java index 60d4ffbb..972acd12 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/action/AbstractActionTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/action/AbstractActionTests.java @@ -158,7 +158,7 @@ public class AbstractActionTests extends TestCase { } public void testCustomResultCollection() { - LocalAttributeMap collection = new LocalAttributeMap(); + LocalAttributeMap collection = new LocalAttributeMap<>(); collection.put("result", "value"); Event event = action.result("custom", collection); assertEquals("custom", event.getId()); diff --git a/spring-webflow/src/test/java/org/springframework/webflow/action/CompositeActionTests.java b/spring-webflow/src/test/java/org/springframework/webflow/action/CompositeActionTests.java index 886fdff0..59f159a6 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/action/CompositeActionTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/action/CompositeActionTests.java @@ -44,7 +44,7 @@ public class CompositeActionTests extends TestCase { public void testDoExecute() throws Exception { MockRequestContext mockRequestContext = new MockRequestContext(); - LocalAttributeMap attributes = new LocalAttributeMap(); + LocalAttributeMap attributes = new LocalAttributeMap<>(); attributes.put("some key", "some value"); EasyMock.expect(actionMock.execute(mockRequestContext)).andReturn(new Event(this, "some event", attributes)); EasyMock.replay(new Object[] { actionMock }); diff --git a/spring-webflow/src/test/java/org/springframework/webflow/config/FlowDefinitionRegistryJavaConfigTests.java b/spring-webflow/src/test/java/org/springframework/webflow/config/FlowDefinitionRegistryJavaConfigTests.java index 960738b5..ececa5fe 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/config/FlowDefinitionRegistryJavaConfigTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/config/FlowDefinitionRegistryJavaConfigTests.java @@ -20,7 +20,7 @@ public class FlowDefinitionRegistryJavaConfigTests extends AbstractFlowRegistryC @Bean public FlowDefinitionRegistry flowRegistry() { - Map flowAttributes = new HashMap(); + Map flowAttributes = new HashMap<>(); flowAttributes.put("foo", "bar"); flowAttributes.put("bar", 2); diff --git a/spring-webflow/src/test/java/org/springframework/webflow/config/FlowExecutorFactoryBeanTests.java b/spring-webflow/src/test/java/org/springframework/webflow/config/FlowExecutorFactoryBeanTests.java index 3535fea4..d3b23170 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/config/FlowExecutorFactoryBeanTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/config/FlowExecutorFactoryBeanTests.java @@ -60,7 +60,7 @@ public class FlowExecutorFactoryBeanTests extends TestCase { return flow; } }); - Set attributes = new HashSet(); + Set attributes = new HashSet<>(); attributes.add(new FlowElementAttribute("foo", "bar", null)); factoryBean.setFlowExecutionAttributes(attributes); FlowExecutionListener listener = new FlowExecutionListenerAdapter() { diff --git a/spring-webflow/src/test/java/org/springframework/webflow/config/FlowRegistryFactoryBeanTests.java b/spring-webflow/src/test/java/org/springframework/webflow/config/FlowRegistryFactoryBeanTests.java index ff1cd413..a7c86a91 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/config/FlowRegistryFactoryBeanTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/config/FlowRegistryFactoryBeanTests.java @@ -20,7 +20,7 @@ public class FlowRegistryFactoryBeanTests extends TestCase { } public void testGetFlowRegistry() throws Exception { - HashSet attributes = new HashSet(); + HashSet attributes = new HashSet<>(); attributes.add(new FlowElementAttribute("foo", "bar", null)); attributes.add(new FlowElementAttribute("bar", "2", "integer")); FlowLocation location1 = new FlowLocation("flow1", "org/springframework/webflow/config/flow.xml", attributes); diff --git a/spring-webflow/src/test/java/org/springframework/webflow/context/servlet/DefaultFlowUrlHandlerTests.java b/spring-webflow/src/test/java/org/springframework/webflow/context/servlet/DefaultFlowUrlHandlerTests.java index a0a03b47..209f62d6 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/context/servlet/DefaultFlowUrlHandlerTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/context/servlet/DefaultFlowUrlHandlerTests.java @@ -82,7 +82,7 @@ public class DefaultFlowUrlHandlerTests extends TestCase { request.setServletPath("/app"); request.setPathInfo("/foo"); request.setRequestURI("/springtravel/app/foo"); - LocalAttributeMap input = new LocalAttributeMap(new LinkedHashMap()); + LocalAttributeMap input = new LocalAttributeMap<>(new LinkedHashMap<>()); input.put("foo", "bar"); input.put("bar", "needs encoding"); input.put("baz", 1); diff --git a/spring-webflow/src/test/java/org/springframework/webflow/context/servlet/HttpServletContextMapTests.java b/spring-webflow/src/test/java/org/springframework/webflow/context/servlet/HttpServletContextMapTests.java index 7d1ee875..3faff86b 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/context/servlet/HttpServletContextMapTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/context/servlet/HttpServletContextMapTests.java @@ -92,7 +92,7 @@ public class HttpServletContextMapTests extends TestCase { } public void testPutAll() { - Map otherMap = new HashMap(); + Map otherMap = new HashMap<>(); otherMap.put("SomeOtherKey", "SomeOtherValue"); otherMap.put("SomeKey", "SomeUpdatedValue"); tested.putAll(otherMap); diff --git a/spring-webflow/src/test/java/org/springframework/webflow/context/servlet/ServletExternalContextTests.java b/spring-webflow/src/test/java/org/springframework/webflow/context/servlet/ServletExternalContextTests.java index 9f7136ad..92ad18e5 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/context/servlet/ServletExternalContextTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/context/servlet/ServletExternalContextTests.java @@ -111,7 +111,7 @@ public class ServletExternalContextTests extends TestCase { } public void testCommitFlowRedirectWithInput() { - LocalAttributeMap input = new LocalAttributeMap(); + LocalAttributeMap input = new LocalAttributeMap<>(); context.requestFlowDefinitionRedirect("foo", input); assertTrue(context.getFlowDefinitionRedirectRequested()); assertEquals("foo", context.getFlowRedirectFlowId()); diff --git a/spring-webflow/src/test/java/org/springframework/webflow/context/servlet/WebFlow1FlowUrlHandlerTests.java b/spring-webflow/src/test/java/org/springframework/webflow/context/servlet/WebFlow1FlowUrlHandlerTests.java index ee9b5ce9..07debafa 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/context/servlet/WebFlow1FlowUrlHandlerTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/context/servlet/WebFlow1FlowUrlHandlerTests.java @@ -36,7 +36,7 @@ public class WebFlow1FlowUrlHandlerTests extends TestCase { public void testCreateFlowDefinitionUrlWithFlowInput() { request.setRequestURI("/springtravel/app/flows"); - LocalAttributeMap input = new LocalAttributeMap(new LinkedHashMap()); + LocalAttributeMap input = new LocalAttributeMap<>(new LinkedHashMap<>()); input.put("foo", "bar"); input.put("bar", "needs encoding"); input.put("baz", 1); diff --git a/spring-webflow/src/test/java/org/springframework/webflow/core/collection/LocalAttributeMapTests.java b/spring-webflow/src/test/java/org/springframework/webflow/core/collection/LocalAttributeMapTests.java index 9ae3b4ce..01e77637 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/core/collection/LocalAttributeMapTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/core/collection/LocalAttributeMapTests.java @@ -27,7 +27,7 @@ import junit.framework.TestCase; */ public class LocalAttributeMapTests extends TestCase { - private LocalAttributeMap attributeMap = new LocalAttributeMap(); + private LocalAttributeMap attributeMap = new LocalAttributeMap<>(); public void setUp() { attributeMap.put("string", "A string"); @@ -39,7 +39,7 @@ public class LocalAttributeMapTests extends TestCase { attributeMap.put("bigDecimal", new BigDecimal("12345.67")); attributeMap.put("bean", new TestBean()); attributeMap.put("stringArray", new String[] { "1", "2", "3" }); - attributeMap.put("collection", new LinkedList()); + attributeMap.put("collection", new LinkedList<>()); } public void testGet() { @@ -303,11 +303,11 @@ public class LocalAttributeMapTests extends TestCase { } public void testUnion() { - LocalAttributeMap one = new LocalAttributeMap(); + LocalAttributeMap one = new LocalAttributeMap<>(); one.put("foo", "bar"); one.put("bar", "baz"); - LocalAttributeMap two = new LocalAttributeMap(); + LocalAttributeMap two = new LocalAttributeMap<>(); two.put("cat", "coz"); two.put("bar", "boo"); @@ -319,10 +319,10 @@ public class LocalAttributeMapTests extends TestCase { } public void testEquality() { - LocalAttributeMap map = new LocalAttributeMap(); + LocalAttributeMap map = new LocalAttributeMap<>(); map.put("foo", "bar"); - LocalAttributeMap map2 = new LocalAttributeMap(); + LocalAttributeMap map2 = new LocalAttributeMap<>(); map2.put("foo", "bar"); assertEquals(map, map2); diff --git a/spring-webflow/src/test/java/org/springframework/webflow/core/collection/LocalParameterMapTests.java b/spring-webflow/src/test/java/org/springframework/webflow/core/collection/LocalParameterMapTests.java index 4d58c1d0..e5b1d707 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/core/collection/LocalParameterMapTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/core/collection/LocalParameterMapTests.java @@ -31,7 +31,7 @@ public class LocalParameterMapTests extends TestCase { private LocalParameterMap parameterMap; public void setUp() { - Map map = new HashMap(); + Map map = new HashMap<>(); map.put("string", "A string"); map.put("integer", "12345"); map.put("boolean", "true"); @@ -241,7 +241,7 @@ public class LocalParameterMapTests extends TestCase { } public void testEquality() { - LocalParameterMap map1 = new LocalParameterMap(new HashMap(parameterMap.asMap())); + LocalParameterMap map1 = new LocalParameterMap(new HashMap<>(parameterMap.asMap())); assertEquals(parameterMap, map1); } diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/EventTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/EventTests.java index 956d46c8..574afd55 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/EventTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/EventTests.java @@ -53,7 +53,7 @@ public class EventTests extends TestCase { } public void testNewEventWithAttributes() { - LocalAttributeMap attrs = new LocalAttributeMap(); + LocalAttributeMap attrs = new LocalAttributeMap<>(); attrs.put("name", "value"); Event event = new Event(this, "id", attrs); assertTrue(!event.getAttributes().isEmpty()); diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/FlowTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/FlowTests.java index f2a63479..382e88a2 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/FlowTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/FlowTests.java @@ -170,7 +170,7 @@ public class FlowTests extends TestCase { public void testStart() { MockRequestControlContext context = new MockRequestControlContext(flow); - flow.start(context, new LocalAttributeMap()); + flow.start(context, new LocalAttributeMap<>()); assertEquals("Wrong start state", "myState1", context.getCurrentState().getId()); } @@ -189,7 +189,7 @@ public class FlowTests extends TestCase { MockRequestControlContext context = new MockRequestControlContext(flow); TestAction action = new TestAction(); flow.getStartActionList().add(action); - flow.start(context, new LocalAttributeMap()); + flow.start(context, new LocalAttributeMap<>()); assertEquals("Wrong start state", "myState1", context.getCurrentState().getId()); assertEquals(1, action.getExecutionCount()); } @@ -198,13 +198,13 @@ public class FlowTests extends TestCase { MockRequestControlContext context = new MockRequestControlContext(flow); flow.addVariable(new FlowVariable("var1", new VariableValueFactory() { public Object createInitialValue(RequestContext context) { - return new ArrayList(); + return new ArrayList<>(); } public void restoreReferences(Object value, RequestContext context) { } })); - flow.start(context, new LocalAttributeMap()); + flow.start(context, new LocalAttributeMap<>()); context.getFlowScope().getRequired("var1", ArrayList.class); } @@ -217,7 +217,7 @@ public class FlowTests extends TestCase { attributeMapper.addMapping(new DefaultMapping(x, y)); flow.setInputMapper(attributeMapper); MockRequestControlContext context = new MockRequestControlContext(flow); - LocalAttributeMap sessionInput = new LocalAttributeMap(); + LocalAttributeMap sessionInput = new LocalAttributeMap<>(); sessionInput.put("attr", "foo"); flow.start(context, sessionInput); assertEquals("foo", context.getFlowScope().get("attr")); @@ -232,7 +232,7 @@ public class FlowTests extends TestCase { attributeMapper.addMapping(new DefaultMapping(x, y)); flow.setInputMapper(attributeMapper); MockRequestControlContext context = new MockRequestControlContext(flow); - LocalAttributeMap sessionInput = new LocalAttributeMap(); + LocalAttributeMap sessionInput = new LocalAttributeMap<>(); flow.start(context, sessionInput); assertTrue(context.getFlowScope().contains("attr")); assertNull(context.getFlowScope().get("attr")); @@ -308,7 +308,7 @@ public class FlowTests extends TestCase { TestAction action = new TestAction(); flow.getEndActionList().add(action); MockRequestControlContext context = new MockRequestControlContext(flow); - LocalAttributeMap sessionOutput = new LocalAttributeMap(); + LocalAttributeMap sessionOutput = new LocalAttributeMap<>(); flow.end(context, "finish", sessionOutput); assertEquals(1, action.getExecutionCount()); } @@ -323,7 +323,7 @@ public class FlowTests extends TestCase { flow.setOutputMapper(attributeMapper); MockRequestControlContext context = new MockRequestControlContext(flow); context.getFlowScope().put("attr", "foo"); - LocalAttributeMap sessionOutput = new LocalAttributeMap(); + LocalAttributeMap sessionOutput = new LocalAttributeMap<>(); flow.end(context, "finish", sessionOutput); assertEquals("foo", sessionOutput.get("attr")); } diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/SubflowStateTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/SubflowStateTests.java index 7be5c104..b96893e9 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/SubflowStateTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/SubflowStateTests.java @@ -70,7 +70,7 @@ public class SubflowStateTests extends TestCase { public void testEnterWithInput() { subflowState.setAttributeMapper(new SubflowAttributeMapper() { public MutableAttributeMap createSubflowInput(RequestContext context) { - return new LocalAttributeMap("foo", "bar"); + return new LocalAttributeMap<>("foo", "bar"); } public void mapSubflowOutput(AttributeMap flowOutput, RequestContext context) { @@ -95,7 +95,7 @@ public class SubflowStateTests extends TestCase { public void testReturnWithOutput() { subflowState.setAttributeMapper(new SubflowAttributeMapper() { public MutableAttributeMap createSubflowInput(RequestContext context) { - return new LocalAttributeMap(); + return new LocalAttributeMap<>(); } public void mapSubflowOutput(AttributeMap flowOutput, RequestContext context) { diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/TestSubflowAttributeMapper.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/TestSubflowAttributeMapper.java index e1f7f311..96b5e8df 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/TestSubflowAttributeMapper.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/TestSubflowAttributeMapper.java @@ -22,7 +22,7 @@ import org.springframework.webflow.execution.RequestContext; class TestSubflowAttributeMapper implements SubflowAttributeMapper { public MutableAttributeMap createSubflowInput(RequestContext context) { - LocalAttributeMap inputMap = new LocalAttributeMap(); + LocalAttributeMap inputMap = new LocalAttributeMap<>(); inputMap.put("childInputAttribute", context.getFlowScope().get("parentInputAttribute")); return inputMap; } diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/builder/model/FlowModelFlowBuilderTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/builder/model/FlowModelFlowBuilderTests.java index 5350046f..61a81daf 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/builder/model/FlowModelFlowBuilderTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/builder/model/FlowModelFlowBuilderTests.java @@ -68,7 +68,7 @@ public class FlowModelFlowBuilderTests extends TestCase { } private LinkedList asList(Class elementClass, T... a) { - return new LinkedList(Arrays.asList(a)); + return new LinkedList<>(Arrays.asList(a)); } public void testBuildFlowWithEndState() { @@ -143,7 +143,7 @@ public class FlowModelFlowBuilderTests extends TestCase { FlowExecutionImplFactory factory = new FlowExecutionImplFactory(); FlowExecution execution = factory.createFlowExecution(flow); MockExternalContext context = new MockExternalContext(); - MutableAttributeMap map = new LocalAttributeMap(); + MutableAttributeMap map = new LocalAttributeMap<>(); map.put("foo", "bar"); map.put("number", "3"); map.put("required", "9"); diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/impl/FlowExecutionImplFactoryTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/impl/FlowExecutionImplFactoryTests.java index cc91eb76..da3acbe6 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/impl/FlowExecutionImplFactoryTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/impl/FlowExecutionImplFactoryTests.java @@ -80,7 +80,7 @@ public class FlowExecutionImplFactoryTests extends TestCase { } public void testCreateWithExecutionAttributes() { - MutableAttributeMap attributes = new LocalAttributeMap(); + MutableAttributeMap attributes = new LocalAttributeMap<>(); attributes.put("foo", "bar"); factory.setExecutionAttributes(attributes); FlowExecution execution = factory.createFlowExecution(flowDefinition); @@ -123,7 +123,7 @@ public class FlowExecutionImplFactoryTests extends TestCase { public void testRestoreExecutionState() { FlowExecutionImpl flowExecution = (FlowExecutionImpl) factory.createFlowExecution(flowDefinition); - LocalAttributeMap executionAttributes = new LocalAttributeMap(); + LocalAttributeMap executionAttributes = new LocalAttributeMap<>(); factory.setExecutionAttributes(executionAttributes); FlowExecutionListener listener = new FlowExecutionListenerAdapter() { }; @@ -131,7 +131,7 @@ public class FlowExecutionImplFactoryTests extends TestCase { MockFlowExecutionKeyFactory keyFactory = new MockFlowExecutionKeyFactory(); factory.setExecutionKeyFactory(keyFactory); FlowExecutionKey flowExecutionKey = new MockFlowExecutionKey("e1s1"); - LocalAttributeMap conversationScope = new LocalAttributeMap(); + LocalAttributeMap conversationScope = new LocalAttributeMap<>(); SimpleFlowDefinitionLocator locator = new SimpleFlowDefinitionLocator(); FlowSessionImpl session1 = new FlowSessionImpl(); session1.setFlowId("flow"); @@ -192,4 +192,4 @@ public class FlowExecutionImplFactoryTests extends TestCase { } } } -} +} diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/model/AbstractModelTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/model/AbstractModelTests.java index bf27a5b5..0006c433 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/model/AbstractModelTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/model/AbstractModelTests.java @@ -70,10 +70,10 @@ public class AbstractModelTests extends TestCase { } public void testListMergeAddAtEndFalse() { - LinkedList child = new LinkedList(); + LinkedList child = new LinkedList<>(); child.add(new SecuredModel("1")); child.add(new SecuredModel("3")); - LinkedList parent = new LinkedList(); + LinkedList parent = new LinkedList<>(); parent.add(new SecuredModel("2")); SecuredModel match = new SecuredModel("3"); match.setMatch("foo"); @@ -89,10 +89,10 @@ public class AbstractModelTests extends TestCase { } public void testListMergeAddAtEndTrue() { - LinkedList child = new LinkedList(); + LinkedList child = new LinkedList<>(); child.add(new SecuredModel("1")); child.add(new SecuredModel("3")); - LinkedList parent = new LinkedList(); + LinkedList parent = new LinkedList<>(); parent.add(new SecuredModel("2")); SecuredModel match = new SecuredModel("3"); match.setMatch("foo"); @@ -109,7 +109,7 @@ public class AbstractModelTests extends TestCase { public void testListMergeNullParent() { AbstractModel obj = new PersistenceContextModel(); - LinkedList child = new LinkedList(); + LinkedList child = new LinkedList<>(); child.add(new SecuredModel("1")); LinkedList parent = null; LinkedList result = obj.merge(child, parent); @@ -119,7 +119,7 @@ public class AbstractModelTests extends TestCase { public void testListMergeNullChild() { LinkedList child = null; - LinkedList parent = new LinkedList(); + LinkedList parent = new LinkedList<>(); parent.add(new SecuredModel("2")); AbstractModel obj = new PersistenceContextModel(); LinkedList result = obj.merge(child, parent); diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/model/ActionStateModelTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/model/ActionStateModelTests.java index 419dce2d..dc4d2193 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/model/ActionStateModelTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/model/ActionStateModelTests.java @@ -44,7 +44,7 @@ public class ActionStateModelTests extends TestCase { ActionStateModel child = new ActionStateModel("child"); ActionStateModel parent = new ActionStateModel("parent"); - LinkedList actions = new LinkedList(); + LinkedList actions = new LinkedList<>(); EvaluateModel eval = new EvaluateModel("foo.bar"); actions.add(eval); parent.setActions(actions); diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/model/DecisionStateModelTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/model/DecisionStateModelTests.java index 432f1250..3c224d6e 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/model/DecisionStateModelTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/model/DecisionStateModelTests.java @@ -45,7 +45,7 @@ public class DecisionStateModelTests extends TestCase { DecisionStateModel parent = new DecisionStateModel("child"); parent.setSecured(new SecuredModel("secured")); - LinkedList ifs = new LinkedList(); + LinkedList ifs = new LinkedList<>(); ifs.add(new IfModel("test", "foo")); parent.setIfs(ifs); diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/model/EndStateModelTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/model/EndStateModelTests.java index ac95519c..be9d8d01 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/model/EndStateModelTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/model/EndStateModelTests.java @@ -46,7 +46,7 @@ public class EndStateModelTests extends TestCase { parent.setCommit("true"); parent.setView("view"); - LinkedList outputs = new LinkedList(); + LinkedList outputs = new LinkedList<>(); outputs.add(new OutputModel("foo", "bar")); parent.setOutputs(outputs); diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/model/FlowModelTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/model/FlowModelTests.java index a8eecb4a..3fdf8a9d 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/model/FlowModelTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/model/FlowModelTests.java @@ -207,7 +207,7 @@ public class FlowModelTests extends TestCase { } private LinkedList asList(Class elementClass, T... a) { - return new LinkedList(Arrays.asList(a)); + return new LinkedList<>(Arrays.asList(a)); } } diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/model/ViewStateModelTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/model/ViewStateModelTests.java index ea1f9055..6ebeefec 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/model/ViewStateModelTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/model/ViewStateModelTests.java @@ -44,12 +44,12 @@ public class ViewStateModelTests extends TestCase { ViewStateModel child = new ViewStateModel("child"); ViewStateModel parent = new ViewStateModel("parent"); - LinkedList attributes = new LinkedList(); + LinkedList attributes = new LinkedList<>(); attributes.add(new AttributeModel("foo", "bar")); parent.setAttributes(attributes); BinderModel binder = new BinderModel(); - LinkedList bindings = new LinkedList(); + LinkedList bindings = new LinkedList<>(); bindings.add(new BindingModel("foo", "fooConverter", "true")); binder.setBindings(bindings); parent.setBinder(binder); @@ -62,7 +62,7 @@ public class ViewStateModelTests extends TestCase { parent.setValidationHints("foo"); parent.setView("fooView"); - LinkedList transitions = new LinkedList(); + LinkedList transitions = new LinkedList<>(); TransitionModel tx = new TransitionModel(); tx.setOn("submit"); tx.setTo("bar"); @@ -70,17 +70,17 @@ public class ViewStateModelTests extends TestCase { parent.setTransitions(transitions); EvaluateModel eval = new EvaluateModel("foo.bar"); - LinkedList actions = new LinkedList(); + LinkedList actions = new LinkedList<>(); actions.add(eval); parent.setOnEntryActions(actions); parent.setOnExitActions(actions); parent.setOnRenderActions(actions); - LinkedList vars = new LinkedList(); + LinkedList vars = new LinkedList<>(); vars.add(new VarModel("foo", "class")); parent.setVars(vars); - LinkedList eh = new LinkedList(); + LinkedList eh = new LinkedList<>(); eh.add(new ExceptionHandlerModel("foo")); parent.setExceptionHandlers(eh); diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/model/registry/DefaultFlowModelHolderTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/model/registry/DefaultFlowModelHolderTests.java index a9b457dd..42ebeb1d 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/model/registry/DefaultFlowModelHolderTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/model/registry/DefaultFlowModelHolderTests.java @@ -40,7 +40,7 @@ public class DefaultFlowModelHolderTests extends TestCase { public FlowModel getFlowModel() throws FlowModelBuilderException { FlowModel flow = new FlowModel(); - flow.setStates(new LinkedList(Collections.singletonList(new EndStateModel("end")))); + flow.setStates(new LinkedList<>(Collections.singletonList(new EndStateModel("end")))); return flow; } diff --git a/spring-webflow/src/test/java/org/springframework/webflow/execution/repository/impl/DefaultFlowExecutionRepositoryTests.java b/spring-webflow/src/test/java/org/springframework/webflow/execution/repository/impl/DefaultFlowExecutionRepositoryTests.java index a97aae3d..791e7847 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/execution/repository/impl/DefaultFlowExecutionRepositoryTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/execution/repository/impl/DefaultFlowExecutionRepositoryTests.java @@ -270,7 +270,7 @@ public class DefaultFlowExecutionRepositoryTests extends TestCase { private boolean ended; - private Map attributes = new HashMap(); + private Map attributes = new HashMap<>(); public boolean hasEnded() { return ended; diff --git a/spring-webflow/src/test/java/org/springframework/webflow/executor/FlowExecutorImplTests.java b/spring-webflow/src/test/java/org/springframework/webflow/executor/FlowExecutorImplTests.java index 3bb01376..ad1fd45c 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/executor/FlowExecutorImplTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/executor/FlowExecutorImplTests.java @@ -163,7 +163,7 @@ public class FlowExecutorImplTests extends TestCase { EasyMock.expect(execution.getDefinition()).andReturn(definition); EasyMock.expect(definition.getId()).andReturn("foo"); - LocalAttributeMap output = new LocalAttributeMap(); + LocalAttributeMap output = new LocalAttributeMap<>(); output.put("foo", "bar"); EasyMock.expect(execution.getOutcome()).andReturn(new FlowExecutionOutcome("finish", output)); diff --git a/spring-webflow/src/test/java/org/springframework/webflow/expression/el/FlowResourceELResolverTests.java b/spring-webflow/src/test/java/org/springframework/webflow/expression/el/FlowResourceELResolverTests.java index af049d5a..e521850d 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/expression/el/FlowResourceELResolverTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/expression/el/FlowResourceELResolverTests.java @@ -121,7 +121,7 @@ public class FlowResourceELResolverTests extends FlowDependentELResolverTestCase } protected List getCustomResolvers() { - List resolvers = new ArrayList(); + List resolvers = new ArrayList<>(); resolvers.add(new FlowResourceELResolver()); return resolvers; } diff --git a/spring-webflow/src/test/java/org/springframework/webflow/expression/el/ImplicitFlowVariableELResolverTests.java b/spring-webflow/src/test/java/org/springframework/webflow/expression/el/ImplicitFlowVariableELResolverTests.java index 6756807b..5f86fa14 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/expression/el/ImplicitFlowVariableELResolverTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/expression/el/ImplicitFlowVariableELResolverTests.java @@ -23,7 +23,7 @@ import org.springframework.webflow.test.MockRequestContext; public class ImplicitFlowVariableELResolverTests extends FlowDependentELResolverTestCase { - private static final List vars = new ArrayList(); + private static final List vars = new ArrayList<>(); { vars.add("requestParameters"); vars.add("requestScope"); @@ -256,7 +256,7 @@ public class ImplicitFlowVariableELResolverTests extends FlowDependentELResolver } protected List getCustomResolvers() { - List resolvers = new ArrayList(); + List resolvers = new ArrayList<>(); resolvers.add(new ImplicitFlowVariableELResolver()); return resolvers; } diff --git a/spring-webflow/src/test/java/org/springframework/webflow/expression/el/ScopeSearchingELResolverTests.java b/spring-webflow/src/test/java/org/springframework/webflow/expression/el/ScopeSearchingELResolverTests.java index 5dca7b22..414c40aa 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/expression/el/ScopeSearchingELResolverTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/expression/el/ScopeSearchingELResolverTests.java @@ -229,7 +229,7 @@ public class ScopeSearchingELResolverTests extends FlowDependentELResolverTestCa } protected List getCustomResolvers() { - List resolvers = new ArrayList(); + List resolvers = new ArrayList<>(); resolvers.add(new ScopeSearchingELResolver()); return resolvers; } diff --git a/spring-webflow/src/test/java/org/springframework/webflow/expression/el/WebFlowELExpressionParserTests.java b/spring-webflow/src/test/java/org/springframework/webflow/expression/el/WebFlowELExpressionParserTests.java index ae7ee496..007fec20 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/expression/el/WebFlowELExpressionParserTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/expression/el/WebFlowELExpressionParserTests.java @@ -27,7 +27,7 @@ public class WebFlowELExpressionParserTests extends TestCase { private WebFlowELExpressionParser parser = new WebFlowELExpressionParser(new ExpressionFactoryImpl()); public void testResolveMap() { - LocalAttributeMap map = new LocalAttributeMap(); + LocalAttributeMap map = new LocalAttributeMap<>(); map.put("foo", "bar"); Expression exp = parser.parseExpression("foo", new FluentParserContext().evaluate(AttributeMap.class)); Expression exp2 = parser.parseExpression("bogus", new FluentParserContext().evaluate(AttributeMap.class)); @@ -36,7 +36,7 @@ public class WebFlowELExpressionParserTests extends TestCase { } public void testSetMap() { - LocalAttributeMap map = new LocalAttributeMap(); + LocalAttributeMap map = new LocalAttributeMap<>(); map.put("foo", "bar"); Expression exp = parser.parseExpression("foo", new FluentParserContext().evaluate(MutableAttributeMap.class)); Expression exp2 = parser @@ -173,7 +173,7 @@ public class WebFlowELExpressionParserTests extends TestCase { public void testResolveEventAttributes() { MockRequestContext context = new MockRequestContext(); - LocalAttributeMap attributes = new LocalAttributeMap(); + LocalAttributeMap attributes = new LocalAttributeMap<>(); attributes.put("foo", "bar"); context.setCurrentEvent(new Event(this, "event", attributes)); Expression exp = parser.parseExpression("currentEvent.attributes.foo", diff --git a/spring-webflow/src/test/java/org/springframework/webflow/mvc/servlet/FlowControllerTests.java b/spring-webflow/src/test/java/org/springframework/webflow/mvc/servlet/FlowControllerTests.java index 4d2cb2cf..2f605bd8 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/mvc/servlet/FlowControllerTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/mvc/servlet/FlowControllerTests.java @@ -80,7 +80,7 @@ public class FlowControllerTests extends TestCase { request.setRequestURI("/springtravel/app/foo"); request.setMethod("GET"); executor.launchExecution("foo", null, context); - LocalAttributeMap output = new LocalAttributeMap(); + LocalAttributeMap output = new LocalAttributeMap<>(); output.put("bar", "baz"); FlowExecutionOutcome outcome = new FlowExecutionOutcome("finish", output); FlowExecutionResult result = FlowExecutionResult.createEndedResult("foo", outcome); @@ -99,7 +99,7 @@ public class FlowControllerTests extends TestCase { request.setRequestURI("/springtravel/app/foo"); request.setMethod("POST"); request.addParameter("execution", "12345"); - Map parameters = new HashMap(); + Map parameters = new HashMap<>(); request.setParameters(parameters); executor.resumeExecution("12345", context); FlowExecutionResult result = FlowExecutionResult.createPausedResult("foo", "123456"); @@ -117,10 +117,10 @@ public class FlowControllerTests extends TestCase { request.setRequestURI("/springtravel/app/foo"); request.setMethod("POST"); request.addParameter("execution", "12345"); - Map parameters = new HashMap(); + Map parameters = new HashMap<>(); request.setParameters(parameters); executor.resumeExecution("12345", context); - LocalAttributeMap output = new LocalAttributeMap(); + LocalAttributeMap output = new LocalAttributeMap<>(); output.put("bar", "baz"); FlowExecutionOutcome outcome = new FlowExecutionOutcome("finish", output); FlowExecutionResult result = FlowExecutionResult.createEndedResult("foo", outcome); @@ -181,7 +181,7 @@ public class FlowControllerTests extends TestCase { request.addParameter("ajaxSource", "this"); context.setAjaxRequest(true); context.requestFlowExecutionRedirect(); - LocalAttributeMap inputMap = new LocalAttributeMap(); + LocalAttributeMap inputMap = new LocalAttributeMap<>(); inputMap.put("ajaxSource", "this"); executor.launchExecution("foo", inputMap, context); FlowExecutionResult result = FlowExecutionResult.createPausedResult("foo", "12345"); @@ -202,11 +202,11 @@ public class FlowControllerTests extends TestCase { request.setPathInfo("/foo"); request.setRequestURI("/springtravel/app/foo"); request.setMethod("GET"); - LocalAttributeMap input = new LocalAttributeMap(); + LocalAttributeMap input = new LocalAttributeMap<>(); input.put("baz", "boop"); context.requestFlowDefinitionRedirect("bar", input); executor.launchExecution("foo", null, context); - LocalAttributeMap output = new LocalAttributeMap(); + LocalAttributeMap output = new LocalAttributeMap<>(); output.put("bar", "baz"); FlowExecutionOutcome outcome = new FlowExecutionOutcome("finish", output); FlowExecutionResult result = FlowExecutionResult.createEndedResult("foo", outcome); @@ -275,7 +275,7 @@ public class FlowControllerTests extends TestCase { } public void testLaunchFlowWithCustomFlowHandler() throws Exception { - final LocalAttributeMap input = new LocalAttributeMap(); + final LocalAttributeMap input = new LocalAttributeMap<>(); input.put("bar", "boop"); controller.registerFlowHandler(new FlowHandler() { public String getFlowId() { @@ -310,7 +310,7 @@ public class FlowControllerTests extends TestCase { } public void testHandleFlowOutcomeCustomFlowHandler() throws Exception { - final LocalAttributeMap input = new LocalAttributeMap(); + final LocalAttributeMap input = new LocalAttributeMap<>(); input.put("bar", "boop"); controller.registerFlowHandler(new FlowHandler() { public String getFlowId() { @@ -340,7 +340,7 @@ public class FlowControllerTests extends TestCase { request.setRequestURI("/springtravel/app/foo"); request.setMethod("GET"); executor.launchExecution("foo", input, context); - LocalAttributeMap output = new LocalAttributeMap(); + LocalAttributeMap output = new LocalAttributeMap<>(); output.put("bar", "baz"); FlowExecutionOutcome outcome = new FlowExecutionOutcome("finish", output); FlowExecutionResult result = FlowExecutionResult.createEndedResult("foo", outcome); diff --git a/spring-webflow/src/test/java/org/springframework/webflow/mvc/servlet/FlowHandlerAdapterTests.java b/spring-webflow/src/test/java/org/springframework/webflow/mvc/servlet/FlowHandlerAdapterTests.java index 421ec50f..840c055c 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/mvc/servlet/FlowHandlerAdapterTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/mvc/servlet/FlowHandlerAdapterTests.java @@ -34,7 +34,7 @@ public class FlowHandlerAdapterTests extends TestCase { private MockHttpServletResponse response; private ServletExternalContext context; private FlowHandler flowHandler; - private LocalAttributeMap flowInput = new LocalAttributeMap(); + private LocalAttributeMap flowInput = new LocalAttributeMap<>(); private boolean handleException; private boolean handleExecutionOutcome; private MockFlashMapManager flashMapManager = new MockFlashMapManager(); @@ -99,10 +99,10 @@ public class FlowHandlerAdapterTests extends TestCase { public void testLaunchFlowRequestEndsAfterProcessing() throws Exception { setupRequest("/springtravel", "/app", "/whatever", "GET"); - Map parameters = new HashMap(); + Map parameters = new HashMap<>(); request.setParameters(parameters); flowExecutor.launchExecution("foo", flowInput, context); - LocalAttributeMap output = new LocalAttributeMap(); + LocalAttributeMap output = new LocalAttributeMap<>(); output.put("bar", "baz"); FlowExecutionOutcome outcome = new FlowExecutionOutcome("finish", output); FlowExecutionResult result = FlowExecutionResult.createEndedResult("foo", outcome); @@ -115,11 +115,11 @@ public class FlowHandlerAdapterTests extends TestCase { public void testLaunchFlowRequestEndsAfterProcessingAjaxRequest() throws Exception { setupRequest("/springtravel", "/app", "/whatever", "GET"); - Map parameters = new HashMap(); + Map parameters = new HashMap<>(); request.setParameters(parameters); context.setAjaxRequest(true); flowExecutor.launchExecution("foo", flowInput, context); - LocalAttributeMap output = new LocalAttributeMap(); + LocalAttributeMap output = new LocalAttributeMap<>(); output.put("bar", "baz"); FlowExecutionOutcome outcome = new FlowExecutionOutcome("finish", output); FlowExecutionResult result = FlowExecutionResult.createEndedResult("foo", outcome); @@ -145,10 +145,10 @@ public class FlowHandlerAdapterTests extends TestCase { public void testResumeFlowRequestEndsAfterProcessing() throws Exception { setupRequest("/springtravel", "/app", "/foo", "POST"); request.addParameter("execution", "12345"); - Map parameters = new HashMap(); + Map parameters = new HashMap<>(); request.setParameters(parameters); flowExecutor.resumeExecution("12345", context); - LocalAttributeMap output = new LocalAttributeMap(); + LocalAttributeMap output = new LocalAttributeMap<>(); output.put("bar", "baz"); FlowExecutionOutcome outcome = new FlowExecutionOutcome("finish", output); FlowExecutionResult result = FlowExecutionResult.createEndedResult("foo", outcome); @@ -163,10 +163,10 @@ public class FlowHandlerAdapterTests extends TestCase { public void testResumeFlowRequestEndsAfterProcessingFlowCommittedResponse() throws Exception { setupRequest("/springtravel", "/app", "/foo", "POST"); request.addParameter("execution", "12345"); - Map parameters = new HashMap(); + Map parameters = new HashMap<>(); request.setParameters(parameters); flowExecutor.resumeExecution("12345", context); - LocalAttributeMap output = new LocalAttributeMap(); + LocalAttributeMap output = new LocalAttributeMap<>(); output.put("bar", "baz"); context.recordResponseComplete(); FlowExecutionOutcome outcome = new FlowExecutionOutcome("finish", output); @@ -194,13 +194,13 @@ public class FlowHandlerAdapterTests extends TestCase { public void testLaunchFlowWithDefinitionRedirect() throws Exception { setupRequest("/springtravel", "/app", "/foo", "GET"); - Map parameters = new HashMap(); + Map parameters = new HashMap<>(); request.setParameters(parameters); - LocalAttributeMap input = new LocalAttributeMap(); + LocalAttributeMap input = new LocalAttributeMap<>(); input.put("baz", "boop"); context.requestFlowDefinitionRedirect("bar", input); flowExecutor.launchExecution("foo", flowInput, context); - LocalAttributeMap output = new LocalAttributeMap(); + LocalAttributeMap output = new LocalAttributeMap<>(); output.put("bar", "baz"); FlowExecutionOutcome outcome = new FlowExecutionOutcome("finish", output); FlowExecutionResult result = FlowExecutionResult.createEndedResult("foo", outcome); @@ -402,7 +402,7 @@ public class FlowHandlerAdapterTests extends TestCase { public void testDefaultHandleFlowException() throws Exception { setupRequest("/springtravel", "/app", "/foo", "GET"); - Map parameters = new HashMap(); + Map parameters = new HashMap<>(); request.setParameters(parameters); flowExecutor.launchExecution("foo", flowInput, context); FlowException flowException = new FlowException("Error") { @@ -477,7 +477,7 @@ public class FlowHandlerAdapterTests extends TestCase { handleExecutionOutcome = true; setupRequest("/springtravel", "/app", "/foo", "GET"); flowExecutor.launchExecution("foo", flowInput, context); - LocalAttributeMap output = new LocalAttributeMap(); + LocalAttributeMap output = new LocalAttributeMap<>(); output.put("bar", "baz"); FlowExecutionOutcome outcome = new FlowExecutionOutcome("finish", output); FlowExecutionResult result = FlowExecutionResult.createEndedResult("foo", outcome); diff --git a/spring-webflow/src/test/java/org/springframework/webflow/mvc/view/AbstractBindingModelTests.java b/spring-webflow/src/test/java/org/springframework/webflow/mvc/view/AbstractBindingModelTests.java index a7ca2e6e..39b15ce3 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/mvc/view/AbstractBindingModelTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/mvc/view/AbstractBindingModelTests.java @@ -85,9 +85,9 @@ public abstract class AbstractBindingModelTests extends TestCase { } public void testGetFieldValueError() { - Map source = new HashMap(); + Map source = new HashMap<>(); source.put("datum2", "bogus"); - List mappingResults = new ArrayList(); + List mappingResults = new ArrayList<>(); Mapping mapping = new Mapping() { public Expression getSourceExpression() { return expressionParser.parseExpression("datum2", null); diff --git a/spring-webflow/src/test/java/org/springframework/webflow/mvc/view/AjaxTiles3ViewTests.java b/spring-webflow/src/test/java/org/springframework/webflow/mvc/view/AjaxTiles3ViewTests.java index e0b1bbff..aa664dd0 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/mvc/view/AjaxTiles3ViewTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/mvc/view/AjaxTiles3ViewTests.java @@ -127,7 +127,7 @@ public class AjaxTiles3ViewTests extends TestCase { BasicTilesContainer container = (BasicTilesContainer) TilesAccess.getContainer(tilesAppContext); AttributeContext attributeContext = container.startContext(tilesRequest); attributeContext.putAttribute("body", new Attribute("/WEB-INF/dynamicTemplate.jsp")); - Map resultMap = new HashMap(); + Map resultMap = new HashMap<>(); ajaxTilesView.addRuntimeAttributes(container, tilesRequest, resultMap); assertNotNull(resultMap.get("body")); assertEquals("/WEB-INF/dynamicTemplate.jsp", resultMap.get("body").toString()); @@ -151,7 +151,7 @@ public class AjaxTiles3ViewTests extends TestCase { Request tilesRequest = new ServletRequest(tilesAppContext, request, response); BasicTilesContainer container = (BasicTilesContainer) TilesAccess.getContainer(tilesAppContext); Definition compositeDefinition = container.getDefinitionsFactory().getDefinition("search", tilesRequest); - Map resultMap = new HashMap(); + Map resultMap = new HashMap<>(); ajaxTilesView.flattenAttributeMap(container, tilesRequest, resultMap, compositeDefinition); assertNotNull(resultMap.get("body")); assertNotNull(resultMap.get("searchForm")); diff --git a/spring-webflow/src/test/java/org/springframework/webflow/mvc/view/BindingModelSwf1370Tests.java b/spring-webflow/src/test/java/org/springframework/webflow/mvc/view/BindingModelSwf1370Tests.java index a229161a..4e90690f 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/mvc/view/BindingModelSwf1370Tests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/mvc/view/BindingModelSwf1370Tests.java @@ -57,7 +57,7 @@ public class BindingModelSwf1370Tests extends TestCase { } public static class TestBeanWithQuestionResponseMap { - private Map responses = new HashMap(); + private Map responses = new HashMap<>(); public TestBeanWithQuestionResponseMap(Question question) { responses.put(question, new Response(111)); @@ -75,7 +75,7 @@ public class BindingModelSwf1370Tests extends TestCase { public static class QuestionConverter implements org.springframework.core.convert.converter.Converter { - private Map map = new HashMap(); + private Map map = new HashMap<>(); public QuestionConverter(Question... questions) { for (int i = 0; i < questions.length; i++) { diff --git a/spring-webflow/src/test/java/org/springframework/webflow/persistence/TestBean.java b/spring-webflow/src/test/java/org/springframework/webflow/persistence/TestBean.java index d4205259..9b85b7a4 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/persistence/TestBean.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/persistence/TestBean.java @@ -24,7 +24,7 @@ public class TestBean { private String name; - private Set addresses = new HashSet(); + private Set addresses = new HashSet<>(); private int count; diff --git a/spring-webflow/src/test/java/org/springframework/webflow/security/SecurityFlowExecutionListenerTests.java b/spring-webflow/src/test/java/org/springframework/webflow/security/SecurityFlowExecutionListenerTests.java index b64c0b09..81a0e258 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/security/SecurityFlowExecutionListenerTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/security/SecurityFlowExecutionListenerTests.java @@ -118,7 +118,7 @@ public class SecurityFlowExecutionListenerTests extends TestCase { private SecurityRule getSecurityRuleAnyAuthorized() { SecurityRule rule = new SecurityRule(); rule.setComparisonType(SecurityRule.COMPARISON_ANY); - Collection attributes = new HashSet(); + Collection attributes = new HashSet<>(); attributes.add("ROLE_1"); attributes.add("ROLE_A"); rule.setAttributes(attributes); @@ -128,7 +128,7 @@ public class SecurityFlowExecutionListenerTests extends TestCase { private SecurityRule getSecurityRuleAnyDenied() { SecurityRule rule = new SecurityRule(); rule.setComparisonType(SecurityRule.COMPARISON_ANY); - Collection attributes = new HashSet(); + Collection attributes = new HashSet<>(); attributes.add("ROLE_A"); attributes.add("ROLE_B"); rule.setAttributes(attributes); @@ -138,7 +138,7 @@ public class SecurityFlowExecutionListenerTests extends TestCase { private SecurityRule getSecurityRuleAllAuthorized() { SecurityRule rule = new SecurityRule(); rule.setComparisonType(SecurityRule.COMPARISON_ALL); - Collection attributes = new HashSet(); + Collection attributes = new HashSet<>(); attributes.add("ROLE_1"); attributes.add("ROLE_3"); rule.setAttributes(attributes); @@ -148,7 +148,7 @@ public class SecurityFlowExecutionListenerTests extends TestCase { private SecurityRule getSecurityRuleAllDenied() { SecurityRule rule = new SecurityRule(); rule.setComparisonType(SecurityRule.COMPARISON_ALL); - Collection attributes = new HashSet(); + Collection attributes = new HashSet<>(); attributes.add("ROLE_1"); attributes.add("ROLE_A"); rule.setAttributes(attributes); diff --git a/spring-webflow/src/test/java/org/springframework/webflow/security/SecurityRuleTests.java b/spring-webflow/src/test/java/org/springframework/webflow/security/SecurityRuleTests.java index f7cff118..6248a979 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/security/SecurityRuleTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/security/SecurityRuleTests.java @@ -9,7 +9,7 @@ import junit.framework.TestCase; public class SecurityRuleTests extends TestCase { public void testConvertAttributesToCommaSeparatedString() { - Collection attributes = new ArrayList(); + Collection attributes = new ArrayList<>(); attributes.add("ROLE_1"); attributes.add("ROLE_2"); Assert.assertEquals("ROLE_1, ROLE_2", SecurityRule.securityAttributesToCommaDelimitedList(attributes)); diff --git a/spring-webflow/src/test/java/org/springframework/webflow/test/MockActionTests.java b/spring-webflow/src/test/java/org/springframework/webflow/test/MockActionTests.java index 6601f7be..f3436250 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/test/MockActionTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/test/MockActionTests.java @@ -22,7 +22,7 @@ public class MockActionTests extends TestCase { public void testMockActionExecuteCustomResultAttributes() { MockAction action = new MockAction("foo"); - LocalAttributeMap resultAttributes = new LocalAttributeMap(); + LocalAttributeMap resultAttributes = new LocalAttributeMap<>(); resultAttributes.put("bar", "baz"); action.setResultAttributes(resultAttributes); Event e = action.execute(new MockRequestContext()); diff --git a/spring-webflow/src/test/java/org/springframework/webflow/test/SearchFlowExecutionTests.java b/spring-webflow/src/test/java/org/springframework/webflow/test/SearchFlowExecutionTests.java index af32913f..1c5ac261 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/test/SearchFlowExecutionTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/test/SearchFlowExecutionTests.java @@ -102,7 +102,7 @@ public class SearchFlowExecutionTests extends AbstractXmlFlowExecutionTests { public static class TestPhoneBook { public List search(Object criteria) { - ArrayList res = new ArrayList(); + ArrayList res = new ArrayList<>(); res.add(new Object()); return res; } @@ -115,4 +115,4 @@ public class SearchFlowExecutionTests extends AbstractXmlFlowExecutionTests { return new Object(); } } -} +}