refactored / initial capacity
diff --git a/api/src/main/java/javax/faces/FactoryFinder.java b/api/src/main/java/javax/faces/FactoryFinder.java
index 70b6163..4719049 100755
--- a/api/src/main/java/javax/faces/FactoryFinder.java
+++ b/api/src/main/java/javax/faces/FactoryFinder.java
@@ -85,7 +85,7 @@
* corresponding maps in _factories.
*/
private static Map<ClassLoader, Map<String, List<String>>> registeredFactoryNames
- = new HashMap<ClassLoader, Map<String, List<String>>>();
+ = new HashMap<ClassLoader, Map<String, List<String>>>(5);
/**
* Maps from classLoader to another map, the container (i.e. Tomcat) will create a class loader for each web app
@@ -96,7 +96,7 @@
* name, i.e. FactoryFinder.setFactory(FactoryFinder.APPLICATION_FACTORY, MyFactory.class).
*/
private static Map<ClassLoader, Map<String, Object>> factories
- = new HashMap<ClassLoader, Map<String, Object>>();
+ = new HashMap<ClassLoader, Map<String, Object>>(5);
static
{
@@ -301,7 +301,7 @@
Object injectionProvider;
synchronized (factoryClassNames)
{
- beanEntryStorage = (List)factoryMap.computeIfAbsent(INJECTED_BEAN_STORAGE_KEY,
+ beanEntryStorage = (List) factoryMap.computeIfAbsent(INJECTED_BEAN_STORAGE_KEY,
k -> new CopyOnWriteArrayList());
factory = factoryMap.get(factoryName);
diff --git a/api/src/main/java/javax/faces/component/UIComponent.java b/api/src/main/java/javax/faces/component/UIComponent.java
index 24d1766..97e7189 100755
--- a/api/src/main/java/javax/faces/component/UIComponent.java
+++ b/api/src/main/java/javax/faces/component/UIComponent.java
@@ -691,8 +691,7 @@
throw new NullPointerException("name can not be null");
}
- Map<String, Object> bindings = (Map<String, Object>) getStateHelper().
- get(PropertyKeys.bindings);
+ Map<String, Object> bindings = (Map<String, Object>) getStateHelper().get(PropertyKeys.bindings);
if (bindings != null)
{
return (ValueExpression) bindings.get(name);
@@ -821,8 +820,7 @@
// Do it inside UIComponent.processEvent() is better because in facelets
// UILeaf we can skip this part just overriding the method.
- List<SystemEventListener> listeners = this.getListenersForEventClass(
- PostRestoreStateEvent.class);
+ List<SystemEventListener> listeners = this.getListenersForEventClass(PostRestoreStateEvent.class);
if (!listeners.isEmpty())
{
for (int i = 0, size = listeners.size(); i < size; i++)
@@ -909,7 +907,6 @@
if (_systemEventListenerClassMap != null)
{
List<SystemEventListener> listeners = _systemEventListenerClassMap.get(eventClass);
-
if (listeners != null && !listeners.isEmpty())
{
for (Iterator<SystemEventListener> it = listeners.iterator(); it.hasNext(); )
@@ -1153,7 +1150,7 @@
else
{
UIComponent previousCompositeComponent = null;
- for (int i = componentStack.size()-1; i >= 0; i--)
+ for (int i = componentStack.size() - 1; i >= 0; i--)
{
UIComponent component = componentStack.get(i);
if (component._isCompositeComponent())
@@ -1246,7 +1243,7 @@
}
else
{
- List<UIComponent> componentStack= (List<UIComponent>) contextAttributes.computeIfAbsent(
+ List<UIComponent> componentStack = (List<UIComponent>) contextAttributes.computeIfAbsent(
UIComponent._COMPONENT_STACK, k -> new ArrayList<>());
componentStack.add(component);
if (component._isCompositeComponent())
@@ -1383,7 +1380,7 @@
@Override
public Set<Map.Entry<String, String>> entrySet()
{
- Set<Entry<String, String>> set = new HashSet<Entry<String, String>>();
+ Set<Entry<String, String>> set = new HashSet<>();
for (Enumeration<String> enumer = _bundle.getKeys(); enumer.hasMoreElements(); )
{
final String k = enumer.nextElement();
@@ -1415,7 +1412,7 @@
@Override
public Set<String> keySet()
{
- Set<String> set = new HashSet<String>();
+ Set<String> set = new HashSet<>();
for (Enumeration<String> enumer = _bundle.getKeys(); enumer.hasMoreElements(); )
{
set.add(enumer.nextElement());
@@ -1450,7 +1447,6 @@
static class EventListenerWrapper implements SystemEventListener, PartialStateHolder
{
-
private Class<?> componentClass;
private ComponentSystemEventListener listener;
@@ -1641,8 +1637,6 @@
}
else if ((listenerCapability & LISTENER_TYPE_RENDERER) != 0)
{
- //listener = (ComponentSystemEventListener)
- // UIComponent.getCurrentComponent(context).getRenderer(context);
Renderer renderer = _component.getRenderer(context);
Integer i = (Integer) values[1];
if (i != null && i >= 0)
@@ -1736,8 +1730,8 @@
{
return null;
}
- return new Object[]{componentClass,
- new _AttachedDeltaWrapper(listener.getClass(), listenerSaved)};
+ return new Object[] { componentClass,
+ new _AttachedDeltaWrapper(listener.getClass(), listenerSaved) };
}
else
{
diff --git a/api/src/main/java/javax/faces/component/UIComponentBase.java b/api/src/main/java/javax/faces/component/UIComponentBase.java
index 8823fbd..f2b272e 100755
--- a/api/src/main/java/javax/faces/component/UIComponentBase.java
+++ b/api/src/main/java/javax/faces/component/UIComponentBase.java
@@ -53,7 +53,6 @@
import java.util.Iterator;
import java.util.List;
import java.util.Map;
-import java.util.logging.Level;
import java.util.logging.Logger;
import javax.faces.event.PhaseId;
@@ -1504,14 +1503,10 @@
{
if (facetMap == null)
{
- facetMap = new HashMap<String, Object>(facetCount, 1);
+ facetMap = new HashMap<>(facetCount, 1);
}
facetMap.put(entry.getKey(), component.processSaveState(context));
-
- // Ensure that UIComponent.popComponentFromEL(javax.faces.context.FacesContext) is called
- // correctly after each child or facet.
- // popComponentFromEL(context);
}
}
}
@@ -1531,7 +1526,7 @@
{
if (childrenList == null)
{
- childrenList = new ArrayList<Object>(childCount);
+ childrenList = new ArrayList<>(childCount);
}
Object childState = child.processSaveState(context);
@@ -1539,9 +1534,6 @@
{ // FIXME: Isn't that check dangerous for restoration since the child isn't marked transient?
childrenList.add(childState);
}
-
- // Ensure that UIComponent.popComponentFromEL(javax.faces.context.FacesContext) is called
- // correctly after each child or facet.
}
}
}
@@ -1551,6 +1543,8 @@
}
finally
{
+ // Ensure that UIComponent.popComponentFromEL(javax.faces.context.FacesContext) is called
+ // correctly after each child or facet.
popComponentFromEL(context);
}
@@ -1591,10 +1585,6 @@
if (facetState != null)
{
entry.getValue().processRestoreState(context, facetState);
-
- // After returning from the processRestoreState() method on a child or facet, call
- // UIComponent.popComponentFromEL(javax.faces.context.FacesContext)
- // popComponentFromEL(context);
}
else
{
@@ -1620,10 +1610,6 @@
if (childState != null)
{
child.processRestoreState(context, childState);
-
- // After returning from the processRestoreState() method on a child or facet, call
- // UIComponent.popComponentFromEL(javax.faces.context.FacesContext)
- // popComponentFromEL(context);
}
else
{
@@ -1635,6 +1621,8 @@
}
finally
{
+ // After returning from the processRestoreState() method on a child or facet, call
+ // UIComponent.popComponentFromEL(javax.faces.context.FacesContext)
popComponentFromEL(context);
}
}
@@ -1646,13 +1634,8 @@
*/
private String getComponentLocation(UIComponent component)
{
- Location location = (Location) component.getAttributes()
- .get(UIComponent.VIEW_LOCATION_KEY);
- if (location != null)
- {
- return location.toString();
- }
- return null;
+ Location location = (Location) component.getAttributes().get(UIComponent.VIEW_LOCATION_KEY);
+ return location == null ? null : location.toString();
}
@Override
@@ -2176,8 +2159,7 @@
if (stateObj != null)
{
Map<Class<? extends SystemEvent>, Object> stateMap = (Map<Class<? extends SystemEvent>, Object>) stateObj;
- int initCapacity = (stateMap.size() * 4 + 3) / 3;
- _systemEventListenerClassMap = new HashMap<>(initCapacity);
+ _systemEventListenerClassMap = new HashMap<>(stateMap.size(), 1f);
for (Map.Entry<Class<? extends SystemEvent>, Object> entry : stateMap.entrySet())
{
_systemEventListenerClassMap.put(entry.getKey(),
@@ -2196,10 +2178,9 @@
if (stateObj != null)
{
Map<Class<? extends SystemEvent>, Object> stateMap = (Map<Class<? extends SystemEvent>, Object>) stateObj;
- int initCapacity = (stateMap.size() * 4 + 3) / 3;
if (_systemEventListenerClassMap == null)
{
- _systemEventListenerClassMap = new HashMap<>(initCapacity);
+ _systemEventListenerClassMap = new HashMap<>(stateMap.size(), 1f);
}
for (Map.Entry<Class<? extends SystemEvent>, Object> entry : stateMap.entrySet())
{
@@ -2451,12 +2432,8 @@
* String d = sb2.toString();
* </code></pre>
*
+ * @param facesContext
*/
- static StringBuilder _getSharedStringBuilder()
- {
- return _getSharedStringBuilder(FacesContext.getCurrentInstance());
- }
-
static StringBuilder _getSharedStringBuilder(FacesContext facesContext)
{
Map<Object, Object> attributes = facesContext.getAttributes();
diff --git a/api/src/main/java/javax/faces/component/UIData.java b/api/src/main/java/javax/faces/component/UIData.java
index 29f5052..16cf882 100644
--- a/api/src/main/java/javax/faces/component/UIData.java
+++ b/api/src/main/java/javax/faces/component/UIData.java
@@ -164,16 +164,16 @@
// Holds for each row the states of the child components of this UIData.
// Note that only "partial" component state is saved: the component fields
// that are expected to vary between rows.
- private Map<String, Object> _rowStates = new HashMap<String, Object>();
- private Map<String, Map<String, Object> > _rowDeltaStates = new HashMap<String, Map<String, Object> >();
- private Map<String, Map<String, Object> > _rowTransientStates = new HashMap<String, Map<String, Object> >();
+ private Map<String, Object> _rowStates = new HashMap<>();
+ private Map<String, Map<String, Object>> _rowDeltaStates = new HashMap<>();
+ private Map<String, Map<String, Object>> _rowTransientStates = new HashMap<>();
/**
* Handle case where this table is nested inside another table. See method getDataModel for more details.
* <p>
* Key: parentClientId (aka rowId when nested within a parent table) Value: DataModel
*/
- private Map<String, DataModel> _dataModelMap = new HashMap<String, DataModel>();
+ private Map<String, DataModel> _dataModelMap = new HashMap<>(3, 1f);
// will be set to false if the data should not be refreshed at the beginning of the encode phase
private boolean _isValidChilds = true;
diff --git a/api/src/main/java/javax/faces/component/UIViewRoot.java b/api/src/main/java/javax/faces/component/UIViewRoot.java
index 4cad635..92aa822 100644
--- a/api/src/main/java/javax/faces/component/UIViewRoot.java
+++ b/api/src/main/java/javax/faces/component/UIViewRoot.java
@@ -1654,7 +1654,7 @@
if (_systemEventListeners == null)
{
- _systemEventListeners = new HashMap<>(4);
+ _systemEventListeners = new HashMap<>(4, 1f);
}
listeners = _systemEventListeners.get(systemEvent);
diff --git a/api/src/main/java/javax/faces/component/behavior/_AjaxBehaviorDeltaStateHelper.java b/api/src/main/java/javax/faces/component/behavior/_AjaxBehaviorDeltaStateHelper.java
index 37d4a26..6e5b3df 100644
--- a/api/src/main/java/javax/faces/component/behavior/_AjaxBehaviorDeltaStateHelper.java
+++ b/api/src/main/java/javax/faces/component/behavior/_AjaxBehaviorDeltaStateHelper.java
@@ -66,8 +66,8 @@
{
super();
this._target = component;
- _fullState = new HashMap<Serializable, Object>();
- _deltas = null;
+ this._fullState = new HashMap<>();
+ this._deltas = null;
}
/**
@@ -81,7 +81,7 @@
{
if (_deltas == null)
{
- _deltas = new HashMap<Serializable, Object>(2);
+ _deltas = new HashMap<>(2, 1f);
}
return true;
}
@@ -101,7 +101,7 @@
{
//Track delta case
Map<Object, Boolean> deltaListMapValues = (Map<Object, Boolean>) _deltas.computeIfAbsent(key,
- k -> new InternalDeltaListMap<>(3));
+ k -> new InternalDeltaListMap<>(3, 1f));
deltaListMapValues.put(value, Boolean.TRUE);
}
@@ -181,7 +181,7 @@
{
//Track delta case
Map<String, Object> mapValues = (Map<String, Object>) _deltas.computeIfAbsent(key,
- k -> new InternalMap<>());
+ k -> new InternalMap<>(8, 1f));
if (mapValues.containsKey(mapKey))
{
returnValue = mapValues.put(mapKey, value);
@@ -195,7 +195,7 @@
//Handle change on full map
Map<String, Object> mapValues = (Map<String, Object>) _fullState.computeIfAbsent(key,
- k -> new InternalMap<>());
+ k -> new InternalMap<>(8, 1f));
if (returnSet)
{
mapValues.put(mapKey, value);
@@ -325,12 +325,11 @@
}
else
{
- returnValue = map.remove(valueOrKey);
+ returnValue = map.remove((String) valueOrKey);
}
if (map.isEmpty())
{
- //stateMap.remove(key);
stateMap.put(key, null);
}
}
diff --git a/api/src/main/java/javax/faces/component/behavior/_DeltaStateHelper.java b/api/src/main/java/javax/faces/component/behavior/_DeltaStateHelper.java
index c2c7ee2..c82b36b 100644
--- a/api/src/main/java/javax/faces/component/behavior/_DeltaStateHelper.java
+++ b/api/src/main/java/javax/faces/component/behavior/_DeltaStateHelper.java
@@ -161,8 +161,8 @@
{
super();
this._target = target;
- _fullState = new HashMap<Serializable, Object>();
- _deltas = null;
+ this._fullState = new HashMap<>();
+ this._deltas = null;
}
/**
@@ -176,7 +176,7 @@
{
if (_deltas == null)
{
- _deltas = new HashMap<Serializable, Object>(2);
+ _deltas = new HashMap<>(2, 1f);
}
return true;
}
@@ -196,7 +196,7 @@
{
//Track delta case
Map<Object, Boolean> deltaListMapValues = (Map<Object, Boolean>) _deltas.computeIfAbsent(key,
- k -> new InternalDeltaListMap<>(3));
+ k -> new InternalDeltaListMap<>(3, 1f));
deltaListMapValues.put(value, Boolean.TRUE);
}
diff --git a/impl/src/main/java/org/apache/myfaces/application/NavigationHandlerImpl.java b/impl/src/main/java/org/apache/myfaces/application/NavigationHandlerImpl.java
index ef9e27f..686c44a 100755
--- a/impl/src/main/java/org/apache/myfaces/application/NavigationHandlerImpl.java
+++ b/impl/src/main/java/org/apache/myfaces/application/NavigationHandlerImpl.java
@@ -1129,7 +1129,7 @@
if (StringUtils.isNotBlank(queryString))
{
String[] splitQueryParams = AMP_PATTERN.split(queryString); // "&" or "&"
- params = new HashMap<>(splitQueryParams.length, (splitQueryParams.length* 4 + 3) / 3);
+ params = new HashMap<>(splitQueryParams.length, 1f);
for (String queryParam : splitQueryParams)
{
String[] splitParam = StringUtils.splitShortString(queryParam, '=');
diff --git a/impl/src/main/java/org/apache/myfaces/application/viewstate/SerializedViewCollection.java b/impl/src/main/java/org/apache/myfaces/application/viewstate/SerializedViewCollection.java
index 32b8ea4..1a157dd 100644
--- a/impl/src/main/java/org/apache/myfaces/application/viewstate/SerializedViewCollection.java
+++ b/impl/src/main/java/org/apache/myfaces/application/viewstate/SerializedViewCollection.java
@@ -39,6 +39,7 @@
private static final Object[] EMPTY_STATES = new Object[]{null, null};
private static final long serialVersionUID = -3734849062185115847L;
+
private final List<SerializedViewKey> _keys = new ArrayList<>(MyfacesConfig.NUMBER_OF_VIEWS_IN_SESSION_DEFAULT);
private final Map<SerializedViewKey, Object> _serializedViews = new HashMap<>();
@@ -118,12 +119,12 @@
{
if (_viewScopeIds == null)
{
- _viewScopeIds = new HashMap<SerializedViewKey, String>();
+ _viewScopeIds = new HashMap<>();
}
_viewScopeIds.put(key, viewScopeId);
if (_viewScopeIdCounts == null)
{
- _viewScopeIdCounts = new HashMap<String, Integer>();
+ _viewScopeIdCounts = new HashMap<>();
}
Integer vscount = _viewScopeIdCounts.get(viewScopeId);
vscount = (vscount == null) ? 1 : vscount + 1;
diff --git a/impl/src/main/java/org/apache/myfaces/config/annotation/CdiAnnotationProviderExtension.java b/impl/src/main/java/org/apache/myfaces/config/annotation/CdiAnnotationProviderExtension.java
index 8dfd4a4..b37ffe9 100644
--- a/impl/src/main/java/org/apache/myfaces/config/annotation/CdiAnnotationProviderExtension.java
+++ b/impl/src/main/java/org/apache/myfaces/config/annotation/CdiAnnotationProviderExtension.java
@@ -43,7 +43,6 @@
public CdiAnnotationProviderExtension()
{
- map = new HashMap<>(8, 1f);
annotationsToScan = new Class[] {
FacesComponent.class,
FacesBehavior.class,
@@ -54,6 +53,7 @@
FacesBehaviorRenderer.class,
FaceletsResourceResolver.class
};
+ map = new HashMap<>(annotationsToScan.length, 1f);
}
<T> void processAnnotatedType(@Observes ProcessAnnotatedType<T> pat)
diff --git a/impl/src/main/java/org/apache/myfaces/context/servlet/ServletExternalContextImpl.java b/impl/src/main/java/org/apache/myfaces/context/servlet/ServletExternalContextImpl.java
index 40b11bd..2ea9913 100755
--- a/impl/src/main/java/org/apache/myfaces/context/servlet/ServletExternalContextImpl.java
+++ b/impl/src/main/java/org/apache/myfaces/context/servlet/ServletExternalContextImpl.java
@@ -1012,8 +1012,7 @@
{
if (_flashFactory == null)
{
- _flashFactory = (FlashFactory) FactoryFinder.getFactory(
- FactoryFinder.FLASH_FACTORY);
+ _flashFactory = (FlashFactory) FactoryFinder.getFactory(FactoryFinder.FLASH_FACTORY);
if (_flashFactory == null)
{
//Fallback to servlet default flash
diff --git a/impl/src/main/java/org/apache/myfaces/lifecycle/PhaseListenerManager.java b/impl/src/main/java/org/apache/myfaces/lifecycle/PhaseListenerManager.java
index 3871e18..2d6f7f2 100644
--- a/impl/src/main/java/org/apache/myfaces/lifecycle/PhaseListenerManager.java
+++ b/impl/src/main/java/org/apache/myfaces/lifecycle/PhaseListenerManager.java
@@ -51,7 +51,7 @@
this.lifecycle = lifecycle;
this.facesContext = facesContext;
this.phaseListeners = phaseListeners;
- this.listenerSuccessMap = new HashMap<>(PhaseId.VALUES.size());
+ this.listenerSuccessMap = new HashMap<>(PhaseId.VALUES.size(), 1f);
}
diff --git a/impl/src/main/java/org/apache/myfaces/lifecycle/UrlClientWindow.java b/impl/src/main/java/org/apache/myfaces/lifecycle/UrlClientWindow.java
index 46b4ded..d17222e 100644
--- a/impl/src/main/java/org/apache/myfaces/lifecycle/UrlClientWindow.java
+++ b/impl/src/main/java/org/apache/myfaces/lifecycle/UrlClientWindow.java
@@ -98,7 +98,7 @@
String id = context.getExternalContext().getClientWindow().getId();
if (id != null)
{
- queryParamsMap = new HashMap<String, String>(2,1);
+ queryParamsMap = new HashMap<String, String>(2, 1);
queryParamsMap.put(ResponseStateManager.CLIENT_WINDOW_URL_PARAM, id);
}
}
diff --git a/impl/src/main/java/org/apache/myfaces/push/cdi/WebsocketViewBean.java b/impl/src/main/java/org/apache/myfaces/push/cdi/WebsocketViewBean.java
index 228011b..f543579 100644
--- a/impl/src/main/java/org/apache/myfaces/push/cdi/WebsocketViewBean.java
+++ b/impl/src/main/java/org/apache/myfaces/push/cdi/WebsocketViewBean.java
@@ -42,7 +42,7 @@
* This map hold all tokens that are related to the current scope.
* This map use as key channel and as value channelTokens
*/
- private Map<String, List<WebsocketChannel>> channelTokenListMap = new HashMap<>(2);
+ private Map<String, List<WebsocketChannel>> channelTokenListMap = new HashMap<>(2, 1f);
/**
* This map hold all tokens related to the current view. The reason to do this is the connections must follow
@@ -54,7 +54,7 @@
* per view. In that way, the token can be used to identify on the client if a websocket initialization request
* can share a websocket connection or not, simplifying code design.
*/
- private Map<String, WebsocketChannelMetadata> tokenList = new HashMap<>(2);
+ private Map<String, WebsocketChannelMetadata> tokenList = new HashMap<>(2, 1f);
public void registerToken(String token, WebsocketChannelMetadata metadata)
{
diff --git a/impl/src/main/java/org/apache/myfaces/resource/ResourceImpl.java b/impl/src/main/java/org/apache/myfaces/resource/ResourceImpl.java
index 1da6cba..c36ca38 100644
--- a/impl/src/main/java/org/apache/myfaces/resource/ResourceImpl.java
+++ b/impl/src/main/java/org/apache/myfaces/resource/ResourceImpl.java
@@ -171,7 +171,7 @@
if (facesContext.getApplication().getResourceHandler().isResourceRequest(facesContext))
{
- Map<String, String> headers = new HashMap<>(2);
+ Map<String, String> headers = new HashMap<>(2, 1f);
long lastModified = getLastModified(facesContext);
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/TagAttributesImpl.java b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/TagAttributesImpl.java
index cd03670..f8d7278 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/TagAttributesImpl.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/TagAttributesImpl.java
@@ -49,8 +49,8 @@
public TagAttributesImpl(TagAttribute[] attributes)
{
this.attributes = attributes;
- this.namespaceAttributes = new HashMap<>(1);
- this.namespaceLocalNameAttributes = new HashMap<>(1);
+ this.namespaceAttributes = new HashMap<>(1, 1f);
+ this.namespaceLocalNameAttributes = new HashMap<>(1, 1f);
Set<String> namespacesSet = new HashSet<>();
HashMap<String, List<TagAttribute>> namespaceAttributesAsList = new HashMap<>();
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/CompositeComponentBeanInfo.java b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/CompositeComponentBeanInfo.java
index 880109e..4ad4657 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/CompositeComponentBeanInfo.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/CompositeComponentBeanInfo.java
@@ -200,7 +200,7 @@
out.writeBoolean(_descriptor.isPreferred());
out.writeObject(_descriptor.getShortDescription());
- Map<String,Object> map = new HashMap<String, Object>(4,1);
+ Map<String,Object> map = new HashMap<>(4, 1);
for (Enumeration<String> e = _descriptor.attributeNames(); e.hasMoreElements();)
{
@@ -236,7 +236,7 @@
else if (_propertyDescriptorsMap == null)
{
int initCapacity = (_propertyDescriptors.size() * 4 + 3) / 3;
- _propertyDescriptorsMap = new HashMap<String, PropertyDescriptor>(initCapacity);
+ _propertyDescriptorsMap = new HashMap<>(initCapacity);
for (PropertyDescriptor p : _propertyDescriptors)
{
if (!_propertyDescriptorsMap.containsKey(p.getName()))
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/CompositeComponentPropertyDescriptor.java b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/CompositeComponentPropertyDescriptor.java
index 8d705cb..86d7fa7 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/CompositeComponentPropertyDescriptor.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/CompositeComponentPropertyDescriptor.java
@@ -83,7 +83,7 @@
// Properties that comes here are targets, default, required,
// method-signature and type.
- Map<String,Object> map = new HashMap<>(6,1);
+ Map<String,Object> map = new HashMap<>(6, 1);
for (Enumeration<String> e = attributeNames(); e.hasMoreElements();)
{
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/CompositeComponentResourceTagHandler.java b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/CompositeComponentResourceTagHandler.java
index 8dbef30..e9746f2 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/CompositeComponentResourceTagHandler.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/CompositeComponentResourceTagHandler.java
@@ -522,7 +522,7 @@
{
if (_facetHandlersMap == null)
{
- Map<String, FaceletHandler> map = new HashMap<String, FaceletHandler>();
+ Map<String, FaceletHandler> map = new HashMap<>(_facetHandlers.size());
for (FaceletHandler handler : _facetHandlers)
{
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/FacetHandler.java b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/FacetHandler.java
index 9a46c45..73bf562 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/FacetHandler.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/FacetHandler.java
@@ -331,5 +331,4 @@
{
_cacheable = cacheable;
}
-
}