You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2017/09/20 14:27:27 UTC
[myfaces-tobago] 07/07: TOBAGO-1795: Set Java Source to Java 8 *
use Diamond operator
This is an automated email from the ASF dual-hosted git repository.
lofwyr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git
commit 8a65537844c536be6eb6fd76976571fc547f9ed6
Author: Udo Schnurpfeil <lo...@apache.org>
AuthorDate: Wed Sep 20 16:25:44 2017 +0200
TOBAGO-1795: Set Java Source to Java 8
* use Diamond operator
---
.../java/org/apache/myfaces/tobago/component/Sorter.java | 2 +-
.../java/org/apache/myfaces/tobago/context/Markup.java | 2 +-
.../org/apache/myfaces/tobago/context/MarkupConfig.java | 2 +-
.../org/apache/myfaces/tobago/context/ThemeImpl.java | 2 +-
.../apache/myfaces/tobago/context/ThemeResources.java | 8 ++++----
.../org/apache/myfaces/tobago/context/UserAgent.java | 2 +-
.../apache/myfaces/tobago/convert/DurationConverter.java | 2 +-
.../myfaces/tobago/facelets/TobagoComponentHandler.java | 2 +-
.../tobago/internal/ajax/AjaxNavigationState.java | 4 ++--
.../tobago/internal/behavior/DeltaStateHelper.java | 16 ++++++++--------
.../myfaces/tobago/internal/behavior/EventBehavior.java | 2 +-
.../tobago/internal/component/AbstractUIMessages.java | 2 +-
.../tobago/internal/component/AbstractUISheet.java | 4 ++--
.../tobago/internal/component/AbstractUITabGroup.java | 2 +-
.../tobago/internal/config/ContentSecurityPolicy.java | 2 +-
.../tobago/internal/config/RenderersConfigImpl.java | 4 ++--
.../tobago/internal/config/TobagoConfigBuilder.java | 4 ++--
.../tobago/internal/config/TobagoConfigFragment.java | 10 +++++-----
.../myfaces/tobago/internal/config/TobagoConfigImpl.java | 10 +++++-----
.../tobago/internal/config/TobagoConfigParser.java | 2 +-
.../tobago/internal/config/TobagoConfigSorter.java | 2 +-
.../myfaces/tobago/internal/context/DateTimeI18n.java | 2 +-
.../org/apache/myfaces/tobago/internal/layout/Grid.java | 4 ++--
.../myfaces/tobago/internal/layout/LayoutUtils.java | 2 +-
.../myfaces/tobago/internal/renderkit/CommandMap.java | 2 +-
.../tobago/internal/renderkit/renderer/FileRenderer.java | 2 +-
.../tobago/internal/renderkit/renderer/PageRenderer.java | 8 ++++----
.../renderkit/renderer/SelectManyRendererBase.java | 6 +++---
.../internal/renderkit/renderer/SheetRenderer.java | 10 +++++-----
.../internal/renderkit/renderer/SuggestRenderer.java | 2 +-
.../renderkit/renderer/TobagoClientBehaviorRenderer.java | 2 +-
.../internal/renderkit/renderer/TreeListboxRenderer.java | 4 ++--
.../myfaces/tobago/internal/util/AccessKeyLogger.java | 2 +-
.../tobago/internal/util/AuthorizationHelper.java | 4 ++--
.../apache/myfaces/tobago/internal/util/JsonUtils.java | 2 +-
.../apache/myfaces/tobago/internal/util/PartUtils.java | 8 ++++----
.../myfaces/tobago/internal/util/SelectItemUtils.java | 6 +++---
.../apache/myfaces/tobago/internal/util/StringUtils.java | 8 ++++----
.../internal/webapp/DebugResponseWriterWrapper.java | 4 ++--
.../apache/myfaces/tobago/layout/ColumnPartition.java | 2 +-
.../org/apache/myfaces/tobago/layout/LayoutTokens.java | 2 +-
.../org/apache/myfaces/tobago/model/ExpandedState.java | 8 ++++----
.../org/apache/myfaces/tobago/model/SelectedState.java | 2 +-
.../java/org/apache/myfaces/tobago/model/SheetState.java | 4 ++--
.../apache/myfaces/tobago/model/TreeNodeDataModel.java | 8 ++++----
.../java/org/apache/myfaces/tobago/model/TreePath.java | 2 +-
.../apache/myfaces/tobago/renderkit/TobagoRenderKit.java | 2 +-
.../tobago/renderkit/css/FontAwesomeIconEncoder.java | 2 +-
.../apache/myfaces/tobago/renderkit/css/TobagoClass.java | 2 +-
.../myfaces/tobago/renderkit/html/HtmlElements.java | 4 ++--
.../java/org/apache/myfaces/tobago/util/AjaxUtils.java | 2 +-
.../org/apache/myfaces/tobago/util/ComponentUtils.java | 8 ++++----
.../java/org/apache/myfaces/tobago/util/LocaleUtils.java | 4 ++--
.../component/AbstractGeneratedUIComponentsUnitTest.java | 4 ++--
...MethodOverwritingOfGeneratedUIComponentsUnitTest.java | 2 +-
.../apache/myfaces/tobago/component/UISheetUnitTest.java | 2 +-
.../internal/config/TobagoConfigMergingUnitTest.java | 2 +-
.../internal/config/TobagoConfigParserUnitTest.java | 4 ++--
.../internal/config/TobagoConfigSorterUnitTest.java | 6 +++---
.../tobago/internal/mock/servlet/MockHttpSession.java | 2 +-
.../myfaces/tobago/renderkit/css/CssClassUtils.java | 2 +-
.../apache/myfaces/tobago/example/data/LocaleList.java | 10 +++++-----
.../org/apache/myfaces/tobago/example/data/Solar.java | 2 +-
.../apache/myfaces/tobago/example/data/SolarObject.java | 6 +++---
.../myfaces/tobago/example/demo/DemoController.java | 2 +-
.../myfaces/tobago/example/demo/EventController.java | 8 ++++----
.../myfaces/tobago/example/demo/ForEachController.java | 8 ++++----
.../tobago/example/demo/InputSuggestController.java | 10 +++++-----
.../myfaces/tobago/example/demo/NavigationTree.java | 6 +++---
.../example/demo/SelectManyCheckboxController.java | 4 ++--
.../tobago/example/demo/SelectManyListboxController.java | 4 ++--
.../tobago/example/demo/SelectManyShuttleController.java | 2 +-
.../apache/myfaces/tobago/example/demo/ServerInfo.java | 2 +-
.../apache/myfaces/tobago/example/demo/SheetConfig.java | 2 +-
.../myfaces/tobago/example/demo/SheetController.java | 4 ++--
.../tobago/example/demo/SheetFilterController.java | 6 +++---
.../myfaces/tobago/example/demo/SuggestController.java | 4 ++--
.../myfaces/tobago/example/demo/TestController.java | 8 ++++----
.../myfaces/tobago/example/demo/ThemeController.java | 2 +-
.../myfaces/tobago/example/demo/UploadController.java | 2 +-
.../example/demo/bestpractice/ToolBarCustomizer.java | 8 ++++----
.../demo/clientConfig/ClientConfigController.java | 4 ++--
.../myfaces/tobago/example/demo/info/ActivityList.java | 4 ++--
.../tobago/example/demo/nonfacesrequest/FishPond.java | 2 +-
.../myfaces/tobago/example/demo/sudoku/Sudoku.java | 6 +++---
.../tobago/example/test/ClientConfigController.java | 4 ++--
.../myfaces/tobago/example/test/DirectoryBrowser.java | 2 +-
.../apache/myfaces/tobago/example/test/DynamicBean.java | 2 +-
.../tobago/example/test/InputSuggestController.java | 2 +-
.../tobago/example/test/PopupReferenceController.java | 2 +-
.../apache/myfaces/tobago/example/test/ScriptEvent.java | 2 +-
.../tobago/example/test/SelectManyListboxBean.java | 8 ++++----
.../myfaces/tobago/example/test/SheetController.java | 2 +-
.../myfaces/tobago/example/test/SheetSortController.java | 2 +-
.../org/apache/myfaces/tobago/example/test/Shuttle.java | 2 +-
.../myfaces/tobago/example/test/TestPageFilter.java | 6 +++---
.../myfaces/tobago/example/demo/NavigationUnitTest.java | 2 +-
.../apache/myfaces/tobago/example/demo/QUnitTests.java | 6 +++---
.../tobago/renderkit/css/BootstrapClassUnitTest.java | 2 +-
.../apache/myfaces/tobago/apt/generate/ClassInfo.java | 2 +-
.../apache/myfaces/tobago/apt/generate/ClassUtils.java | 2 +-
.../myfaces/tobago/apt/generate/ComponentInfo.java | 6 +++---
.../org/apache/myfaces/tobago/apt/generate/Imports.java | 2 +-
.../org/apache/myfaces/tobago/apt/generate/TagInfo.java | 2 +-
.../myfaces/tobago/apt/processor/AbstractGenerator.java | 4 ++--
.../tobago/apt/processor/CheckstyleConfigGenerator.java | 6 +++---
.../myfaces/tobago/apt/processor/ClassesGenerator.java | 4 ++--
.../tobago/apt/processor/FacesConfigGenerator.java | 16 ++++++++--------
.../myfaces/tobago/apt/processor/TaglibGenerator.java | 8 ++++----
109 files changed, 226 insertions(+), 226 deletions(-)
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/component/Sorter.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/component/Sorter.java
index 9420c94..9a629f3 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/component/Sorter.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/component/Sorter.java
@@ -151,7 +151,7 @@ public class Sorter {
// memorize selected rows
List<Object> selectedDataRows = null;
if (sheetState.getSelectedRows().size() > 0) {
- selectedDataRows = new ArrayList<Object>(sheetState.getSelectedRows().size());
+ selectedDataRows = new ArrayList<>(sheetState.getSelectedRows().size());
Object dataRow;
for (final Integer index : sheetState.getSelectedRows()) {
if (value instanceof List) {
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/context/Markup.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/context/Markup.java
index 029cadc..6a38648 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/context/Markup.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/context/Markup.java
@@ -174,7 +174,7 @@ public final class Markup implements Serializable, Iterable<String> {
return valueOf((String[]) value);
}
if (value instanceof Iterable) {
- final List<String> list = new ArrayList<String>();
+ final List<String> list = new ArrayList<>();
for (final Object object : (Iterable) value) {
list.add(object.toString());
}
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/context/MarkupConfig.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/context/MarkupConfig.java
index 2136b4a..a262ca0 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/context/MarkupConfig.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/context/MarkupConfig.java
@@ -27,7 +27,7 @@ public class MarkupConfig implements Serializable {
private static final long serialVersionUID = 1L;
- private Set<String> markups = new HashSet<String>();
+ private Set<String> markups = new HashSet<>();
public boolean contains(final String markup) {
return markups.contains(markup);
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ThemeImpl.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ThemeImpl.java
index 78df0ce..4590d3d 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ThemeImpl.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ThemeImpl.java
@@ -116,7 +116,7 @@ public class ThemeImpl implements Theme, Serializable {
public void resolveFallbacks() {
checkLocked();
- fallbackList = new ArrayList<Theme>();
+ fallbackList = new ArrayList<>();
ThemeImpl actual = this;
while (actual != null) {
fallbackList.add(actual);
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ThemeResources.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ThemeResources.java
index b680494..df791ac 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ThemeResources.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ThemeResources.java
@@ -31,10 +31,10 @@ import java.util.List;
public final class ThemeResources implements Serializable {
private final boolean production;
- private final List<ThemeScript> scriptList = new ArrayList<ThemeScript>();
- private final List<ThemeScript> scriptExcludes = new ArrayList<ThemeScript>();
- private final List<ThemeStyle> styleList = new ArrayList<ThemeStyle>();
- private final List<ThemeStyle> styleExcludes = new ArrayList<ThemeStyle>();
+ private final List<ThemeScript> scriptList = new ArrayList<>();
+ private final List<ThemeScript> scriptExcludes = new ArrayList<>();
+ private final List<ThemeStyle> styleList = new ArrayList<>();
+ private final List<ThemeStyle> styleExcludes = new ArrayList<>();
public ThemeResources(boolean production) {
this.production = production;
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/context/UserAgent.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/context/UserAgent.java
index 04f9e65..04b6a26 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/context/UserAgent.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/context/UserAgent.java
@@ -248,7 +248,7 @@ public final class UserAgent implements Serializable {
}
private List<String> getFallbackList(final boolean reverseOrder) {
- final List<String> list = new ArrayList<String>(3);
+ final List<String> list = new ArrayList<>(3);
if (version != null) {
list.add(name + '_' + version);
}
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/convert/DurationConverter.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/convert/DurationConverter.java
index 6bee513..7ac0df0 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/convert/DurationConverter.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/convert/DurationConverter.java
@@ -88,7 +88,7 @@ public class DurationConverter implements Converter {
throws ConverterException {
final boolean negative = string.indexOf('-') > -1;
final StringTokenizer tokenizer = new StringTokenizer(string, " :-");
- final List<String> elements = new ArrayList<String>();
+ final List<String> elements = new ArrayList<>();
while (tokenizer.hasMoreTokens()) {
elements.add(tokenizer.nextToken());
}
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/facelets/TobagoComponentHandler.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/facelets/TobagoComponentHandler.java
index 185a652..937c00f 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/facelets/TobagoComponentHandler.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/facelets/TobagoComponentHandler.java
@@ -89,7 +89,7 @@ public class TobagoComponentHandler extends ComponentHandler {
}
final Validator[] validators = component.getValidators();
if (validators.length > 0) {
- final Set<String> classNames = new HashSet<String>();
+ final Set<String> classNames = new HashSet<>();
// collect classNames of validators
for (Validator validator : validators) {
classNames.add(validator.getClass().getName());
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/ajax/AjaxNavigationState.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/ajax/AjaxNavigationState.java
index 2ca3bf5..6e7bfd9 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/ajax/AjaxNavigationState.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/ajax/AjaxNavigationState.java
@@ -57,7 +57,7 @@ public final class AjaxNavigationState {
final ExternalContext externalContext = facesContext.getExternalContext();
externalContext.getSessionMap().put(SESSION_KEY, this);
viewRoot = facesContext.getViewRoot();
- messages = new HashMap<String, List<FacesMessage>>();
+ messages = new HashMap<>();
final Iterator<String> iterator = facesContext.getClientIdsWithMessages();
while (iterator.hasNext()) {
addFacesMessages(facesContext, iterator.next());
@@ -82,7 +82,7 @@ public final class AjaxNavigationState {
private void addFacesMessage(final String clientId, final FacesMessage facesMessage) {
List<FacesMessage> facesMessages = messages.get(clientId);
if (facesMessages == null) {
- facesMessages = new ArrayList<FacesMessage>();
+ facesMessages = new ArrayList<>();
messages.put(clientId, facesMessages);
}
facesMessages.add(facesMessage);
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/behavior/DeltaStateHelper.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/behavior/DeltaStateHelper.java
index cbe1331..8ad8e09 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/behavior/DeltaStateHelper.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/behavior/DeltaStateHelper.java
@@ -175,7 +175,7 @@ class DeltaStateHelper<A extends EventBehavior> implements StateHelper {
DeltaStateHelper(A target) {
super();
this.target = target;
- fullState = new HashMap<Serializable, Object>();
+ fullState = new HashMap<>();
deltas = null;
//_stateHolderKeys = new HashSet<Serializable>();
}
@@ -188,7 +188,7 @@ class DeltaStateHelper<A extends EventBehavior> implements StateHelper {
private boolean createDeltas() {
if (isInitialStateMarked()) {
if (deltas == null) {
- deltas = new HashMap<Serializable, Object>(2);
+ deltas = new HashMap<>(2);
}
return true;
}
@@ -206,7 +206,7 @@ class DeltaStateHelper<A extends EventBehavior> implements StateHelper {
Map<Object, Boolean> deltaListMapValues = (Map<Object, Boolean>) deltas
.get(key);
if (deltaListMapValues == null) {
- deltaListMapValues = new DeltaStateHelper.InternalDeltaListMap<Object, Boolean>(
+ deltaListMapValues = new DeltaStateHelper.InternalDeltaListMap<>(
3);
deltas.put(key, deltaListMapValues);
}
@@ -216,7 +216,7 @@ class DeltaStateHelper<A extends EventBehavior> implements StateHelper {
//Handle change on full map
List<Object> fullListValues = (List<Object>) fullState.get(key);
if (fullListValues == null) {
- fullListValues = new DeltaStateHelper.InternalList<Object>(3);
+ fullListValues = new DeltaStateHelper.InternalList<>(3);
fullState.put(key, fullListValues);
}
fullListValues.add(value);
@@ -286,7 +286,7 @@ class DeltaStateHelper<A extends EventBehavior> implements StateHelper {
Map<String, Object> mapValues = (Map<String, Object>) deltas
.get(key);
if (mapValues == null) {
- mapValues = new DeltaStateHelper.InternalMap<String, Object>();
+ mapValues = new DeltaStateHelper.InternalMap<>();
deltas.put(key, mapValues);
}
if (mapValues.containsKey(mapKey)) {
@@ -301,7 +301,7 @@ class DeltaStateHelper<A extends EventBehavior> implements StateHelper {
Map<String, Object> mapValues = (Map<String, Object>) fullState
.get(key);
if (mapValues == null) {
- mapValues = new DeltaStateHelper.InternalMap<String, Object>();
+ mapValues = new DeltaStateHelper.InternalMap<>();
fullState.put(key, mapValues);
}
if (returnSet) {
@@ -708,7 +708,7 @@ class DeltaStateHelper<A extends EventBehavior> implements StateHelper {
return new AttachedStateWrapper(attachedObject.getClass(), holder.saveState(context));
} else if (attachedObject instanceof List) {
- List<Object> lst = new ArrayList<Object>(((List<?>) attachedObject).size());
+ List<Object> lst = new ArrayList<>(((List<?>) attachedObject).size());
for (Object item : (List<?>) attachedObject) {
if (item != null) {
lst.add(saveAttachedState(context, item));
@@ -732,7 +732,7 @@ class DeltaStateHelper<A extends EventBehavior> implements StateHelper {
}
if (stateObj instanceof AttachedListStateWrapper) {
List<Object> lst = ((AttachedListStateWrapper) stateObj).getWrappedStateList();
- List<Object> restoredList = new ArrayList<Object>(lst.size());
+ List<Object> restoredList = new ArrayList<>(lst.size());
for (Object item : lst) {
restoredList.add(restoreAttachedState(context, item));
}
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/behavior/EventBehavior.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/behavior/EventBehavior.java
index 163c464..8e4468c 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/behavior/EventBehavior.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/behavior/EventBehavior.java
@@ -227,7 +227,7 @@ public class EventBehavior extends ClientBehaviorBase {
return stateHelper;
}
if (create) {
- stateHelper = new DeltaStateHelper<EventBehavior>(this);
+ stateHelper = new DeltaStateHelper<>(this);
}
return stateHelper;
}
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIMessages.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIMessages.java
index d50f7c2..240ff74 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIMessages.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIMessages.java
@@ -57,7 +57,7 @@ public abstract class AbstractUIMessages extends javax.faces.component.UIMessage
}
private List<Item> collectMessageList(final FacesContext facesContext, final Iterator clientIds) {
- final List<Item> messages = new ArrayList<Item>();
+ final List<Item> messages = new ArrayList<>();
while (clientIds.hasNext()) {
final String clientId = (String) clientIds.next();
final Iterator<FacesMessage> i = facesContext.getMessages(clientId);
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUISheet.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUISheet.java
index 6c672ce..1d1d0d7 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUISheet.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUISheet.java
@@ -229,7 +229,7 @@ public abstract class AbstractUISheet extends AbstractUIData
}
public List<UIComponent> getRenderedChildrenOf(final UIColumn column) {
- final List<UIComponent> children = new ArrayList<UIComponent>();
+ final List<UIComponent> children = new ArrayList<>();
for (final UIComponent kid : column.getChildren()) {
if (kid.isRendered()) {
children.add(kid);
@@ -337,7 +337,7 @@ public abstract class AbstractUISheet extends AbstractUIData
}
public List<AbstractUIColumnBase> getAllColumns() {
- ArrayList<AbstractUIColumnBase> result = new ArrayList<AbstractUIColumnBase>();
+ ArrayList<AbstractUIColumnBase> result = new ArrayList<>();
findColumns(this, result, true);
return result;
}
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUITabGroup.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUITabGroup.java
index 1e4446f..2fd394d 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUITabGroup.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUITabGroup.java
@@ -82,7 +82,7 @@ public abstract class AbstractUITabGroup extends AbstractUIPanelBase
}
public AbstractUITab[] getTabs() {
- final List<AbstractUITab> tabs = new ArrayList<AbstractUITab>();
+ final List<AbstractUITab> tabs = new ArrayList<>();
for (final UIComponent kid : getChildren()) {
if (kid instanceof AbstractUITab) {
//if (kid.isRendered()) {
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/config/ContentSecurityPolicy.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/config/ContentSecurityPolicy.java
index 67b9593..06936b0 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/config/ContentSecurityPolicy.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/config/ContentSecurityPolicy.java
@@ -46,7 +46,7 @@ public class ContentSecurityPolicy {
public ContentSecurityPolicy(final String mode) {
this.mode = Mode.parse(mode);
- this.directiveMap = new HashMap<String, String>();
+ this.directiveMap = new HashMap<>();
}
public void merge(final ContentSecurityPolicy other) {
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/config/RenderersConfigImpl.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/config/RenderersConfigImpl.java
index c1cab0f..19cf2f7 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/config/RenderersConfigImpl.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/config/RenderersConfigImpl.java
@@ -36,7 +36,7 @@ public class RenderersConfigImpl implements RenderersConfig, Serializable {
private static final Logger LOG = LoggerFactory.getLogger(RenderersConfigImpl.class);
- private Map<String, RendererConfig> rendererMap = new HashMap<String, RendererConfig>();
+ private Map<String, RendererConfig> rendererMap = new HashMap<>();
private boolean merged = false;
private boolean unmodifiable = false;
@@ -66,7 +66,7 @@ public class RenderersConfigImpl implements RenderersConfig, Serializable {
@Override
public List<RendererConfig> getRendererConfigs() {
- final ArrayList<RendererConfig> result = new ArrayList<RendererConfig>();
+ final ArrayList<RendererConfig> result = new ArrayList<>();
result.addAll(rendererMap.values());
return result;
}
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/config/TobagoConfigBuilder.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/config/TobagoConfigBuilder.java
index c9e525b..cfd90bb 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/config/TobagoConfigBuilder.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/config/TobagoConfigBuilder.java
@@ -46,7 +46,7 @@ public class TobagoConfigBuilder {
public TobagoConfigBuilder(final ServletContext servletContext) {
this.servletContext = servletContext;
- this.configFragmentList = new ArrayList<TobagoConfigFragment>();
+ this.configFragmentList = new ArrayList<>();
}
public TobagoConfigBuilder(ServletContext servletContext, List<TobagoConfigFragment> configFragmentList) {
@@ -104,7 +104,7 @@ public class TobagoConfigBuilder {
LOG.info("Searching for '" + META_INF_TOBAGO_CONFIG_XML + "'");
}
final ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
- final List<URL> urls = new ArrayList<URL>();
+ final List<URL> urls = new ArrayList<>();
CollectionUtils.addAll(urls, classLoader.getResources(META_INF_TOBAGO_CONFIG_XML));
for (final URL themeUrl : urls) {
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/config/TobagoConfigFragment.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/config/TobagoConfigFragment.java
index 0c66d8f..3cc9734 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/config/TobagoConfigFragment.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/config/TobagoConfigFragment.java
@@ -55,11 +55,11 @@ public class TobagoConfigFragment {
private Map<String, String> mimeTypes;
public TobagoConfigFragment() {
- before = new ArrayList<String>();
- after = new ArrayList<String>();
- supportedThemeNames = new ArrayList<String>();
- themeDefinitions = new ArrayList<ThemeImpl>();
- mimeTypes = new HashMap<String, String>();
+ before = new ArrayList<>();
+ after = new ArrayList<>();
+ supportedThemeNames = new ArrayList<>();
+ themeDefinitions = new ArrayList<>();
+ mimeTypes = new HashMap<>();
}
public void addSupportedThemeName(final String name) {
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/config/TobagoConfigImpl.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/config/TobagoConfigImpl.java
index 8864224..e37f32c 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/config/TobagoConfigImpl.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/config/TobagoConfigImpl.java
@@ -69,9 +69,9 @@ public class TobagoConfigImpl extends TobagoConfig {
private boolean unmodifiable = false;
protected TobagoConfigImpl() {
- supportedThemeNames = new ArrayList<String>();
- supportedThemes = new ArrayList<Theme>();
- availableThemes = new HashMap<String, ThemeImpl>();
+ supportedThemeNames = new ArrayList<>();
+ supportedThemes = new ArrayList<>();
+ availableThemes = new HashMap<>();
createSessionSecret = true;
checkSessionSecret = true;
preventFrameAttacks = true;
@@ -79,7 +79,7 @@ public class TobagoConfigImpl extends TobagoConfig {
securityAnnotation = SecurityAnnotation.disable;
decodeLineFeed = true;
contentSecurityPolicy = new ContentSecurityPolicy(ContentSecurityPolicy.Mode.OFF.getValue());
- mimeTypes = new HashMap<String, String>();
+ mimeTypes = new HashMap<>();
}
/**
@@ -379,7 +379,7 @@ public class TobagoConfigImpl extends TobagoConfig {
builder.append(sanitizer);
// to see only different (ignore alternative names for the same theme)
builder.append(", \nthemes=");
- final Set<Theme> all = new HashSet<Theme>(availableThemes.values());
+ final Set<Theme> all = new HashSet<>(availableThemes.values());
builder.append(all);
builder.append(", \nmimeTypes=");
builder.append(mimeTypes);
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/config/TobagoConfigParser.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/config/TobagoConfigParser.java
index d1f9ee8..e0e2de2 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/config/TobagoConfigParser.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/config/TobagoConfigParser.java
@@ -143,7 +143,7 @@ public class TobagoConfigParser extends TobagoConfigEntityResolver {
public void startDocument() throws SAXException {
buffer = new StringBuilder();
- stack = new Stack<String>();
+ stack = new Stack<>();
}
@Override
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/config/TobagoConfigSorter.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/config/TobagoConfigSorter.java
index a93571e..8eac42e 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/config/TobagoConfigSorter.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/config/TobagoConfigSorter.java
@@ -246,7 +246,7 @@ public class TobagoConfigSorter implements Comparator<TobagoConfigFragment> {
protected void createRelevantPairs() {
- pairs = new ArrayList<Pair>();
+ pairs = new ArrayList<>();
// collecting all relations, which are relevant for us. We don't need "before" and "after" of unknown names.
for (final TobagoConfigFragment tobagoConfig : list) {
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/context/DateTimeI18n.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/context/DateTimeI18n.java
index a84876f..1cf34e1 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/context/DateTimeI18n.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/context/DateTimeI18n.java
@@ -32,7 +32,7 @@ public class DateTimeI18n {
private static final Logger LOG = LoggerFactory.getLogger(DateTimeI18n.class);
- private static final Map<Locale, DateTimeI18n> CACHE = new HashMap<Locale, DateTimeI18n>();
+ private static final Map<Locale, DateTimeI18n> CACHE = new HashMap<>();
private final String[] monthNames = new String[12];
private final String[] monthNamesShort = new String[12];
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/layout/Grid.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/layout/Grid.java
index 672a1ab..78186f8 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/layout/Grid.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/layout/Grid.java
@@ -59,7 +59,7 @@ public class Grid {
this.rows = rows;
final int size = columnCount * rowCount;
- this.cells = new ArrayList<Cell>(size);
+ this.cells = new ArrayList<>(size);
for (int i = 0; i < size; i++) {
this.cells.add(null);
}
@@ -167,7 +167,7 @@ public class Grid {
public void addError(final int i, final int j) {
if (errorIndexes == null) {
- errorIndexes = new ArrayList<Integer>();
+ errorIndexes = new ArrayList<>();
}
errorIndexes.add(j * columnCount + i);
}
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/layout/LayoutUtils.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/layout/LayoutUtils.java
index 589e51f..a1384ad 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/layout/LayoutUtils.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/layout/LayoutUtils.java
@@ -49,7 +49,7 @@ public final class LayoutUtils {
}
public static List<UIComponent> findLayoutChildren(final UIComponent container) {
- final List<UIComponent> result = new ArrayList<UIComponent>();
+ final List<UIComponent> result = new ArrayList<>();
addLayoutChildren(container, result);
return result;
}
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/CommandMap.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/CommandMap.java
index 673391f..dd53e53 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/CommandMap.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/CommandMap.java
@@ -65,7 +65,7 @@ public class CommandMap {
setClick(command);
} else {
if (other == null) {
- other = new HashMap<ClientBehaviors, Command>();
+ other = new HashMap<>();
}
other.put(name, command);
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/FileRenderer.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/FileRenderer.java
index f1905bb..f85d5d7 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/FileRenderer.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/FileRenderer.java
@@ -81,7 +81,7 @@ public class FileRenderer extends MessageLayoutRendererBase implements Component
try {
HttpServletRequest httpServletRequest = (HttpServletRequest) request;
if (file.isMultiple()) {
- List<Part> parts = new ArrayList<Part>();
+ List<Part> parts = new ArrayList<>();
for (Part part : httpServletRequest.getParts()) {
if (file.getClientId(facesContext).equals(part.getName())) {
LOG.debug("Uploaded file '{}', size={}, type='{}'",
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/PageRenderer.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/PageRenderer.java
index ebcf9e6..8622a6d 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/PageRenderer.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/PageRenderer.java
@@ -394,10 +394,10 @@ public class PageRenderer extends RendererBase {
*/
private static class HeadResources {
- private List<UIComponent> metas = new ArrayList<UIComponent>();
- private List<UIComponent> styles = new ArrayList<UIComponent>();
- private List<UIComponent> scripts = new ArrayList<UIComponent>();
- private List<UIComponent> misc = new ArrayList<UIComponent>();
+ private List<UIComponent> metas = new ArrayList<>();
+ private List<UIComponent> styles = new ArrayList<>();
+ private List<UIComponent> scripts = new ArrayList<>();
+ private List<UIComponent> misc = new ArrayList<>();
HeadResources(
final FacesContext facesContext, final Collection<? extends UIComponent> collection, final String charset) {
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectManyRendererBase.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectManyRendererBase.java
index e0074fd..13ff40e 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectManyRendererBase.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectManyRendererBase.java
@@ -495,7 +495,7 @@ public abstract class SelectManyRendererBase extends MessageLayoutRendererBase {
// #################################################################################################################
private static class SelectItemsIterator implements Iterator<SelectItem> {
- private static final Iterator<UIComponent> EMPTY_UICOMPONENT_ITERATOR = new EmptyIterator<UIComponent>();
+ private static final Iterator<UIComponent> EMPTY_UICOMPONENT_ITERATOR = new EmptyIterator<>();
// org.apache.myfaces.shared.util.SelectItemsIterator uses JSFAttr
private static final String VAR_ATTR = "var";
@@ -588,7 +588,7 @@ public abstract class SelectManyRendererBase extends MessageLayoutRendererBase {
// value is any kind of array (primitive or non-primitive)
// --> we have to use class Array to get the values
int length = Array.getLength(value);
- Collection<Object> items = new ArrayList<Object>(length);
+ Collection<Object> items = new ArrayList<>(length);
for (int i = 0; i < length; i++) {
items.add(Array.get(value, i));
}
@@ -600,7 +600,7 @@ public abstract class SelectManyRendererBase extends MessageLayoutRendererBase {
return hasNext();
} else if (value instanceof Map) {
Map<Object, Object> map = (Map<Object, Object>) value;
- Collection<SelectItem> items = new ArrayList<SelectItem>(map.size());
+ Collection<SelectItem> items = new ArrayList<>(map.size());
for (Map.Entry<Object, Object> entry : map.entrySet()) {
items.add(new SelectItem(entry.getValue(), entry.getKey().toString()));
}
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SheetRenderer.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SheetRenderer.java
index 0d10dbe..c772096 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SheetRenderer.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SheetRenderer.java
@@ -234,7 +234,7 @@ public class SheetRenderer extends RendererBase {
JsonUtils.encode(definedColumnWidths ? columnWidths : Collections.<Integer>emptyList()),
sheetId + SUFFIX_WIDTHS);
- final ArrayList<String> encodedRendered = new ArrayList<String>();
+ final ArrayList<String> encodedRendered = new ArrayList<>();
for (AbstractUIColumnBase column : columns) {
if (!(column instanceof AbstractUIRow)) {
encodedRendered.add(Boolean.toString(column.isRendered()));
@@ -1030,7 +1030,7 @@ public class SheetRenderer extends RendererBase {
= ensurePagingCommand(application, sheet, Facets.PAGER_PAGE_DIRECT, SheetAction.toPage, false);
int linkCount = ComponentUtils.getIntAttribute(sheet, Attributes.directLinkCount);
linkCount--; // current page needs no link
- final ArrayList<Integer> prevs = new ArrayList<Integer>(linkCount);
+ final ArrayList<Integer> prevs = new ArrayList<>(linkCount);
int page = sheet.getCurrentPage() + 1;
for (int i = 0; i < linkCount && page > 1; i++) {
page--;
@@ -1039,7 +1039,7 @@ public class SheetRenderer extends RendererBase {
}
}
- final ArrayList<Integer> nexts = new ArrayList<Integer>(linkCount);
+ final ArrayList<Integer> nexts = new ArrayList<>(linkCount);
page = sheet.getCurrentPage() + 1;
final int pages = sheet.hasRowCount() || sheet.isRowsUnlimited() ? sheet.getPages() : Integer.MAX_VALUE;
for (int i = 0; i < linkCount && page < pages; i++) {
@@ -1121,14 +1121,14 @@ public class SheetRenderer extends RendererBase {
private AjaxBehavior createReloadBehavior(UISheet sheet) {
AjaxBehavior reloadBehavior = findReloadBehavior(sheet);
- final ArrayList<String> renderIds = new ArrayList<String>();
+ final ArrayList<String> renderIds = new ArrayList<>();
if (!renderIds.contains(sheet.getId())) {
renderIds.add(sheet.getId());
}
if (reloadBehavior != null) {
renderIds.addAll(reloadBehavior.getRender());
}
- final ArrayList<String> executeIds = new ArrayList<String>();
+ final ArrayList<String> executeIds = new ArrayList<>();
if (!executeIds.contains(sheet.getId())) {
executeIds.add(sheet.getId());
}
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SuggestRenderer.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SuggestRenderer.java
index 7d8cdca..98bce52 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SuggestRenderer.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SuggestRenderer.java
@@ -142,7 +142,7 @@ public class SuggestRenderer extends RendererBase {
//noinspection unchecked
autoSuggestItems.setItems((List<AutoSuggestItem>) object);
} else if (((List) object).get(0) instanceof String) {
- final List<AutoSuggestItem> items = new ArrayList<AutoSuggestItem>(((List) object).size());
+ final List<AutoSuggestItem> items = new ArrayList<>(((List) object).size());
for (int i = 0; i < ((List) object).size(); i++) {
final AutoSuggestItem item = new AutoSuggestItem();
item.setLabel((String) ((List) object).get(i));
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TobagoClientBehaviorRenderer.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TobagoClientBehaviorRenderer.java
index ca27b46..af75f1c 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TobagoClientBehaviorRenderer.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TobagoClientBehaviorRenderer.java
@@ -183,7 +183,7 @@ public class TobagoClientBehaviorRenderer extends javax.faces.render.ClientBehav
//// BEGIN
// XXX too complicated
- final List<AbstractUIOperation> operations = new ArrayList<AbstractUIOperation>();
+ final List<AbstractUIOperation> operations = new ArrayList<>();
for (final UIComponent child : component.getChildren()) {
if (AbstractUIOperation.class.isAssignableFrom(child.getClass())) {
operations.add((AbstractUIOperation) child);
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TreeListboxRenderer.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TreeListboxRenderer.java
index e4269d0..19d41e5 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TreeListboxRenderer.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TreeListboxRenderer.java
@@ -94,9 +94,9 @@ public class TreeListboxRenderer extends RendererBase {
writer.endElement(HtmlElements.INPUT);
}
- List<Integer> thisLevel = new ArrayList<Integer>();
+ List<Integer> thisLevel = new ArrayList<>();
thisLevel.add(0);
- List<Integer> nextLevel = new ArrayList<Integer>();
+ List<Integer> nextLevel = new ArrayList<>();
Integer size = tree.getSize();
size = Math.max(size != null ? size : 10, 2); // must be > 1, default is 10, if not set
final int depth = tree.getTreeDataModel().getDepth() != -1
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/AccessKeyLogger.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/AccessKeyLogger.java
index 215b539..5c608e2 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/AccessKeyLogger.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/AccessKeyLogger.java
@@ -59,7 +59,7 @@ public final class AccessKeyLogger extends HashMap<Character, List<String>> {
if (instance.containsKey(key)) {
clientIds = instance.get(key);
} else {
- clientIds = new ArrayList<String>();
+ clientIds = new ArrayList<>();
instance.put(key, clientIds);
}
clientIds.add(clientId);
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/AuthorizationHelper.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/AuthorizationHelper.java
index 7d44db2..ba78364 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/AuthorizationHelper.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/AuthorizationHelper.java
@@ -64,7 +64,7 @@ public class AuthorizationHelper {
}
};
- private final Map<String, Object> cache = new ConcurrentHashMap<String, Object>();
+ private final Map<String, Object> cache = new ConcurrentHashMap<>();
private BeanManager beanManager;
@@ -215,7 +215,7 @@ public class AuthorizationHelper {
}
final Method[] methods = clazz.getMethods();
- final List<Method> result = new ArrayList<Method>();
+ final List<Method> result = new ArrayList<>();
for (Method method : methods) {
if (method.getName().equals(name)) {
result.add(method);
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/JsonUtils.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/JsonUtils.java
index 1ccf667..2f71fca 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/JsonUtils.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/JsonUtils.java
@@ -275,7 +275,7 @@ public class JsonUtils {
public static List<Integer> decodeIntegerArray(final String json) {
String string = json.trim();
- final List<Integer> result = new ArrayList<Integer>();
+ final List<Integer> result = new ArrayList<>();
if (string.length() < 2 || string.charAt(0) != '[' || string.charAt(string.length() - 1) != ']') {
LOG.warn("Can't parse JSON array: no surrounding square brackets []: '{}'", string);
} else {
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/PartUtils.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/PartUtils.java
index 8226172..f397262 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/PartUtils.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/PartUtils.java
@@ -255,7 +255,7 @@ public final class PartUtils {
*/
public Map<String, String> parse(final String str, char separator) {
if (str == null) {
- return new HashMap<String, String>();
+ return new HashMap<>();
}
return parse(str.toCharArray(), separator);
}
@@ -271,7 +271,7 @@ public final class PartUtils {
*/
public Map<String, String> parse(final char[] charArray, char separator) {
if (charArray == null) {
- return new HashMap<String, String>();
+ return new HashMap<>();
}
return parse(charArray, 0, charArray.length, separator);
}
@@ -294,9 +294,9 @@ public final class PartUtils {
char separator) {
if (charArray == null) {
- return new HashMap<String, String>();
+ return new HashMap<>();
}
- HashMap<String, String> params = new HashMap<String, String>();
+ HashMap<String, String> params = new HashMap<>();
this.chars = charArray;
this.pos = offset;
this.len = length;
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/SelectItemUtils.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/SelectItemUtils.java
index 81b2499..a892fcf 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/SelectItemUtils.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/SelectItemUtils.java
@@ -76,7 +76,7 @@ public class SelectItemUtils {
return Collections.emptyList();
} else {
final Iterable<SelectItem> iterator = getItemIterator(facesContext, selector);
- final List<SelectItem> result = new ArrayList<SelectItem>();
+ final List<SelectItem> result = new ArrayList<>();
for (SelectItem selectItem : iterator) {
result.add(selectItem);
}
@@ -170,7 +170,7 @@ public class SelectItemUtils {
// value is any kind of array (primitive or non-primitive)
// --> we have to use class Array to get the values
final int length = Array.getLength(value);
- final Collection<Object> items = new ArrayList<Object>(length);
+ final Collection<Object> items = new ArrayList<>(length);
for (int i = 0; i < length; i++) {
items.add(Array.get(value, i));
}
@@ -182,7 +182,7 @@ public class SelectItemUtils {
return hasNext();
} else if (value instanceof Map) {
final Map<Object, Object> map = (Map<Object, Object>) value;
- final Collection<SelectItem> items = new ArrayList<SelectItem>(map.size());
+ final Collection<SelectItem> items = new ArrayList<>(map.size());
for (Map.Entry<Object, Object> entry : map.entrySet()) {
items.add(new org.apache.myfaces.tobago.model.SelectItem(entry.getValue(), entry.getKey().toString()));
}
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/StringUtils.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/StringUtils.java
index f9e98f0..24bcf5c 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/StringUtils.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/StringUtils.java
@@ -36,7 +36,7 @@ public final class StringUtils {
public static List<Integer> parseIntegerList(final String integerList, final String delimiters)
throws NumberFormatException {
- final List<Integer> list = new ArrayList<Integer>();
+ final List<Integer> list = new ArrayList<>();
final StringTokenizer tokenizer = new StringTokenizer(integerList, delimiters);
while (tokenizer.hasMoreElements()) {
@@ -61,7 +61,7 @@ public final class StringUtils {
}
public static int[] getIndices(final String list) {
- final List<String> indexList = new ArrayList<String>();
+ final List<String> indexList = new ArrayList<>();
final StringTokenizer st = new StringTokenizer(list, ",");
while (st.hasMoreTokens()) {
final String token = st.nextToken().trim();
@@ -205,7 +205,7 @@ public final class StringUtils {
if (len == 0) {
return ArrayUtils.EMPTY_STRING_ARRAY;
}
- final List<String> list = new ArrayList<String>();
+ final List<String> list = new ArrayList<>();
int i = 0;
int start = 0;
boolean match = false;
@@ -243,7 +243,7 @@ public final class StringUtils {
if (len == 0) {
return ArrayUtils.EMPTY_STRING_ARRAY;
}
- final List<String> list = new ArrayList<String>();
+ final List<String> list = new ArrayList<>();
int sizePlus1 = 1;
int i = 0;
int start = 0;
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/webapp/DebugResponseWriterWrapper.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/webapp/DebugResponseWriterWrapper.java
index c6622f2..61475bb 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/webapp/DebugResponseWriterWrapper.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/webapp/DebugResponseWriterWrapper.java
@@ -38,8 +38,8 @@ import java.util.Stack;
public class DebugResponseWriterWrapper extends TobagoResponseWriter {
- private Stack<Object> stack = new Stack<Object>();
- private Set<MarkupLanguageAttributes> usedAttributes = new HashSet<MarkupLanguageAttributes>();
+ private Stack<Object> stack = new Stack<>();
+ private Set<MarkupLanguageAttributes> usedAttributes = new HashSet<>();
private static final Logger LOG = LoggerFactory.getLogger(DebugResponseWriterWrapper.class);
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/layout/ColumnPartition.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/layout/ColumnPartition.java
index ae85067..b3b1c22 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/layout/ColumnPartition.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/layout/ColumnPartition.java
@@ -83,7 +83,7 @@ public final class ColumnPartition implements Serializable {
}
private Integer[] createParts(List<Integer> summands) {
- List<Integer> list = new ArrayList<Integer>();
+ List<Integer> list = new ArrayList<>();
if (summands == null || summands.size() == 0) {
return INTEGER_12;
}
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/layout/LayoutTokens.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/layout/LayoutTokens.java
index cecb1bb..f4eb238 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/layout/LayoutTokens.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/layout/LayoutTokens.java
@@ -32,7 +32,7 @@ public final class LayoutTokens implements Iterable<LayoutToken> {
private static final Logger LOG = LoggerFactory.getLogger(LayoutTokens.class);
- private List<LayoutToken> tokens = new ArrayList<LayoutToken>();
+ private List<LayoutToken> tokens = new ArrayList<>();
public LayoutTokens() {
}
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/model/ExpandedState.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/model/ExpandedState.java
index 96d901d..a67f703 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/model/ExpandedState.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/model/ExpandedState.java
@@ -44,8 +44,8 @@ public class ExpandedState implements Serializable {
*/
public ExpandedState(final int defaultExpandedLevels) {
this.defaultExpandedLevels = defaultExpandedLevels;
- this.expandedSet = new HashSet<TreePath>();
- this.collapsedSet = new HashSet<TreePath>();
+ this.expandedSet = new HashSet<>();
+ this.collapsedSet = new HashSet<>();
}
/**
@@ -127,7 +127,7 @@ public class ExpandedState implements Serializable {
* @param level The level to expand.
*/
public void expand(final int level) {
- final ArrayList<TreePath> toRemove = new ArrayList<TreePath>();
+ final ArrayList<TreePath> toRemove = new ArrayList<>();
if (level > defaultExpandedLevels) {
defaultExpandedLevels = level;
for (final TreePath treePath : expandedSet) {
@@ -189,7 +189,7 @@ public class ExpandedState implements Serializable {
// to use a symmetric algorithm like in expand
count--;
- final ArrayList<TreePath> toRemove = new ArrayList<TreePath>();
+ final ArrayList<TreePath> toRemove = new ArrayList<>();
if (count < defaultExpandedLevels) {
defaultExpandedLevels = count;
for (final TreePath treePath : collapsedSet) {
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/model/SelectedState.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/model/SelectedState.java
index 7fec7ef..4a1fe59 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/model/SelectedState.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/model/SelectedState.java
@@ -29,7 +29,7 @@ import java.util.Set;
// TODO: might be renamed to SelectedTreeState?
public class SelectedState implements Serializable {
- private Set<TreePath> selected = new HashSet<TreePath>();
+ private Set<TreePath> selected = new HashSet<>();
/**
* Checks if the given is selected.
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/model/SheetState.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/model/SheetState.java
index 6c5df2e..e210e23 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/model/SheetState.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/model/SheetState.java
@@ -56,7 +56,7 @@ public class SheetState implements Serializable, ScrollPositionState {
sortedColumnId = null;
ascending = true;
toBeSorted = false;
- columnWidths = new ArrayList<Integer>();
+ columnWidths = new ArrayList<>();
resetSelected();
if (expandedState != null) {
expandedState.reset();
@@ -72,7 +72,7 @@ public class SheetState implements Serializable, ScrollPositionState {
}
public void resetSelected() {
- selectedRows = new ArrayList<Integer>();
+ selectedRows = new ArrayList<>();
}
public List<Integer> getSelectedRows() {
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/model/TreeNodeDataModel.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/model/TreeNodeDataModel.java
index c549093..f1dc970 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/model/TreeNodeDataModel.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/model/TreeNodeDataModel.java
@@ -53,8 +53,8 @@ public class TreeNodeDataModel extends TreeDataModel {
public TreeNodeDataModel(final TreeNode data, final boolean showRoot, final ExpandedState expandedState) {
this.data = data;
this.showRoot = showRoot;
- this.mapping = new HashMap<Integer, Data>();
- this.back = new HashMap<TreeNode, Integer>();
+ this.mapping = new HashMap<>();
+ this.back = new HashMap<>();
this.expandedState = expandedState;
reset();
}
@@ -251,7 +251,7 @@ public class TreeNodeDataModel extends TreeDataModel {
public List<Integer> getRowIndicesOfChildren() {
final TreeNode node = getRowData();
final int n = node.getChildCount();
- final List<Integer> children = new ArrayList<Integer>(n);
+ final List<Integer> children = new ArrayList<>(n);
for (int i = 0; i < n; i++) {
final Integer integer = back.get(node.getChildAt(i));
if (integer != null) { // integer == null happens, when the node is not expanded
@@ -264,7 +264,7 @@ public class TreeNodeDataModel extends TreeDataModel {
@Override
public List<Boolean> getJunctions() {
TreeNode node = getRowData();
- final List<Boolean> junctions = new Stack<Boolean>();
+ final List<Boolean> junctions = new Stack<>();
while (node != null) {
junctions.add(hasNextSibling(node));
node = node.getParent();
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/model/TreePath.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/model/TreePath.java
index b1097f7..649d55f 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/model/TreePath.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/model/TreePath.java
@@ -72,7 +72,7 @@ public class TreePath implements Serializable {
}
TreeNode p = node;
- final List<TreeNode> list = new ArrayList<TreeNode>();
+ final List<TreeNode> list = new ArrayList<>();
int n = 0;
while (p != null) {
list.add(p);
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/TobagoRenderKit.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/TobagoRenderKit.java
index c7cf203..05f035b 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/TobagoRenderKit.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/TobagoRenderKit.java
@@ -50,7 +50,7 @@ public class TobagoRenderKit extends RenderKit {
private final RenderKit htmlBasicRenderKit;
- private Map<Key, Renderer> renderers = new HashMap<Key, Renderer>();
+ private Map<Key, Renderer> renderers = new HashMap<>();
public TobagoRenderKit() {
RenderKitFactory rkFactory = (RenderKitFactory) FactoryFinder.getFactory(FactoryFinder.RENDER_KIT_FACTORY);
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/FontAwesomeIconEncoder.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/FontAwesomeIconEncoder.java
index 7a8a304..5e71815 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/FontAwesomeIconEncoder.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/FontAwesomeIconEncoder.java
@@ -48,7 +48,7 @@ public class FontAwesomeIconEncoder implements IconEncoder {
private static final EnumMap<Icons, CssItem> ICONS;
static {
- ICONS = new EnumMap<Icons, CssItem>(Icons.class);
+ ICONS = new EnumMap<>(Icons.class);
for (Icons icon : Icons.values()) {
ICONS.put(icon, new FontAwesomeCssItem("fa-" + icon.name().toLowerCase().replaceAll("_", "-")));
}
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/TobagoClass.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/TobagoClass.java
index 894da23..d51ac70 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/TobagoClass.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/TobagoClass.java
@@ -234,7 +234,7 @@ public enum TobagoClass implements CssItem {
@Preliminary
public CssItem[] createMarkup(final Markup markup) {
if (markup != null) {
- final List<CssItem> markups = new ArrayList<CssItem>();
+ final List<CssItem> markups = new ArrayList<>();
for (final String markupString : markup) {
markups.add(new MarkupClass(this, markupString));
}
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/html/HtmlElements.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/html/HtmlElements.java
index bf5ee12..b811917 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/html/HtmlElements.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/html/HtmlElements.java
@@ -137,8 +137,8 @@ public enum HtmlElements {
private final boolean voidElement;
private final boolean inlineElement;
- private static final Set<String> VOIDS = new HashSet<String>();
- private static final Set<String> INLINES = new HashSet<String>();
+ private static final Set<String> VOIDS = new HashSet<>();
+ private static final Set<String> INLINES = new HashSet<>();
HtmlElements(final String value, final Qualifier... qualifiers) {
this.value = value;
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/util/AjaxUtils.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/util/AjaxUtils.java
index de2aa91..0399eaf 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/util/AjaxUtils.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/util/AjaxUtils.java
@@ -65,7 +65,7 @@ public class AjaxUtils {
}
public static Set<String> getRenderIds(final FacesContext facesContext) {
- return new HashSet<String>(facesContext.getPartialViewContext().getRenderIds());
+ return new HashSet<>(facesContext.getPartialViewContext().getRenderIds());
}
public static void navigate(FacesContext facesContext, Object outcome) {
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ComponentUtils.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ComponentUtils.java
index 9e1e84e..c6dec3d 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ComponentUtils.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ComponentUtils.java
@@ -232,7 +232,7 @@ public final class ComponentUtils {
* It does not find sub forms of sub forms.
*/
public static List<AbstractUIForm> findSubForms(final UIComponent component) {
- final List<AbstractUIForm> collect = new ArrayList<AbstractUIForm>();
+ final List<AbstractUIForm> collect = new ArrayList<>();
findSubForms(collect, component);
return collect;
}
@@ -303,7 +303,7 @@ public final class ComponentUtils {
*/
public static <T extends UIComponent> List<T> findDescendantList(final UIComponent component, final Class<T> type) {
- final List<T> result = new ArrayList<T>();
+ final List<T> result = new ArrayList<>();
for (final UIComponent child : component.getChildren()) {
if (type.isAssignableFrom(child.getClass())) {
@@ -648,7 +648,7 @@ public final class ComponentUtils {
*/
public static String evaluateClientIds(
final FacesContext context, final UIComponent component, final String[] componentIds) {
- final List<String> result = new ArrayList<String>(componentIds.length);
+ final List<String> result = new ArrayList<>(componentIds.length);
for (final String id : componentIds) {
if (!StringUtils.isBlank(id)) {
final String clientId = evaluateClientId(context, component, id);
@@ -801,7 +801,7 @@ public final class ComponentUtils {
public static void putDataAttribute(final UIComponent component, final Object name, final Object value) {
Map<Object, Object> map = getDataAttributes(component);
if (map == null) {
- map = new HashMap<Object, Object>();
+ map = new HashMap<>();
component.getAttributes().put(DATA_ATTRIBUTES_KEY, map);
}
if (map.containsKey(name)) {
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/util/LocaleUtils.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/util/LocaleUtils.java
index a0767e8..9dcfa89 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/util/LocaleUtils.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/util/LocaleUtils.java
@@ -57,7 +57,7 @@ public final class LocaleUtils {
public static List<Locale> getLocaleList(final Locale locale) {
String string = locale.toString();
- final List<Locale> locales = new ArrayList<Locale>(3);
+ final List<Locale> locales = new ArrayList<>(3);
locales.add(locale);
int underscore;
while ((underscore = string.lastIndexOf('_')) > 0) {
@@ -81,7 +81,7 @@ public final class LocaleUtils {
String string = locale.toString();
final String prefix = "_";
- final List<String> locales = new ArrayList<String>(4);
+ final List<String> locales = new ArrayList<>(4);
locales.add(prefix + string);
int underscore;
while ((underscore = string.lastIndexOf('_')) > 0) {
diff --git a/tobago-core/src/test/java/org/apache/myfaces/tobago/component/AbstractGeneratedUIComponentsUnitTest.java b/tobago-core/src/test/java/org/apache/myfaces/tobago/component/AbstractGeneratedUIComponentsUnitTest.java
index 31a3940..f3c70cd 100644
--- a/tobago-core/src/test/java/org/apache/myfaces/tobago/component/AbstractGeneratedUIComponentsUnitTest.java
+++ b/tobago-core/src/test/java/org/apache/myfaces/tobago/component/AbstractGeneratedUIComponentsUnitTest.java
@@ -51,12 +51,12 @@ public class AbstractGeneratedUIComponentsUnitTest {
final String packageName = this.getClass().getPackage().getName();
final String path = packageName.replace('.', '/');
final Enumeration<URL> resources = classLoader.getResources(path);
- final List<File> directories = new ArrayList<File>();
+ final List<File> directories = new ArrayList<>();
while (resources.hasMoreElements()) {
final URL resource = resources.nextElement();
directories.add(new File(resource.getFile()));
}
- final ArrayList<Class<? extends UIComponent>> result = new ArrayList<Class<? extends UIComponent>>();
+ final ArrayList<Class<? extends UIComponent>> result = new ArrayList<>();
for (final File directory : directories) {
final File[] files = directory.listFiles();
if (files != null) {
diff --git a/tobago-core/src/test/java/org/apache/myfaces/tobago/component/MethodOverwritingOfGeneratedUIComponentsUnitTest.java b/tobago-core/src/test/java/org/apache/myfaces/tobago/component/MethodOverwritingOfGeneratedUIComponentsUnitTest.java
index 7d090c9..950bf94 100644
--- a/tobago-core/src/test/java/org/apache/myfaces/tobago/component/MethodOverwritingOfGeneratedUIComponentsUnitTest.java
+++ b/tobago-core/src/test/java/org/apache/myfaces/tobago/component/MethodOverwritingOfGeneratedUIComponentsUnitTest.java
@@ -85,7 +85,7 @@ public class MethodOverwritingOfGeneratedUIComponentsUnitTest extends AbstractGe
private static class MethodOfComponentList {
- private List<String> list = new ArrayList<String>();
+ private List<String> list = new ArrayList<>();
public void add(final String method, final Class<? extends UIComponent> component) {
list.add(concatenate(method, component));
diff --git a/tobago-core/src/test/java/org/apache/myfaces/tobago/component/UISheetUnitTest.java b/tobago-core/src/test/java/org/apache/myfaces/tobago/component/UISheetUnitTest.java
index e1f2058..1362e71 100644
--- a/tobago-core/src/test/java/org/apache/myfaces/tobago/component/UISheetUnitTest.java
+++ b/tobago-core/src/test/java/org/apache/myfaces/tobago/component/UISheetUnitTest.java
@@ -40,7 +40,7 @@ public class UISheetUnitTest extends AbstractTobagoTestBase {
@Before
public void setUp() throws Exception {
super.setUp();
- nineRows = new ArrayList<String>();
+ nineRows = new ArrayList<>();
Collections.addAll(nineRows, DATA);
data = new UISheet();
diff --git a/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/config/TobagoConfigMergingUnitTest.java b/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/config/TobagoConfigMergingUnitTest.java
index 9505a5e..a9566bc 100644
--- a/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/config/TobagoConfigMergingUnitTest.java
+++ b/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/config/TobagoConfigMergingUnitTest.java
@@ -136,7 +136,7 @@ public class TobagoConfigMergingUnitTest {
public static TobagoConfigImpl loadAndMerge(final String... names)
throws IOException, SAXException, ParserConfigurationException, URISyntaxException {
- final List<TobagoConfigFragment> list = new ArrayList<TobagoConfigFragment>();
+ final List<TobagoConfigFragment> list = new ArrayList<>();
for (final String name : names) {
final URL url = TobagoConfigMergingUnitTest.class.getClassLoader().getResource(name);
diff --git a/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/config/TobagoConfigParserUnitTest.java b/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/config/TobagoConfigParserUnitTest.java
index 727e5b3..f0b0027 100644
--- a/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/config/TobagoConfigParserUnitTest.java
+++ b/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/config/TobagoConfigParserUnitTest.java
@@ -169,7 +169,7 @@ public class TobagoConfigParserUnitTest {
@Test
public void testUniqueness() throws IllegalAccessException {
final Field[] all = TobagoConfigParser.class.getFields();
- final List<Field> fields = new ArrayList<Field>();
+ final List<Field> fields = new ArrayList<>();
for (final Field field : all) {
if (field.getType().equals(Integer.TYPE)) {
fields.add(field);
@@ -177,7 +177,7 @@ public class TobagoConfigParserUnitTest {
}
// uniqueness
final TobagoConfigParser dummy = new TobagoConfigParser();
- final Set<Integer> hashCodes = new HashSet<Integer>();
+ final Set<Integer> hashCodes = new HashSet<>();
for (final Field field : fields) {
hashCodes.add(field.getInt(dummy));
}
diff --git a/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/config/TobagoConfigSorterUnitTest.java b/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/config/TobagoConfigSorterUnitTest.java
index 8d19fc2..61b9c7f 100644
--- a/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/config/TobagoConfigSorterUnitTest.java
+++ b/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/config/TobagoConfigSorterUnitTest.java
@@ -81,7 +81,7 @@ public class TobagoConfigSorterUnitTest {
n.getAfter().add("m");
- final List<TobagoConfigFragment> list = new ArrayList<TobagoConfigFragment>();
+ final List<TobagoConfigFragment> list = new ArrayList<>();
list.add(a);
list.add(b);
list.add(c);
@@ -137,7 +137,7 @@ public class TobagoConfigSorterUnitTest {
a.getBefore().add("b");
b.getBefore().add("a");
- final List<TobagoConfigFragment> list = new ArrayList<TobagoConfigFragment>();
+ final List<TobagoConfigFragment> list = new ArrayList<>();
list.add(a);
list.add(b);
@@ -174,7 +174,7 @@ public class TobagoConfigSorterUnitTest {
// after
a.getAfter().add("b");
- final List<TobagoConfigFragment> list = new ArrayList<TobagoConfigFragment>();
+ final List<TobagoConfigFragment> list = new ArrayList<>();
list.add(a);
list.add(b);
diff --git a/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/mock/servlet/MockHttpSession.java b/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/mock/servlet/MockHttpSession.java
index 864d463..312c1de 100644
--- a/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/mock/servlet/MockHttpSession.java
+++ b/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/mock/servlet/MockHttpSession.java
@@ -30,7 +30,7 @@ import java.util.Map;
public class MockHttpSession implements HttpSession {
- private Map<String, Object> attributes = new HashMap<String, Object>();
+ private Map<String, Object> attributes = new HashMap<>();
@Override
public Object getAttribute(final String s) {
diff --git a/tobago-core/src/test/java/org/apache/myfaces/tobago/renderkit/css/CssClassUtils.java b/tobago-core/src/test/java/org/apache/myfaces/tobago/renderkit/css/CssClassUtils.java
index 7433e93..e218e5b 100644
--- a/tobago-core/src/test/java/org/apache/myfaces/tobago/renderkit/css/CssClassUtils.java
+++ b/tobago-core/src/test/java/org/apache/myfaces/tobago/renderkit/css/CssClassUtils.java
@@ -34,7 +34,7 @@ class CssClassUtils {
*/
static List<CssItem> compareCss(final String cssFileName, final CssItem[] cssItems) throws FileNotFoundException {
- List<CssItem> missing = new ArrayList<CssItem>();
+ List<CssItem> missing = new ArrayList<>();
File cssFile = new File(cssFileName);
Assert.assertTrue(cssFile.exists());
diff --git a/tobago-example/tobago-example-data/src/main/java/org/apache/myfaces/tobago/example/data/LocaleList.java b/tobago-example/tobago-example-data/src/main/java/org/apache/myfaces/tobago/example/data/LocaleList.java
index a3b9850..d01491d 100644
--- a/tobago-example/tobago-example-data/src/main/java/org/apache/myfaces/tobago/example/data/LocaleList.java
+++ b/tobago-example/tobago-example-data/src/main/java/org/apache/myfaces/tobago/example/data/LocaleList.java
@@ -40,7 +40,7 @@ public class LocaleList {
public static final List<String> HOLIDAY;
static {
- final List<LocaleEntry> init = new ArrayList<LocaleEntry>();
+ final List<LocaleEntry> init = new ArrayList<>();
for (final Locale displayLocale : Locale.getAvailableLocales()) {
for (final Locale locale : Locale.getAvailableLocales()) {
init.add(new LocaleEntry(locale, displayLocale));
@@ -50,7 +50,7 @@ public class LocaleList {
}
static {
- final Set<String> init = new HashSet<String>();
+ final Set<String> init = new HashSet<>();
for (final LocaleEntry localeEntry : DATA) {
if (StringUtils.isNotBlank(localeEntry.getCountry())
&& StringUtils.isNotBlank(localeEntry.getLanguage())) {
@@ -58,19 +58,19 @@ public class LocaleList {
init.add(name);
}
}
- final ArrayList<String> list = new ArrayList<String>(init);
+ final ArrayList<String> list = new ArrayList<>(init);
Collections.sort(list);
COUNTRY_LANGUAGE = Collections.unmodifiableList(list);
}
static {
- final Set<String> init = new HashSet<String>();
+ final Set<String> init = new HashSet<>();
for (final LocaleEntry localeEntry : DATA) {
if (StringUtils.isNotBlank(localeEntry.getCountry())) {
init.add(localeEntry.getCountry());
}
}
- final ArrayList<String> list = new ArrayList<String>(init);
+ final ArrayList<String> list = new ArrayList<>(init);
Collections.sort(list);
COUNTRY = Collections.unmodifiableList(list);
}
diff --git a/tobago-example/tobago-example-data/src/main/java/org/apache/myfaces/tobago/example/data/Solar.java b/tobago-example/tobago-example-data/src/main/java/org/apache/myfaces/tobago/example/data/Solar.java
index a40af62..96f6cc4 100644
--- a/tobago-example/tobago-example-data/src/main/java/org/apache/myfaces/tobago/example/data/Solar.java
+++ b/tobago-example/tobago-example-data/src/main/java/org/apache/myfaces/tobago/example/data/Solar.java
@@ -28,7 +28,7 @@ public class Solar {
private List<Planet> planets;
public Solar() {
- planets = new ArrayList<Planet>();
+ planets = new ArrayList<>();
planets.add(new Planet(Planet.MARS));
}
diff --git a/tobago-example/tobago-example-data/src/main/java/org/apache/myfaces/tobago/example/data/SolarObject.java b/tobago-example/tobago-example-data/src/main/java/org/apache/myfaces/tobago/example/data/SolarObject.java
index 07893f2..b8f12d8 100644
--- a/tobago-example/tobago-example-data/src/main/java/org/apache/myfaces/tobago/example/data/SolarObject.java
+++ b/tobago-example/tobago-example-data/src/main/java/org/apache/myfaces/tobago/example/data/SolarObject.java
@@ -204,14 +204,14 @@ public class SolarObject {
public static List<SolarObject> getList() {
final SolarObject[] array = getArray();
- final List<SolarObject> list = new ArrayList<SolarObject>(array.length);
+ final List<SolarObject> list = new ArrayList<>(array.length);
Collections.addAll(list, array);
return list;
}
public static DefaultMutableTreeNode getTree() {
final SolarObject[] array = getArray();
- final Map<String, DefaultMutableTreeNode> cache = new HashMap<String, DefaultMutableTreeNode>();
+ final Map<String, DefaultMutableTreeNode> cache = new HashMap<>();
for (final SolarObject solar : array) {
final DefaultMutableTreeNode node = new DefaultMutableTreeNode(solar);
cache.put(solar.getName(), node);
@@ -226,7 +226,7 @@ public class SolarObject {
}
public static List<SolarObject> getSatellites(final String center) {
- final List<SolarObject> collect = new ArrayList<SolarObject>();
+ final List<SolarObject> collect = new ArrayList<>();
final SolarObject[] all = getArray();
for (final SolarObject anAll : all) {
if (anAll.getOrbit().equals(center)) {
diff --git a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/DemoController.java b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/DemoController.java
index 1d5e313..5a39e66 100644
--- a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/DemoController.java
+++ b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/DemoController.java
@@ -137,7 +137,7 @@ public class DemoController implements Serializable {
public void resetColumnWidths(final ActionEvent event) {
final UISheet sheet = (UISheet) event.getComponent().findComponent("sheet");
if (sheet != null) {
- sheet.getState().setColumnWidths(new ArrayList<Integer>());
+ sheet.getState().setColumnWidths(new ArrayList<>());
} else {
LOG.warn("Didn't find sheet component!");
}
diff --git a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/EventController.java b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/EventController.java
index fa9fbfd..59b16ca 100644
--- a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/EventController.java
+++ b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/EventController.java
@@ -96,14 +96,14 @@ import java.util.TreeSet;
@Named
public class EventController implements Serializable {
- private List<EventsOnComponent> eventsOnComponents = new ArrayList<EventsOnComponent>();
+ private List<EventsOnComponent> eventsOnComponents = new ArrayList<>();
private EventsOnComponent selectedComponent;
private String eventName;
private int action = 0;
private int actionListener = 0;
private int ajaxListener = 0;
private int valueChangeListener = 0;
- private List<SolarObject> planets = new ArrayList<SolarObject>();
+ private List<SolarObject> planets = new ArrayList<>();
public EventController() {
eventsOnComponents.add(new EventsOnComponent(new UIBar()));
@@ -240,7 +240,7 @@ public class EventController implements Serializable {
public class EventsOnComponent {
private final String tagName;
- private final Collection<String> eventNames = new TreeSet<String>();
+ private final Collection<String> eventNames = new TreeSet<>();
EventsOnComponent(UIComponentBase component) {
final String simpleName = component.getClass().getSimpleName();
@@ -311,7 +311,7 @@ public class EventController implements Serializable {
}
public String getSpecialEvents() {
- Set<String> specialEventNames = new TreeSet<String>();
+ Set<String> specialEventNames = new TreeSet<>();
for (String eventName : eventNames) {
boolean isSpecialEvent = true;
diff --git a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/ForEachController.java b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/ForEachController.java
index 4201832..c848aae 100644
--- a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/ForEachController.java
+++ b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/ForEachController.java
@@ -74,10 +74,10 @@ public class ForEachController implements Serializable {
}
public String reset() {
- rivers = new ArrayList<River>(Arrays.asList(
- new River("Nile", 6853, 2830),
- new River("Amazon", 6437, 209000),
- new River("Yangtze", 6300, 30166)));
+ rivers = new ArrayList<>(Arrays.asList(
+ new River("Nile", 6853, 2830),
+ new River("Amazon", 6437, 209000),
+ new River("Yangtze", 6300, 30166)));
resetInputFields();
return null;
}
diff --git a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/InputSuggestController.java b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/InputSuggestController.java
index 17c18dc..cdeb5e7 100644
--- a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/InputSuggestController.java
+++ b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/InputSuggestController.java
@@ -88,7 +88,7 @@ public class InputSuggestController implements Serializable {
public List<SelectItem> getRegionItems() {
if (regionItems == null) {
- regionItems = new ArrayList<SelectItem>(17);
+ regionItems = new ArrayList<>(17);
regionItems.add(new SelectItem("Please select"));
regionItems.add(new SelectItem("Baden-Württemberg"));
regionItems.add(new SelectItem("Bayern"));
@@ -124,7 +124,7 @@ public class InputSuggestController implements Serializable {
if (prefix == null) {
prefix = "";
}
- final List<String> list = new ArrayList<String>();
+ final List<String> list = new ArrayList<>();
final int n = RandomUtils.nextInt(0, 10);
for (int i = 0; i < n; i++) {
list.add(prefix + i);
@@ -151,14 +151,14 @@ public class InputSuggestController implements Serializable {
}
private List<AutoSuggestItem> getSuggestItems(final String prefix, final boolean zip) {
- final List<AutoSuggestItem> items = new ArrayList<AutoSuggestItem>();
+ final List<AutoSuggestItem> items = new ArrayList<>();
for (final String[] dataRow : suggestData) {
if (zip) {
if (dataRow[1].startsWith(prefix)) {
final AutoSuggestItem item = new AutoSuggestItem();
item.setLabel(dataRow[0]);
item.setValue(dataRow[1]);
- final List<AutoSuggestExtensionItem> extensionItems = new ArrayList<AutoSuggestExtensionItem>(2);
+ final List<AutoSuggestExtensionItem> extensionItems = new ArrayList<>(2);
extensionItems.add(createExtensionItem("page:isCity", dataRow[2]));
if (dataRow[3] != null) {
extensionItems.add(createExtensionItem("page:isState", dataRow[3]));
@@ -171,7 +171,7 @@ public class InputSuggestController implements Serializable {
final AutoSuggestItem item = new AutoSuggestItem();
item.setLabel(dataRow[0]);
item.setValue(dataRow[2]);
- final List<AutoSuggestExtensionItem> extensionItems = new ArrayList<AutoSuggestExtensionItem>(2);
+ final List<AutoSuggestExtensionItem> extensionItems = new ArrayList<>(2);
extensionItems.add(createExtensionItem("page:isZip", dataRow[1]));
if (dataRow[3] != null) {
extensionItems.add(createExtensionItem("page:isState", dataRow[3]));
diff --git a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/NavigationTree.java b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/NavigationTree.java
index cfc7f50..2703ff2 100644
--- a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/NavigationTree.java
+++ b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/NavigationTree.java
@@ -67,10 +67,10 @@ public class NavigationTree implements Serializable {
// todo: refactor with Java EE 7
final ServletContext servletContext;
servletContext = (ServletContext) FacesContext.getCurrentInstance().getExternalContext().getContext();
- final List<String> list = locateResourcesInWar(servletContext, "/content", new ArrayList<String>());
+ final List<String> list = locateResourcesInWar(servletContext, "/content", new ArrayList<>());
list.add("/content/root-dummy.xhtml"); // helps to build the tree, this is not an existing file
- final List<NavigationNode> nodes = new ArrayList<NavigationNode>();
+ final List<NavigationNode> nodes = new ArrayList<>();
for (final String path : list) {
if (path.contains("/x-") || !path.contains(".xhtml")) {
@@ -89,7 +89,7 @@ public class NavigationTree implements Serializable {
// after sorting the first node is the root node.
root = nodes.get(0);
- final Map<String, NavigationNode> map = new HashMap<String, NavigationNode>();
+ final Map<String, NavigationNode> map = new HashMap<>();
// map.put(tree.getBranch(), tree);
for (final NavigationNode node : nodes) {
diff --git a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/SelectManyCheckboxController.java b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/SelectManyCheckboxController.java
index 1596dc1..580c746 100644
--- a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/SelectManyCheckboxController.java
+++ b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/SelectManyCheckboxController.java
@@ -29,8 +29,8 @@ import java.util.List;
@Named
public class SelectManyCheckboxController implements Serializable {
- private List<String> animals = new ArrayList<String>();
- private List<String> numbers = new ArrayList<String>();
+ private List<String> animals = new ArrayList<>();
+ private List<String> numbers = new ArrayList<>();
public List getAnimals() {
return animals;
diff --git a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/SelectManyListboxController.java b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/SelectManyListboxController.java
index 5d43970..e1133c9 100644
--- a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/SelectManyListboxController.java
+++ b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/SelectManyListboxController.java
@@ -31,9 +31,9 @@ import java.util.List;
@Named
public class SelectManyListboxController implements Serializable {
- private List<String> celestials = new ArrayList<String>();
+ private List<String> celestials = new ArrayList<>();
private SelectItem[] deserts;
- private List<String> selectedDeserts = new ArrayList<String>();
+ private List<String> selectedDeserts = new ArrayList<>();
public SelectManyListboxController() {
deserts = new SelectItem[]{
diff --git a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/SelectManyShuttleController.java b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/SelectManyShuttleController.java
index dd8fbca..e58370c 100644
--- a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/SelectManyShuttleController.java
+++ b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/SelectManyShuttleController.java
@@ -32,7 +32,7 @@ import java.util.List;
@Named
public class SelectManyShuttleController implements Serializable {
- private List<SolarObject> planets = new ArrayList<SolarObject>();
+ private List<SolarObject> planets = new ArrayList<>();
private SolarObject[] selectedPlanets = new SolarObject[0];
private List<String> stars = Arrays.asList("Proxima Centauri", "Alpha Centauri", "Wolf 359", "Sirius");
private String[] selectedStars = new String[0];
diff --git a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/ServerInfo.java b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/ServerInfo.java
index 25beb26..7c4fe0f 100644
--- a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/ServerInfo.java
+++ b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/ServerInfo.java
@@ -90,7 +90,7 @@ public class ServerInfo {
}
public List<Map.Entry<Object, Object>> getSystemPropertiesAsList() {
- return enabled ? new ArrayList<Map.Entry<Object, Object>>(getSystemProperties().entrySet()) : null;
+ return enabled ? new ArrayList<>(getSystemProperties().entrySet()) : null;
}
public String getVersion() {
diff --git a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/SheetConfig.java b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/SheetConfig.java
index fa65a76..8209e5e 100644
--- a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/SheetConfig.java
+++ b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/SheetConfig.java
@@ -55,7 +55,7 @@ public class SheetConfig {
sheetDirectPagingPosition = ShowPosition.center;
sheetPagePagingPosition = ShowPosition.right;
sheetPagingPositionItems = createSheetItems(ShowPosition.values());
- final Set<Selectable> selectableSupportedBySheet = new HashSet<Selectable>();
+ final Set<Selectable> selectableSupportedBySheet = new HashSet<>();
for (Selectable selectable : Selectable.values()) {
if (selectable.isSupportedBySheet()) {
selectableSupportedBySheet.add(selectable);
diff --git a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/SheetController.java b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/SheetController.java
index 7335da7..421b574 100644
--- a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/SheetController.java
+++ b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/SheetController.java
@@ -51,7 +51,7 @@ public class SheetController implements Serializable {
private static final SelectItem[] SHEET_SELECTABLE;
static {
- List<Selectable> collect = new ArrayList<Selectable>();
+ List<Selectable> collect = new ArrayList<>();
for (Selectable selectable : Selectable.values()) {
if (selectable.isSupportedBySheet()) {
collect.add(selectable);
@@ -76,7 +76,7 @@ public class SheetController implements Serializable {
public SheetController() {
solarList = SolarObject.getList();
- hugeSolarList = new ArrayList<SolarObject>();
+ hugeSolarList = new ArrayList<>();
for (int i = 1; i <= 12; i++) {
for (SolarObject solarObject : solarList) {
SolarObject solarObjectClone = new SolarObject(solarObject);
diff --git a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/SheetFilterController.java b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/SheetFilterController.java
index df7b447..b8f57b4 100644
--- a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/SheetFilterController.java
+++ b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/SheetFilterController.java
@@ -44,7 +44,7 @@ public class SheetFilterController extends SheetController implements Serializab
private static final Logger LOG = LoggerFactory.getLogger(SheetFilterController.class);
- private List<SolarObject> filteredSolarList = new ArrayList<SolarObject>();
+ private List<SolarObject> filteredSolarList = new ArrayList<>();
private SelectItem[] distanceItems;
private SelectItem[] minYearItems;
@@ -73,7 +73,7 @@ public class SheetFilterController extends SheetController implements Serializab
new SelectItem(new DistanceRange(1000000, Integer.MAX_VALUE), "1000000 < x")
};
- Set<Integer> years = new TreeSet<Integer>();
+ Set<Integer> years = new TreeSet<>();
for (SolarObject solarObject : getSolarList()) {
if (solarObject.getDiscoverYear() != null) {
years.add(solarObject.getDiscoverYear());
@@ -217,7 +217,7 @@ public class SheetFilterController extends SheetController implements Serializab
public List<String> getSuggestionSolarList() {
final String substring = nameSuggestionQuery != null ? nameSuggestionQuery : "";
LOG.info("Creating items for substring: '" + substring + "'");
- final List<String> result = new ArrayList<String>();
+ final List<String> result = new ArrayList<>();
for (final SolarObject solarObject : getSolarList()) {
String name = solarObject.getName();
if (StringUtils.containsIgnoreCase(name, substring)) {
diff --git a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/SuggestController.java b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/SuggestController.java
index 22599f5..74ca929 100644
--- a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/SuggestController.java
+++ b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/SuggestController.java
@@ -51,7 +51,7 @@ public class SuggestController implements Serializable {
public List<String> getLanguages() {
final String substring = query != null ? query : "";
LOG.info("Creating items for substring: '" + substring + "'");
- final List<String> result = new ArrayList<String>(LocaleList.COUNTRY_LANGUAGE.size());
+ final List<String> result = new ArrayList<>(LocaleList.COUNTRY_LANGUAGE.size());
for (final String name : LocaleList.COUNTRY_LANGUAGE) {
if (StringUtils.containsIgnoreCase(name, substring)) {
result.add(name);
@@ -74,7 +74,7 @@ public class SuggestController implements Serializable {
substring = "";
}
LOG.info("Creating items for substring: '" + substring + "'");
- final List<String> result = new ArrayList<String>();
+ final List<String> result = new ArrayList<>();
for (final String name : LocaleList.COUNTRY_LANGUAGE) {
if (StringUtils.containsIgnoreCase(name, substring)) {
result.add(name);
diff --git a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/TestController.java b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/TestController.java
index 0c011af..cc14903 100644
--- a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/TestController.java
+++ b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/TestController.java
@@ -56,7 +56,7 @@ public class TestController implements Serializable {
}
public List<String> getAllPages() {
- List<String> pages = new ArrayList<String>();
+ List<String> pages = new ArrayList<>();
final File rootDir = new File("src/main/webapp/content");
if (rootDir.exists()) {
@@ -68,7 +68,7 @@ public class TestController implements Serializable {
}
private List<String> getXHTMLs(File dir) {
- List<String> xhtmls = new ArrayList<String>();
+ List<String> xhtmls = new ArrayList<>();
for (File file : dir.listFiles()) {
if (file.isDirectory()) {
xhtmls.addAll(getXHTMLs(file));
@@ -80,7 +80,7 @@ public class TestController implements Serializable {
}
public List<TestPage> getTestPages() {
- List<TestPage> testPages = new ArrayList<TestPage>();
+ List<TestPage> testPages = new ArrayList<>();
int idCount = 1;
final File rootDir = new File("src/main/webapp/content");
@@ -94,7 +94,7 @@ public class TestController implements Serializable {
}
private List<String> getTestJs(File dir) {
- List<String> testJsFiles = new ArrayList<String>();
+ List<String> testJsFiles = new ArrayList<>();
for (File file : dir.listFiles()) {
if (file.isDirectory()) {
testJsFiles.addAll(getTestJs(file));
diff --git a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/ThemeController.java b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/ThemeController.java
index 348d968..8d5995e 100644
--- a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/ThemeController.java
+++ b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/ThemeController.java
@@ -41,7 +41,7 @@ public class ThemeController implements Serializable {
public ThemeController() {
final FacesContext facesContext = FacesContext.getCurrentInstance();
final TobagoConfig tobagoConfig = TobagoConfig.getInstance(facesContext);
- final List<Theme> themes = new ArrayList<Theme>(tobagoConfig.getSupportedThemes());
+ final List<Theme> themes = new ArrayList<>(tobagoConfig.getSupportedThemes());
themes.add(0, tobagoConfig.getDefaultTheme());
themeItems = new SelectItem[themes.size()];
for (int i = 0; i < themeItems.length; i++) {
diff --git a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/UploadController.java b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/UploadController.java
index 89e327b..824121a 100644
--- a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/UploadController.java
+++ b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/UploadController.java
@@ -43,7 +43,7 @@ public class UploadController implements Serializable {
private Part fileContentType;
private Part[] fileMulti;
private Part fileAjax;
- private List<UploadItem> uploadItems = new ArrayList<UploadItem>();
+ private List<UploadItem> uploadItems = new ArrayList<>();
public String uploadBasic() {
upload(fileBasic);
diff --git a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/bestpractice/ToolBarCustomizer.java b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/bestpractice/ToolBarCustomizer.java
index 61a0664..31bef28 100644
--- a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/bestpractice/ToolBarCustomizer.java
+++ b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/bestpractice/ToolBarCustomizer.java
@@ -40,10 +40,10 @@ public class ToolBarCustomizer implements Serializable {
}
public String resetList() {
- list = new ArrayList<Item>(Arrays.asList(
- new Item("new"),
- new Item("edit"),
- new Item("delete")
+ list = new ArrayList<>(Arrays.asList(
+ new Item("new"),
+ new Item("edit"),
+ new Item("delete")
));
return null;
diff --git a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/clientConfig/ClientConfigController.java b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/clientConfig/ClientConfigController.java
index 3bd5980..06c0fa7 100644
--- a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/clientConfig/ClientConfigController.java
+++ b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/clientConfig/ClientConfigController.java
@@ -51,7 +51,7 @@ public class ClientConfigController {
final FacesContext facesContext = FacesContext.getCurrentInstance();
final TobagoConfig tobagoConfig = TobagoConfig.getInstance(facesContext);
- final List<Theme> themes = new ArrayList<Theme>(tobagoConfig.getSupportedThemes());
+ final List<Theme> themes = new ArrayList<>(tobagoConfig.getSupportedThemes());
themes.add(0, tobagoConfig.getDefaultTheme());
themeItems = new SelectItem[themes.size()];
for (int i = 0; i < themeItems.length; i++) {
@@ -125,7 +125,7 @@ public class ClientConfigController {
final Iterator supportedLocales = application.getSupportedLocales();
boolean defaultInList = false;
- final List<SelectItem> localeItems = new ArrayList<SelectItem>();
+ final List<SelectItem> localeItems = new ArrayList<>();
while (supportedLocales.hasNext()) {
final Locale locale = (Locale) supportedLocales.next();
localeItems.add(createLocaleItem(locale));
diff --git a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/info/ActivityList.java b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/info/ActivityList.java
index db81edc..0560200 100644
--- a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/info/ActivityList.java
+++ b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/info/ActivityList.java
@@ -39,7 +39,7 @@ public class ActivityList implements Serializable {
// XXX using the session id as key is not good for applications with login, because the container should change
// XXX the session id while the login process.
- private Map<String, Activity> data = new ConcurrentHashMap<String, Activity>();
+ private Map<String, Activity> data = new ConcurrentHashMap<>();
public void add(final Activity activity) {
LOG.info("Adding session id: " + activity.getSessionId());
@@ -53,7 +53,7 @@ public class ActivityList implements Serializable {
public List<Activity> getValues() {
final Collection<Activity> values = data.values();
- final ArrayList<Activity> result = new ArrayList<Activity>();
+ final ArrayList<Activity> result = new ArrayList<>();
result.addAll(values);
return result;
}
diff --git a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/nonfacesrequest/FishPond.java b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/nonfacesrequest/FishPond.java
index 03e6a81..984bb7d 100644
--- a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/nonfacesrequest/FishPond.java
+++ b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/nonfacesrequest/FishPond.java
@@ -40,7 +40,7 @@ public class FishPond implements Serializable {
private Integer selectedFishId = null;
public FishPond() {
- fishes = new HashMap<Integer, String>();
+ fishes = new HashMap<>();
fishes.put(0, "Scholle");
fishes.put(1, "Hai");
fishes.put(2, "Luce");
diff --git a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/sudoku/Sudoku.java b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/sudoku/Sudoku.java
index 8930b4d..7b2a5d1 100644
--- a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/sudoku/Sudoku.java
+++ b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/sudoku/Sudoku.java
@@ -217,12 +217,12 @@ public class Sudoku {
private RandomList(final byte n) {
this.n = n;
- list = new ArrayList<Byte>(n);
+ list = new ArrayList<>(n);
shuffle();
}
public void shuffle() {
- final List<Byte> temp = new ArrayList<Byte>(n);
+ final List<Byte> temp = new ArrayList<>(n);
for (byte i = 0; i < n; i++) {
temp.add(i, i);
}
@@ -241,7 +241,7 @@ public class Sudoku {
}
public Stack<Byte> asStack() {
- final Stack<Byte> stack = new Stack<Byte>();
+ final Stack<Byte> stack = new Stack<>();
for (final Byte aByte : list) {
stack.add(aByte);
}
diff --git a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/test/ClientConfigController.java b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/test/ClientConfigController.java
index 2cd50b5..b71eeea 100644
--- a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/test/ClientConfigController.java
+++ b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/test/ClientConfigController.java
@@ -47,7 +47,7 @@ public class ClientConfigController implements Serializable {
final FacesContext facesContext = FacesContext.getCurrentInstance();
final TobagoConfig tobagoConfig = TobagoConfig.getInstance(facesContext);
- final List<Theme> themes = new ArrayList<Theme>(tobagoConfig.getSupportedThemes());
+ final List<Theme> themes = new ArrayList<>(tobagoConfig.getSupportedThemes());
themes.add(0, tobagoConfig.getDefaultTheme());
themeItems = new SelectItem[themes.size()];
for (int i = 0; i < themeItems.length; i++) {
@@ -86,7 +86,7 @@ public class ClientConfigController implements Serializable {
final Iterator supportedLocales = application.getSupportedLocales();
boolean defaultInList = false;
- final List<SelectItem> localeItems = new ArrayList<SelectItem>();
+ final List<SelectItem> localeItems = new ArrayList<>();
while (supportedLocales.hasNext()) {
final Locale locale = (Locale) supportedLocales.next();
localeItems.add(createLocaleItem(locale));
diff --git a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/test/DirectoryBrowser.java b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/test/DirectoryBrowser.java
index a2b1018..e402ec1 100644
--- a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/test/DirectoryBrowser.java
+++ b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/test/DirectoryBrowser.java
@@ -62,7 +62,7 @@ public class DirectoryBrowser implements Serializable {
return;
}
- final List<PageItem> list = new ArrayList<PageItem>();
+ final List<PageItem> list = new ArrayList<>();
for (final String childPath : resourcePaths) {
if (childPath.endsWith("/")) {
diff --git a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/test/DynamicBean.java b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/test/DynamicBean.java
index 2560576..5790501 100644
--- a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/test/DynamicBean.java
+++ b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/test/DynamicBean.java
@@ -27,7 +27,7 @@ import java.util.List;
public class DynamicBean implements Serializable {
- private List<DynamicPanel> panels = new ArrayList<DynamicPanel>();
+ private List<DynamicPanel> panels = new ArrayList<>();
public String addPanel() {
diff --git a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/test/InputSuggestController.java b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/test/InputSuggestController.java
index c87b665..80bc4d3 100644
--- a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/test/InputSuggestController.java
+++ b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/test/InputSuggestController.java
@@ -35,7 +35,7 @@ public class InputSuggestController implements Serializable {
public List<String> inputSuggestItems(final UIInput component) {
final String prefix = (String) component.getSubmittedValue();
LOG.info("Creating items for prefix :\"" + prefix + "\"");
- final List<String> li = new ArrayList<String>();
+ final List<String> li = new ArrayList<>();
li.add(prefix + 1);
li.add(prefix + 2);
li.add(prefix + 3);
diff --git a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/test/PopupReferenceController.java b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/test/PopupReferenceController.java
index f981545..2aaca06 100644
--- a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/test/PopupReferenceController.java
+++ b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/test/PopupReferenceController.java
@@ -39,7 +39,7 @@ public class PopupReferenceController implements Serializable {
public PopupReferenceController() {
- sheet = new ArrayList<Entry>();
+ sheet = new ArrayList<>();
for (int i = 0; i < 10; i++) {
final Entry tmp = new Entry();
tmp.setColumn1("cell__1__" + i);
diff --git a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/test/ScriptEvent.java b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/test/ScriptEvent.java
index f634e59..0fd08ef 100644
--- a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/test/ScriptEvent.java
+++ b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/test/ScriptEvent.java
@@ -25,7 +25,7 @@ import java.util.List;
public class ScriptEvent implements Serializable {
- private List<ScriptEventItem> items = new ArrayList<ScriptEventItem>();
+ private List<ScriptEventItem> items = new ArrayList<>();
public void onLoad() {
items.add(new ScriptEventItem("onload"));
diff --git a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/test/SelectManyListboxBean.java b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/test/SelectManyListboxBean.java
index 69b318d..c68a078 100644
--- a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/test/SelectManyListboxBean.java
+++ b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/test/SelectManyListboxBean.java
@@ -31,13 +31,13 @@ public class SelectManyListboxBean implements Serializable {
private List<String> stringList;
private String[] stringArray;
- private Set<String> stringSet = new HashSet<String>();
- private Collection<String> stringCollection = new LinkedList<String>();
+ private Set<String> stringSet = new HashSet<>();
+ private Collection<String> stringCollection = new LinkedList<>();
private List<Currency> currencyList;
private Currency[] currencyArray;
- private Set<Currency> currencySet = new HashSet<Currency>();
- private Collection<Currency> currencyCollection = new LinkedList<Currency>();
+ private Set<Currency> currencySet = new HashSet<>();
+ private Collection<Currency> currencyCollection = new LinkedList<>();
private Currency[] currencyItems;
diff --git a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/test/SheetController.java b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/test/SheetController.java
index c2f2377..83195f0 100644
--- a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/test/SheetController.java
+++ b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/test/SheetController.java
@@ -47,7 +47,7 @@ public class SheetController implements Serializable {
}
// Create a copy for sorting, because the LocaleList.DATA is not modifiable.
- private List<LocaleEntry> localeList = new ArrayList<LocaleEntry>(LocaleList.DATA);
+ private List<LocaleEntry> localeList = new ArrayList<>(LocaleList.DATA);
public SolarObject[] getSolarArray() {
return solarArray;
diff --git a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/test/SheetSortController.java b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/test/SheetSortController.java
index 269e110..8183277 100644
--- a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/test/SheetSortController.java
+++ b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/test/SheetSortController.java
@@ -42,7 +42,7 @@ public class SheetSortController implements Serializable {
}
private void init() {
- list = new ArrayList<Entry>();
+ list = new ArrayList<>();
for (int i = 0; i < 26; i++) {
list.add(new Entry(i));
}
diff --git a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/test/Shuttle.java b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/test/Shuttle.java
index aa8f1aa..eb37eec 100644
--- a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/test/Shuttle.java
+++ b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/test/Shuttle.java
@@ -30,7 +30,7 @@ public class Shuttle implements Serializable {
private List<String> value;
public Shuttle() {
- this.value = new ArrayList<String>();
+ this.value = new ArrayList<>();
}
public List<String> getValue() {
diff --git a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/test/TestPageFilter.java b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/test/TestPageFilter.java
index 50ea7eb..133d217 100644
--- a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/test/TestPageFilter.java
+++ b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/test/TestPageFilter.java
@@ -32,7 +32,7 @@ public class TestPageFilter {
".*\\.html"
);
- public static final Set<String> HIDDEN = new HashSet<String>(Arrays.asList(
+ public static final Set<String> HIDDEN = new HashSet<>(Arrays.asList(
"/META-INF/.*",
"/WEB-INF/.*",
"/script/.*",
@@ -50,7 +50,7 @@ public class TestPageFilter {
/**
* Internal pages and pages that are impossible to run.
*/
- public static final Set<String> DISABLED = new HashSet<String>(Arrays.asList(
+ public static final Set<String> DISABLED = new HashSet<>(Arrays.asList(
".*-fragment\\.xhtml", // intern
"/index.html", // intern
@@ -71,7 +71,7 @@ public class TestPageFilter {
/**
* Switched off temporary.
*/
- private static final Set<String> TODO = new HashSet<String>(Arrays.asList(
+ private static final Set<String> TODO = new HashSet<>(Arrays.asList(
"/test/gridLayout/scrolling-2-levels.*", // todo: ?
"/test/gridLayout/scrolling-tab.*", // todo: measurement problem with firefox?
"/test/treeListbox/*", // todo
diff --git a/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/NavigationUnitTest.java b/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/NavigationUnitTest.java
index 4c31fe9..c5db41c 100644
--- a/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/NavigationUnitTest.java
+++ b/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/NavigationUnitTest.java
@@ -30,7 +30,7 @@ import java.util.List;
public class NavigationUnitTest extends AbstractTobagoTestBase {
- private static final List<String> LIST = new ArrayList<String>(Arrays.asList(
+ private static final List<String> LIST = new ArrayList<>(Arrays.asList(
"/content/00/test-1.xhtml",
"/content/00/07/test-2.xhtml",
"/content/01/test.xhtml",
diff --git a/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/QUnitTests.java b/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/QUnitTests.java
index 2cd3f55..f284c51 100644
--- a/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/QUnitTests.java
+++ b/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/QUnitTests.java
@@ -51,7 +51,7 @@ import java.util.List;
public class QUnitTests {
private static final Logger LOG = LoggerFactory.getLogger(QUnitTests.class);
- private static List<String> testedPages = new LinkedList<String>();
+ private static List<String> testedPages = new LinkedList<>();
@Drone
private WebDriver browser;
@@ -278,7 +278,7 @@ public class QUnitTests {
}
private static List<String> getXHTMLs(File dir) {
- List<String> xhtmls = new ArrayList<String>();
+ List<String> xhtmls = new ArrayList<>();
for (File file : dir.listFiles()) {
if (file.isDirectory()) {
xhtmls.addAll(getXHTMLs(file));
@@ -290,7 +290,7 @@ public class QUnitTests {
}
private List<String> ignorePages() {
- List<String> ignore = new ArrayList<String>();
+ List<String> ignore = new ArrayList<>();
//PhantomJs miscalculate the height of the dropdown box
ignore.add("content/40-test/3000-sheet/10-sheet-types/sheet-types.xhtml");
// Works only for larger browser window
diff --git a/tobago-theme/tobago-theme-standard/src/test/java/org/apache/myfaces/tobago/renderkit/css/BootstrapClassUnitTest.java b/tobago-theme/tobago-theme-standard/src/test/java/org/apache/myfaces/tobago/renderkit/css/BootstrapClassUnitTest.java
index a4eb23e..1af7455 100644
--- a/tobago-theme/tobago-theme-standard/src/test/java/org/apache/myfaces/tobago/renderkit/css/BootstrapClassUnitTest.java
+++ b/tobago-theme/tobago-theme-standard/src/test/java/org/apache/myfaces/tobago/renderkit/css/BootstrapClassUnitTest.java
@@ -69,7 +69,7 @@ public class BootstrapClassUnitTest {
public void testCompareBootstrapCss() throws FileNotFoundException, NoSuchFieldException {
final BootstrapClass[] allValues = BootstrapClass.values();
- final List<BootstrapClass> toCheck = new ArrayList<BootstrapClass>();
+ final List<BootstrapClass> toCheck = new ArrayList<>();
for (BootstrapClass value : allValues) {
boolean ignoreByTest = BootstrapClass.class.getField(value.name()).isAnnotationPresent(Deprecated.class);
if (!ignoreByTest) {
diff --git a/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/generate/ClassInfo.java b/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/generate/ClassInfo.java
index b43b7b0..138add6 100644
--- a/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/generate/ClassInfo.java
+++ b/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/generate/ClassInfo.java
@@ -28,7 +28,7 @@ public class ClassInfo {
private String packageName;
private Imports imports;
private String superClassName;
- private Set<String> interfaces = new HashSet<String>();
+ private Set<String> interfaces = new HashSet<>();
private String sourceClass;
public ClassInfo(final String sourceClass, final String qualifiedName) {
diff --git a/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/generate/ClassUtils.java b/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/generate/ClassUtils.java
index fc48718..e2a6f3d 100644
--- a/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/generate/ClassUtils.java
+++ b/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/generate/ClassUtils.java
@@ -27,7 +27,7 @@ public class ClassUtils {
private static final Map<String, Class> PRIMITIVE_MAP;
static {
- PRIMITIVE_MAP = new HashMap<String, Class>(8);
+ PRIMITIVE_MAP = new HashMap<>(8);
PRIMITIVE_MAP.put("boolean", Boolean.class);
PRIMITIVE_MAP.put("byte", Byte.class);
PRIMITIVE_MAP.put("char", Character.class);
diff --git a/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/generate/ComponentInfo.java b/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/generate/ComponentInfo.java
index 4ae37e4..786eb00 100644
--- a/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/generate/ComponentInfo.java
+++ b/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/generate/ComponentInfo.java
@@ -27,14 +27,14 @@ import java.util.ArrayList;
import java.util.List;
public class ComponentInfo extends TagInfo {
- private List<PropertyInfo> nonTransientProperties = new ArrayList<PropertyInfo>();
- private List<PropertyInfo> transientProperties = new ArrayList<PropertyInfo>();
+ private List<PropertyInfo> nonTransientProperties = new ArrayList<>();
+ private List<PropertyInfo> transientProperties = new ArrayList<>();
private boolean messages;
private String description;
private boolean deprecated;
private int index = 0;
private int nonTransientIndex = 0;
- private List<String> behaviors = new ArrayList<String>();
+ private List<String> behaviors = new ArrayList<>();
private String defaultBehavior;
public ComponentInfo(final TypeElement declaration, final UIComponentTag componentTag) {
diff --git a/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/generate/Imports.java b/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/generate/Imports.java
index 1d0e071..a76d674 100644
--- a/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/generate/Imports.java
+++ b/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/generate/Imports.java
@@ -25,7 +25,7 @@ import java.util.Set;
public class Imports {
- private Set<String> imports = new TreeSet<String>();
+ private Set<String> imports = new TreeSet<>();
private String packageName;
diff --git a/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/generate/TagInfo.java b/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/generate/TagInfo.java
index 6f45804..de60885 100644
--- a/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/generate/TagInfo.java
+++ b/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/generate/TagInfo.java
@@ -24,7 +24,7 @@ import java.util.List;
public class TagInfo extends RendererInfo {
- private List<PropertyInfo> properties = new ArrayList<PropertyInfo>();
+ private List<PropertyInfo> properties = new ArrayList<>();
private String componentClassName;
private String componentType;
private String componentFamily;
diff --git a/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/processor/AbstractGenerator.java b/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/processor/AbstractGenerator.java
index eb404cf..9cb5f92 100644
--- a/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/processor/AbstractGenerator.java
+++ b/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/processor/AbstractGenerator.java
@@ -56,8 +56,8 @@ public abstract class AbstractGenerator extends AbstractProcessor {
return false;
}
- types = new ArrayList<TypeElement>();
- packages = new ArrayList<PackageElement>();
+ types = new ArrayList<>();
+ packages = new ArrayList<>();
for (final TypeElement element : annotations) {
final Collection<? extends Element> elementsAnnotatedWith = roundEnv
.getElementsAnnotatedWith(element);
diff --git a/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/processor/CheckstyleConfigGenerator.java b/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/processor/CheckstyleConfigGenerator.java
index f4bad93..9e34590 100644
--- a/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/processor/CheckstyleConfigGenerator.java
+++ b/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/processor/CheckstyleConfigGenerator.java
@@ -69,7 +69,7 @@ public class CheckstyleConfigGenerator extends AbstractGenerator {
static final String TARGET_CHECKSTYLE = "targetCheckstyle";
- private Set<String> tagSet = new HashSet<String>();
+ private Set<String> tagSet = new HashSet<>();
private String targetCheckstyle;
@@ -187,7 +187,7 @@ public class CheckstyleConfigGenerator extends AbstractGenerator {
}
private void resetDuplicateList() {
- tagSet = new HashSet<String>();
+ tagSet = new HashSet<>();
}
protected void addAttributesForTag(
@@ -195,7 +195,7 @@ public class CheckstyleConfigGenerator extends AbstractGenerator {
final Document document)
throws ClassNotFoundException {
- List<String> attributes = new ArrayList<String>();
+ List<String> attributes = new ArrayList<>();
for (final javax.lang.model.element.Element element : getAllMembers(type)) {
if (element instanceof ExecutableElement) {
final ExecutableElement executableElement = (ExecutableElement) element;
diff --git a/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/processor/ClassesGenerator.java b/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/processor/ClassesGenerator.java
index faf6482..2112e5f 100644
--- a/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/processor/ClassesGenerator.java
+++ b/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/processor/ClassesGenerator.java
@@ -76,7 +76,7 @@ public class ClassesGenerator extends AbstractGenerator {
final Reader componentReader = new InputStreamReader(componentStream);
componentStringTemplateGroup = new StringTemplateGroup(componentReader);
- ignoredProperties = new HashSet<String>();
+ ignoredProperties = new HashSet<>();
ignoredProperties.add("id");
ignoredProperties.add("rendered");
ignoredProperties.add("binding");
@@ -98,7 +98,7 @@ public class ClassesGenerator extends AbstractGenerator {
private void createTagOrComponent(final TypeElement declaration) throws IOException, ClassNotFoundException {
final UIComponentTag componentTag = declaration.getAnnotation(UIComponentTag.class);
- final Map<String, PropertyInfo> properties = new HashMap<String, PropertyInfo>();
+ final Map<String, PropertyInfo> properties = new HashMap<>();
addProperties(declaration, properties);
if (componentTag.generate()) {
diff --git a/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/processor/FacesConfigGenerator.java b/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/processor/FacesConfigGenerator.java
index e06142c..dd57bbb 100644
--- a/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/processor/FacesConfigGenerator.java
+++ b/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/processor/FacesConfigGenerator.java
@@ -128,7 +128,7 @@ public class FacesConfigGenerator extends AbstractGenerator {
private static final String CLIENT_BEHAVIOR_RENDERER_CLASS = "client-behavior-renderer-class";
*/
- private static final Set<String> IGNORED_PROPERTIES = new HashSet<String>(Collections.singletonList("binding"));
+ private static final Set<String> IGNORED_PROPERTIES = new HashSet<>(Collections.singletonList("binding"));
private String sourceFacesConfigFile;
private String targetFacesConfigFile;
@@ -172,10 +172,10 @@ public class FacesConfigGenerator extends AbstractGenerator {
applyNamespace(rootElement, namespace);
final List<org.jdom2.Element> components = rootElement.getChildren(COMPONENT, namespace);
- final List<org.jdom2.Element> newComponents = new ArrayList<org.jdom2.Element>();
- final List<org.jdom2.Element> newRenderer = new ArrayList<org.jdom2.Element>();
- final List<org.jdom2.Element> newConverters = new ArrayList<org.jdom2.Element>();
- final List<org.jdom2.Element> newValidators = new ArrayList<org.jdom2.Element>();
+ final List<org.jdom2.Element> newComponents = new ArrayList<>();
+ final List<org.jdom2.Element> newRenderer = new ArrayList<>();
+ final List<org.jdom2.Element> newConverters = new ArrayList<>();
+ final List<org.jdom2.Element> newValidators = new ArrayList<>();
for (final TypeElement element : getTypes()) {
if (element.getAnnotation(UIComponentTag.class) != null) {
@@ -187,7 +187,7 @@ public class FacesConfigGenerator extends AbstractGenerator {
}
}
- final List<org.jdom2.Element> elementsToAdd = new ArrayList<org.jdom2.Element>();
+ final List<org.jdom2.Element> elementsToAdd = new ArrayList<>();
// sort out duplicates
for (final org.jdom2.Element newElement : newComponents) {
final boolean found = containsElement(components, newElement);
@@ -601,8 +601,8 @@ public class FacesConfigGenerator extends AbstractGenerator {
if (element != null) {
if (!containsElement(components, element)) {
addFacets(componentTag, namespace, element);
- final List<org.jdom2.Element> attributes = new ArrayList<org.jdom2.Element>();
- final List<org.jdom2.Element> properties = new ArrayList<org.jdom2.Element>();
+ final List<org.jdom2.Element> attributes = new ArrayList<>();
+ final List<org.jdom2.Element> properties = new ArrayList<>();
addAttributes(typeElement, attributes, properties, namespace);
if (!attributes.isEmpty()) {
attributes.sort(Comparator.comparing(d -> d.getChildText(ATTRIBUTE_NAME, namespace)));
diff --git a/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/processor/TaglibGenerator.java b/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/processor/TaglibGenerator.java
index 46b4bd2..5495c84 100644
--- a/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/processor/TaglibGenerator.java
+++ b/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/processor/TaglibGenerator.java
@@ -73,8 +73,8 @@ public class TaglibGenerator extends AbstractGenerator {
static final String TARGET_TAGLIB = "targetTaglib";
- private Set<String> tagSet = new HashSet<String>();
- private Set<String> attributeSet = new HashSet<String>();
+ private Set<String> tagSet = new HashSet<>();
+ private Set<String> attributeSet = new HashSet<>();
private String currentTag;
private String targetTaglib;
@@ -392,11 +392,11 @@ public class TaglibGenerator extends AbstractGenerator {
}
private void resetDuplicateList() {
- tagSet = new HashSet<String>();
+ tagSet = new HashSet<>();
}
private void resetAttributeDuplicateList() {
- attributeSet = new HashSet<String>();
+ attributeSet = new HashSet<>();
}
protected void addAttribute(
--
To stop receiving notification emails like this one, please contact
"commits@myfaces.apache.org" <co...@myfaces.apache.org>.