From adffaces-commits-return-650-apmail-incubator-adffaces-commits-archive=incubator.apache.org@incubator.apache.org Wed Aug 16 07:01:11 2006 Return-Path: Delivered-To: apmail-incubator-adffaces-commits-archive@locus.apache.org Received: (qmail 1526 invoked from network); 16 Aug 2006 07:01:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 16 Aug 2006 07:01:11 -0000 Received: (qmail 66502 invoked by uid 500); 16 Aug 2006 07:01:03 -0000 Delivered-To: apmail-incubator-adffaces-commits-archive@incubator.apache.org Received: (qmail 66464 invoked by uid 500); 16 Aug 2006 07:01:01 -0000 Mailing-List: contact adffaces-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: adffaces-dev@incubator.apache.org Delivered-To: mailing list adffaces-commits@incubator.apache.org Received: (qmail 66407 invoked by uid 99); 16 Aug 2006 07:00:56 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Aug 2006 00:00:56 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [140.211.166.113] (HELO eris.apache.org) (140.211.166.113) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Aug 2006 00:00:51 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id D5BCD1A981A; Wed, 16 Aug 2006 00:00:30 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r431848 [1/6] - in /incubator/adffaces/trunk/trinidad: ./ trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/ trinidad-api/src/main/java/org/apache/myfaces/trinidad/bean/ trinidad-api/src/main/java/org/apache/myfaces... Date: Wed, 16 Aug 2006 07:00:19 -0000 To: adffaces-commits@incubator.apache.org From: awiner@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20060816070030.D5BCD1A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: awiner Date: Wed Aug 16 00:00:16 2006 New Revision: 431848 URL: http://svn.apache.org/viewvc?rev=431848&view=rev Log: Check in final patch from Simon on ADFFACES-72 Modified: incubator/adffaces/trunk/trinidad/pom.xml incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXComponentRefTemplate.java incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXPageTemplate.java incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTableTemplate.java incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTreeTableTemplate.java incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/bean/FacesBeanImpl.java incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/bean/TypeRepository.java incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/bean/util/FlaggedPropertyMap.java incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/HierarchyUtils.java incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/StampState.java incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/TableUtils.java incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXCollection.java incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXHierarchy.java incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/event/ReturnEvent.java incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/event/RowDisclosureEvent.java incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/event/RowKeySetChangeEvent.java incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/event/SelectionEvent.java incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/CollectionModel.java incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/ModelUtils.java incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/PathHelper.java incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/RowKeySet.java incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/RowKeySetImpl.java incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/RowKeySetTreeImpl.java incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/SortableModel.java incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/TreeModel.java incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/XMLMenuModel.java incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/ListFromCollection.java incubator/adffaces/trunk/trinidad/trinidad-api/src/test/java/org/apache/myfaces/trinidad/component/UIXTableTest.java incubator/adffaces/trunk/trinidad/trinidad-api/src/test/java/org/apache/myfaces/trinidad/model/RowKeySetImplTest.java incubator/adffaces/trunk/trinidad/trinidad-api/src/test/java/org/apache/myfaces/trinidad/model/RowKeySetTreeImplTest.java incubator/adffaces/trunk/trinidad/trinidad-demo/src/main/java/org/apache/myfaces/trinidaddemo/ComponentTree.java incubator/adffaces/trunk/trinidad/trinidad-demo/src/main/java/org/apache/myfaces/trinidaddemo/TableBean.java incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/AgentFactoryImpl.java incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/change/BaseChangeManager.java incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/GenericConverterFactory.java incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/SqlConverter.java incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/el/FormatterMap.java incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/el/HelpProvider.java incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/image/cache/MapCacheEntry.java incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/menu/GroupNode.java incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/menu/ItemNode.java incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/menu/MenuContentHandlerImpl.java incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/menu/MenuNode.java incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/menu/MenuUtils.java incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/metadata/RegionMetadata.java incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/DialogRequest.java incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/desktop/TreeTableRenderer.java incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SimpleInputNumberSpinboxRenderer.java incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/TableRenderer.java incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/TableRenderingContext.java incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/TableSelectManyRenderer.java incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/TableSelectOneRenderer.java incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/TreeNodeColumnRenderer.java incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/TreeTableRenderingContext.java incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/TreeUtils.java incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/uix/NavigationTreeRenderer.java incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/uix/PageRenderer.java incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/uix/SelectItemSupport.java incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/uix/SelectManyShuttleRenderer.java incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/uix/TreeRenderer.java incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/nls/MutableLocaleContext.java incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinExtension.java incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/ColorSchemeNode.java incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/CompoundPropertyNode.java incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleNode.java incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetDocument.java incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetNode.java Modified: incubator/adffaces/trunk/trinidad/pom.xml URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/pom.xml?rev=431848&r1=431847&r2=431848&view=diff ============================================================================== --- incubator/adffaces/trunk/trinidad/pom.xml (original) +++ incubator/adffaces/trunk/trinidad/pom.xml Wed Aug 16 00:00:16 2006 @@ -215,6 +215,7 @@ 1.5 1.5 + true @@ -428,4 +429,4 @@ --> - \ No newline at end of file + Modified: incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXComponentRefTemplate.java URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXComponentRefTemplate.java?rev=431848&r1=431847&r2=431848&view=diff ============================================================================== --- incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXComponentRefTemplate.java (original) +++ incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXComponentRefTemplate.java Wed Aug 16 00:00:16 2006 @@ -221,10 +221,9 @@ } @Override - @SuppressWarnings("unchecked") public Set> entrySet() { - return Collections.EMPTY_SET; + return Collections.emptySet(); } } Modified: incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXPageTemplate.java URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXPageTemplate.java?rev=431848&r1=431847&r2=431848&view=diff ============================================================================== --- incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXPageTemplate.java (original) +++ incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXPageTemplate.java Wed Aug 16 00:00:16 2006 @@ -80,6 +80,7 @@ } @Override + @SuppressWarnings("unchecked") protected void processFacetsAndChildren( FacesContext context, PhaseId phaseId) @@ -98,15 +99,15 @@ // process the children TableUtils.__processChildren(context, this, phaseId); - Map facets = getFacets(); - Iterator facetKeys = facets.keySet().iterator(); + Map facets = getFacets(); + Iterator facetKeys = facets.keySet().iterator(); while(facetKeys.hasNext()) { - Object facetKey = facetKeys.next(); + String facetKey = facetKeys.next(); if (!"nodeStamp".equals(facetKey)) { - processComponent(context, (UIComponent)facets.get(facetKey), phaseId); + processComponent(context, facets.get(facetKey), phaseId); } } Modified: incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTableTemplate.java URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTableTemplate.java?rev=431848&r1=431847&r2=431848&view=diff ============================================================================== --- incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTableTemplate.java (original) +++ incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTableTemplate.java Wed Aug 16 00:00:16 2006 @@ -154,6 +154,7 @@ } @Override + @SuppressWarnings("unchecked") public void restoreState(FacesContext context, Object state) { Object[] array = (Object[]) state; @@ -179,7 +180,7 @@ public Object getSelectedRowData() { RowKeySet state = getSelectedRowKeys(); - Iterator keys = state.iterator(); + Iterator keys = state.iterator(); if (keys.hasNext()) { Object key = keys.next(); @@ -311,10 +312,11 @@ * @param stampState the internal state is obtained from this object. */ @Override + @SuppressWarnings("unchecked") void __setMyStampState(Object stampState) { Object[] state = (Object[]) stampState; - _sortCriteria = (List) state[0]; + _sortCriteria = (List) state[0]; super.__setMyStampState(state[1]); setFirst(((Integer) state[2]).intValue()); setShowAll(Boolean.TRUE == state[3]); Modified: incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTreeTableTemplate.java URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTreeTableTemplate.java?rev=431848&r1=431847&r2=431848&view=diff ============================================================================== --- incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTreeTableTemplate.java (original) +++ incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTreeTableTemplate.java Wed Aug 16 00:00:16 2006 @@ -108,7 +108,8 @@ // this is because "first", "rows" and "rowCount" applies to the container // element and not the current element: Object container = _getContainerPath(); - if (_firstMap == Collections.EMPTY_MAP) + Map comparant = Collections.emptyMap(); + if (_firstMap == comparant) _firstMap = new HashMap(3); if (index <= 0) @@ -163,7 +164,7 @@ super.restoreState(context, array[0]); _firstMap = (Map) array[1]; if (_firstMap == null) - _firstMap = Collections.EMPTY_MAP; + _firstMap = Collections.emptyMap(); } @Override @@ -202,8 +203,8 @@ * the nodeStamp stamp (if any). * @todo cache the result. */ - @SuppressWarnings("unchecked") @Override + @SuppressWarnings("unchecked") protected final List getStamps() { List children = getChildren(); @@ -333,5 +334,5 @@ return parentKey; } - private Map _firstMap = Collections.EMPTY_MAP; + private Map _firstMap = Collections.emptyMap(); } Modified: incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/bean/FacesBeanImpl.java URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/bean/FacesBeanImpl.java?rev=431848&r1=431847&r2=431848&view=diff ============================================================================== --- incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/bean/FacesBeanImpl.java (original) +++ incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/bean/FacesBeanImpl.java Wed Aug 16 00:00:16 2006 @@ -227,7 +227,7 @@ List l = (List) getLocalPropertyImpl(listKey); if (l == null) - return Collections.EMPTY_LIST.iterator(); + return Collections.emptyList().iterator(); return l.iterator(); } @@ -270,12 +270,10 @@ } } - - @SuppressWarnings("unchecked") final public Set keySet() { if (_properties == null) - return Collections.EMPTY_SET; + return Collections.emptySet(); return _properties.keySet(); } @@ -284,7 +282,7 @@ final public Set bindingKeySet() { if (_bindings == null) - return Collections.EMPTY_SET; + return Collections.emptySet(); return _bindings.keySet(); } Modified: incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/bean/TypeRepository.java URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/bean/TypeRepository.java?rev=431848&r1=431847&r2=431848&view=diff ============================================================================== --- incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/bean/TypeRepository.java (original) +++ incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/bean/TypeRepository.java Wed Aug 16 00:00:16 2006 @@ -41,21 +41,21 @@ // non-issue at least given the intended use of this class. synchronized (_repos) { - // Map> rkMap = _repos.get(renderKitId); - Map rkMap = (Map) _repos.get(renderKitId); + Map> rkMap = _repos.get(renderKitId); + //Map rkMap = (Map) _repos.get(renderKitId); if (rkMap == null) { - // rkMap = new HashMap>(); - rkMap = new HashMap(); + rkMap = new HashMap>(); + //rkMap = new HashMap(); _repos.put(renderKitId, rkMap); } - Map familyMap = (Map) rkMap.get(componentFamily); - // Map familyMap = rkMap.get(componentFamily); + //Map familyMap = (Map) rkMap.get(componentFamily); + Map familyMap = rkMap.get(componentFamily); if (familyMap == null) { - familyMap = new HashMap(); - //familyMap = new HashMap(); + //familyMap = new HashMap(); + familyMap = new HashMap(); rkMap.put(componentFamily, familyMap); } @@ -72,23 +72,26 @@ synchronized (_repos) { - // Map> rkMap = _repos.get(renderKitId); - Map rkMap = (Map) _repos.get(renderKitId); + Map> rkMap = _repos.get(renderKitId); + //Map rkMap = (Map) _repos.get(renderKitId); if (rkMap == null) return null; - // Map familyMap = rkMap.get(componentFamily); - Map familyMap = (Map) rkMap.get(componentFamily); + Map familyMap = rkMap.get(componentFamily); + //Map familyMap = (Map) rkMap.get(componentFamily); if (familyMap == null) return null; - return (FacesBean.Type) familyMap.get(rendererType); + return familyMap.get(rendererType); } } // "qdox" doesn't support JDK 1.5 syntax like this. Hence, all // the commented-out code... - // static private Map>> - // _repos = new HashMap>>(); - static private Map _repos = new HashMap(); + // -= Simon Lessard =- + // Attempted to switch to JDK 5 on 2006-08-11. We'll see if qdox works fine + // with it now. + static private Map>> + _repos = new HashMap>>(); + //static private Map _repos = new HashMap(); } Modified: incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/bean/util/FlaggedPropertyMap.java URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/bean/util/FlaggedPropertyMap.java?rev=431848&r1=431847&r2=431848&view=diff ============================================================================== --- incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/bean/util/FlaggedPropertyMap.java (original) +++ incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/bean/util/FlaggedPropertyMap.java Wed Aug 16 00:00:16 2006 @@ -135,13 +135,12 @@ map.putAll(t); } - @SuppressWarnings("unchecked") @Override public Set> entrySet() { Map map = getPropertyMap(false); if ((map == null) || map.isEmpty()) - return Collections.EMPTY_SET; + return Collections.emptySet(); return map.entrySet(); } @@ -149,25 +148,22 @@ /** * @todo Optimize to take advantage of flags. */ - @SuppressWarnings("unchecked") @Override public Set keySet() { Map map = getPropertyMap(false); if ((map == null) || map.isEmpty()) - return Collections.EMPTY_SET; + return Collections.emptySet(); return map.keySet(); } - - @SuppressWarnings("unchecked") @Override public Collection values() { Map map = getPropertyMap(false); if ((map == null) || map.isEmpty()) - return Collections.EMPTY_SET; + return Collections.emptySet(); return map.values(); } Modified: incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/HierarchyUtils.java URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/HierarchyUtils.java?rev=431848&r1=431847&r2=431848&view=diff ============================================================================== --- incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/HierarchyUtils.java (original) +++ incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/HierarchyUtils.java Wed Aug 16 00:00:16 2006 @@ -32,12 +32,10 @@ */ public final class HierarchyUtils { - - // FIXME: What is the param type of RowKeySet here? static void __handleBroadcast( - UIXHierarchy comp, - FacesEvent event, - RowKeySet state, + UIXHierarchy comp, + FacesEvent event, + RowKeySet state, MethodBinding disclosureListener) throws AbortProcessingException { @@ -46,7 +44,7 @@ { RowDisclosureEvent dEvent = (RowDisclosureEvent) event; state.removeAll(dEvent.getRemovedSet()); - RowKeySet added = dEvent.getAddedSet(); + RowKeySet added = dEvent.getAddedSet(); int size = 0; // only do an unbounded expandAll if the number of new nodes is not // too large: @@ -73,8 +71,8 @@ static void __handleEncodeBegin( - UIXHierarchy comp, - RowKeySet set + UIXHierarchy comp, + RowKeySet set ) { if (comp.__isFirstRender()) @@ -124,11 +122,11 @@ static void __iterateOverTree( - FacesContext context, - PhaseId phaseId, - UIXHierarchy comp, - RowKeySet state, - boolean processChildrenAsStamps + FacesContext context, + PhaseId phaseId, + UIXHierarchy comp, + RowKeySet state, + boolean processChildrenAsStamps ) { UIComponent nodeStamp = comp.getFacet("nodeStamp"); Modified: incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/StampState.java URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/StampState.java?rev=431848&r1=431847&r2=431848&view=diff ============================================================================== --- incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/StampState.java (original) +++ incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/StampState.java Wed Aug 16 00:00:16 2006 @@ -37,10 +37,9 @@ */ final class StampState implements Externalizable { - @SuppressWarnings("unchecked") public StampState() { - _rows = Collections.EMPTY_MAP; + _rows = Collections.emptyMap(); } /** @@ -65,7 +64,8 @@ public void put(Object currencyObj, String key, Object value) { - if (_rows == Collections.EMPTY_MAP) + Map comparant = Collections.emptyMap(); + if (_rows == comparant) { // =-=AEW Better default sizes _rows = new HashMap(109); Modified: incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/TableUtils.java URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/TableUtils.java?rev=431848&r1=431847&r2=431848&view=diff ============================================================================== --- incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/TableUtils.java (original) +++ incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/TableUtils.java Wed Aug 16 00:00:16 2006 @@ -111,8 +111,8 @@ */ static void __doSafeExpandAll( TreeModel model, - RowKeySet state, - int maxSize) + RowKeySet state, + int maxSize) { int size = _getSizeOfTree(model, maxSize); if ((size < 0) || (size > maxSize)) Modified: incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXCollection.java URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXCollection.java?rev=431848&r1=431847&r2=431848&view=diff ============================================================================== --- incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXCollection.java (original) +++ incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXCollection.java Wed Aug 16 00:00:16 2006 @@ -946,11 +946,10 @@ return null; } - @SuppressWarnings("unchecked") @Override public Set> entrySet() { - return Collections.EMPTY_SET; + return Collections.emptySet(); } }; } Modified: incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXHierarchy.java URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXHierarchy.java?rev=431848&r1=431847&r2=431848&view=diff ============================================================================== --- incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXHierarchy.java (original) +++ incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXHierarchy.java Wed Aug 16 00:00:16 2006 @@ -182,7 +182,6 @@ return model; } - @SuppressWarnings("unchecked") @Override protected List getStamps() { @@ -190,7 +189,7 @@ if (nodeStamp != null) return Collections.singletonList(nodeStamp); else - return Collections.EMPTY_LIST; + return Collections.emptyList(); } abstract public Object getFocusRowKey(); Modified: incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/event/ReturnEvent.java URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/event/ReturnEvent.java?rev=431848&r1=431847&r2=431848&view=diff ============================================================================== --- incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/event/ReturnEvent.java (original) +++ incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/event/ReturnEvent.java Wed Aug 16 00:00:16 2006 @@ -42,7 +42,6 @@ this(source, returnValue, null); } - @SuppressWarnings("unchecked") public ReturnEvent( UIComponent source, Object returnValue, @@ -54,7 +53,7 @@ // Useless and expensive instanciation //_returnParams = new HashMap(); if (returnParams == null) - _returnParams = Collections.EMPTY_MAP; + _returnParams = Collections.emptyMap(); else _returnParams = new HashMap(returnParams); } Modified: incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/event/RowDisclosureEvent.java URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/event/RowDisclosureEvent.java?rev=431848&r1=431847&r2=431848&view=diff ============================================================================== --- incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/event/RowDisclosureEvent.java (original) +++ incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/event/RowDisclosureEvent.java Wed Aug 16 00:00:16 2006 @@ -35,8 +35,8 @@ */ public RowDisclosureEvent( UIComponent source, - RowKeySet collapsed, - RowKeySet expanded) + RowKeySet collapsed, + RowKeySet expanded) { super(source, collapsed, expanded); } @@ -47,8 +47,8 @@ * @param newSet the set of rowKeys after any changes. */ public RowDisclosureEvent( - RowKeySet oldSet, - RowKeySet newSet, + RowKeySet oldSet, + RowKeySet newSet, UIComponent source) { super(oldSet, newSet, source); Modified: incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/event/RowKeySetChangeEvent.java URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/event/RowKeySetChangeEvent.java?rev=431848&r1=431847&r2=431848&view=diff ============================================================================== --- incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/event/RowKeySetChangeEvent.java (original) +++ incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/event/RowKeySetChangeEvent.java Wed Aug 16 00:00:16 2006 @@ -33,9 +33,9 @@ */ // FIXME: What is the parametrized type inside RowKeySet? public RowKeySetChangeEvent( - UIComponent source, - RowKeySet removedSet, - RowKeySet addedSet) + UIComponent source, + RowKeySet removedSet, + RowKeySet addedSet) { this(source, removedSet, addedSet, false); } @@ -48,9 +48,9 @@ */ // FIXME: What is the parametrized type inside RowKeySet? public RowKeySetChangeEvent( - RowKeySet oldSet, - RowKeySet newSet, - UIComponent source) + RowKeySet oldSet, + RowKeySet newSet, + UIComponent source) { // "oldSet" is very often the actual instance-on-the-component. // so make sure that we clone this object, so that subsequent mutations of @@ -62,10 +62,10 @@ // FIXME: What is the parametrized type inside RowKeySet? private RowKeySetChangeEvent( - UIComponent source, - RowKeySet oldRemoved, - RowKeySet newAdded, - boolean needsDiff) + UIComponent source, + RowKeySet oldRemoved, + RowKeySet newAdded, + boolean needsDiff) { super(source); @@ -77,7 +77,7 @@ /** * Gets the Set of keys that have just been added. */ - public RowKeySet getAddedSet() + public RowKeySet getAddedSet() { _diff(); return _newAdded; @@ -86,7 +86,7 @@ /** * Gets the Set of keys that have just been removed. */ - public RowKeySet getRemovedSet() + public RowKeySet getRemovedSet() { _diff(); return _oldRemoved; @@ -96,9 +96,9 @@ { if (_needsDiff) { - RowKeySet removed = _oldRemoved.clone(); + RowKeySet removed = _oldRemoved.clone(); removed.removeAll(_newAdded); - RowKeySet added = _newAdded.clone(); + RowKeySet added = _newAdded.clone(); added.removeAll(_oldRemoved); _needsDiff = false; @@ -109,7 +109,7 @@ // set1 - oldSet or removed elements // set2 = newSet or added elements - private RowKeySet _oldRemoved; - private RowKeySet _newAdded; + private RowKeySet _oldRemoved; + private RowKeySet _newAdded; private boolean _needsDiff; } Modified: incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/event/SelectionEvent.java URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/event/SelectionEvent.java?rev=431848&r1=431847&r2=431848&view=diff ============================================================================== --- incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/event/SelectionEvent.java (original) +++ incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/event/SelectionEvent.java Wed Aug 16 00:00:16 2006 @@ -33,9 +33,9 @@ */ // FIXME: What is the parametrized type inside RowKeySet? public SelectionEvent( - UIComponent source, - RowKeySet unselected, - RowKeySet selected) + UIComponent source, + RowKeySet unselected, + RowKeySet selected) { super(source, unselected, selected); } @@ -46,9 +46,9 @@ * @param newSet the set of rowKeys after any changes. */ public SelectionEvent( - RowKeySet oldSet, - RowKeySet newSet, - UIComponent source) + RowKeySet oldSet, + RowKeySet newSet, + UIComponent source) { super(oldSet, newSet, source); } Modified: incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/CollectionModel.java URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/CollectionModel.java?rev=431848&r1=431847&r2=431848&view=diff ============================================================================== --- incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/CollectionModel.java (original) +++ incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/CollectionModel.java Wed Aug 16 00:00:16 2006 @@ -111,10 +111,9 @@ * An empty list is returned if this collection is not sorted. * @see SortCriterion */ - @SuppressWarnings("unchecked") public List getSortCriteria() { - return Collections.EMPTY_LIST; + return Collections.emptyList(); } /** Modified: incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/ModelUtils.java URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/ModelUtils.java?rev=431848&r1=431847&r2=431848&view=diff ============================================================================== --- incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/ModelUtils.java (original) +++ incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/ModelUtils.java Wed Aug 16 00:00:16 2006 @@ -241,7 +241,7 @@ if (value == null) { - return new ListDataModel(Collections.EMPTY_LIST); + return new ListDataModel(Collections.emptyList()); } else if (value instanceof List) return new ListDataModel((List) value); Modified: incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/PathHelper.java URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/PathHelper.java?rev=431848&r1=431847&r2=431848&view=diff ============================================================================== --- incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/PathHelper.java (original) +++ incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/PathHelper.java Wed Aug 16 00:00:16 2006 @@ -23,10 +23,9 @@ */ class PathHelper { - @SuppressWarnings("unchecked") protected PathHelper() { - _path = Collections.EMPTY_LIST; + _path = Collections.emptyList(); _rowKey = null; } @@ -88,7 +87,6 @@ * Sets the path. * @param path a List with each element a rowKey String */ - @SuppressWarnings("unchecked") public final void setPath(List path) { int sz = (path==null) ? 0 : path.size(); @@ -107,7 +105,7 @@ } else { - _path = Collections.EMPTY_LIST; + _path = Collections.emptyList(); setRowKey(null); } } @@ -143,7 +141,8 @@ Object parentData = getLastPathData(); Object data = pushPath(parentData, _rowKey); - if (_path == Collections.EMPTY_LIST) + List comparant = Collections.emptyList(); + if (_path == comparant) _path = new ArrayList(5); _path.add(new PathHelper.PathElement(_rowKey, data)); Modified: incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/RowKeySet.java URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/RowKeySet.java?rev=431848&r1=431847&r2=431848&view=diff ============================================================================== --- incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/RowKeySet.java (original) +++ incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/RowKeySet.java Wed Aug 16 00:00:16 2006 @@ -33,11 +33,7 @@ * compute. Use the {@link #getSize()} method on this class for an inexpensive size. * @author The Oracle ADF Faces Team */ -// -= Simon Lessard =- -// TODO: Since RowKeySet is used by so many components internally, -// I believe we shouldn't parametrize it. I would rather see -// public abstract class RowKeySet extends AbstractSet implements Cloneable -public abstract class RowKeySet extends AbstractSet implements Cloneable +public abstract class RowKeySet extends AbstractSet implements Cloneable { public RowKeySet() { @@ -71,7 +67,7 @@ * it otherwise. * @return true if the row is now added. false otherwise. */ - public boolean invert(E rowKey) + public boolean invert(Object rowKey) { // doing "add" followed by an optional "remove" is faster than switching on // "contains"; the latter does two hashtable lookups all the time, @@ -93,8 +89,7 @@ @SuppressWarnings("unchecked") public final boolean invert() { - E rowkey = (E) getCollectionModel().getRowKey(); - return invert(rowkey); + return invert(getCollectionModel().getRowKey()); } /** @@ -128,8 +123,7 @@ @SuppressWarnings("unchecked") public final boolean add() { - E rowkey = (E) getCollectionModel().getRowKey(); - return add(rowkey); + return add(getCollectionModel().getRowKey()); } /** @@ -198,11 +192,11 @@ */ @SuppressWarnings("unchecked") @Override - public RowKeySet clone() + public RowKeySet clone() { try { - return (RowKeySet) super.clone(); + return (RowKeySet) super.clone(); } catch (CloneNotSupportedException e) { Modified: incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/RowKeySetImpl.java URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/RowKeySetImpl.java?rev=431848&r1=431847&r2=431848&view=diff ============================================================================== --- incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/RowKeySetImpl.java (original) +++ incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/RowKeySetImpl.java Wed Aug 16 00:00:16 2006 @@ -40,7 +40,7 @@ * invertAll. * @author The Oracle ADF Faces Team */ -public final class RowKeySetImpl extends RowKeySet implements Externalizable +public final class RowKeySetImpl extends RowKeySet implements Externalizable { /** * Creates an initially empty RowKeySet. @@ -54,11 +54,10 @@ * Creates a new RowKeySet. * @param addAll whether to add every rowKey to this set. */ - @SuppressWarnings("unchecked") public RowKeySetImpl(boolean addAll) { _default = addAll; - _set = Collections.EMPTY_SET; + _set = Collections.emptySet(); _model = null; } @@ -77,7 +76,7 @@ * @return true if this set changed */ @Override - public boolean add(E rowKey) + public boolean add(Object rowKey) { return _setSelected(rowKey, true); } @@ -98,9 +97,9 @@ * @return true if the row is now added. false otherwise. */ @Override - public boolean invert(E rowKey) + public boolean invert(Object rowKey) { - Set set = _getSet(true); + Set set = _getSet(true); if (!set.add(rowKey)) { set.remove(rowKey); @@ -155,7 +154,7 @@ { if (c instanceof RowKeySetImpl) { - RowKeySetImpl other = (RowKeySetImpl) c; + RowKeySetImpl other = (RowKeySetImpl) c; if (other._default) { // the other Set has all keys added by default. It will be too @@ -168,11 +167,11 @@ } @Override - public boolean addAll(Collection c) + public boolean addAll(Collection c) { if (c instanceof RowKeySetImpl) { - RowKeySetImpl other = (RowKeySetImpl) c; + RowKeySetImpl other = (RowKeySetImpl) c; if (other._default) { // the other Set has all keys added by default. It will be too @@ -184,10 +183,10 @@ return super.addAll(c); } - private boolean _processAll(RowKeySetImpl other, boolean addAll) + private boolean _processAll(RowKeySetImpl other, boolean addAll) { - Set set = _getSet(false); - Set otherSet = other._getSet(false); + Set set = _getSet(false); + Set otherSet = other._getSet(false); if (_default == addAll) { // This Set already uses the correct default state. So all we have to do @@ -279,7 +278,7 @@ * iterator is being used. */ @Override - public Iterator iterator() + public Iterator iterator() { return _default ? _getNotInSetRowKeyIterator() : _getInSetRowKeyIterator(); } @@ -325,12 +324,11 @@ * @param rowKey the rowKey of the item. * @return true if this set changed */ - @SuppressWarnings("unchecked") private boolean _setSelected(Object rowKey, boolean isSelected) { if (isSelected == _default) { - if (!_set.isEmpty()) // _set != Collections.EMPTY_SET + if (!_set.isEmpty()) // _set != Collections.emptySet() { return _set.remove(rowKey); } @@ -338,19 +336,19 @@ } else { - return _getSet(true).add((E)rowKey); + return _getSet(true).add(rowKey); } } @SuppressWarnings("unchecked") - private Iterator _getNotInSetRowKeyIterator() + private Iterator _getNotInSetRowKeyIterator() { CollectionModel table = getCollectionModel(); - final Iterator rowKeyIterator = (Iterator)ModelUtils.getRowKeyIterator(table); - final Set set = _getSet(false); - Iterator iter = new Iterator() + final Iterator rowKeyIterator = ModelUtils.getRowKeyIterator(table); + final Set set = _getSet(false); + Iterator iter = new Iterator() { - public E next() + public Object next() { if (!hasNext()) throw new NoSuchElementException(); @@ -364,7 +362,7 @@ { if (_current == null) throw new IllegalStateException("No element to remove"); - Set mutable = _getSet(true); + Set mutable = _getSet(true); // since this is the not-in-set iterator, we "remove" the element // by adding it to the Set: mutable.add(_current); @@ -376,11 +374,11 @@ return (_next != null || _first); } - private E _next() + private Object _next() { while(rowKeyIterator.hasNext()) { - E rowKey = rowKeyIterator.next(); + Object rowKey = rowKeyIterator.next(); if (!set.contains(rowKey)) return rowKey; } @@ -388,44 +386,43 @@ } private boolean _first = true; - private E _next = null; - private E _current = null; + private Object _next = null; + private Object _current = null; }; iter.next(); // initialize; return iter; } - private Iterator _getInSetRowKeyIterator() + private Iterator _getInSetRowKeyIterator() { return _getSet(false).iterator(); } - @SuppressWarnings("unchecked") private void _selectAll(boolean isSelected) { _default = isSelected; - _set = Collections.EMPTY_SET; + _set = Collections.emptySet(); } - private Set _getSet(boolean create) + private Set _getSet(boolean create) { - if (create && (_set == Collections.EMPTY_SET)) + if (create && (_set == Collections.emptySet())) { _set = _createSet(10); } return _set; } - private Set _createSet(int sz) + private Set _createSet(int sz) { // must be cloneable: - return new HashSet(sz); + return new HashSet(sz); } private boolean _isSelected(Object rowKey) { - Set set = _getSet(false); + Set set = _getSet(false); boolean isInSet = set.contains(rowKey); return isInSet ^ _default; } @@ -434,10 +431,10 @@ public void writeExternal(ObjectOutput out) throws IOException { out.writeBoolean(_default); - Set set = _getSet(false); + Set set = _getSet(false); int sz = set.size(); out.writeInt(sz); - Iterator iter = set.iterator(); + Iterator iter = set.iterator(); for(int i=0; i clone() + public RowKeySetImpl clone() { - RowKeySetImpl clone = (RowKeySetImpl) super.clone(); - Set set = _getSet(false); + RowKeySetImpl clone = (RowKeySetImpl) super.clone(); + Set set = _getSet(false); clone._set = _clone(set); return clone; } @@ -487,7 +483,7 @@ private Set _clone(Set other) { if (other.isEmpty()) - return Collections.EMPTY_SET; + return Collections.emptySet(); else return (Set) ((HashSet) other).clone(); } @@ -508,6 +504,6 @@ private static final TrinidadLogger _LOG = TrinidadLogger.createTrinidadLogger(RowKeySetImpl.class); private boolean _default; - private Set _set; + private Set _set; private transient CollectionModel _model; } Modified: incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/RowKeySetTreeImpl.java URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/RowKeySetTreeImpl.java?rev=431848&r1=431847&r2=431848&view=diff ============================================================================== --- incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/RowKeySetTreeImpl.java (original) +++ incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/RowKeySetTreeImpl.java Wed Aug 16 00:00:16 2006 @@ -34,7 +34,7 @@ * The generic type E is the type of a rowKey. * @author The Oracle ADF Faces Team */ -public class RowKeySetTreeImpl extends RowKeySet implements Serializable +public class RowKeySetTreeImpl extends RowKeySet implements Serializable { /** * Creates a new Set that is initially empty. @@ -50,35 +50,33 @@ */ public RowKeySetTreeImpl(boolean addAll) { - _root = new Node(addAll); + _root = new Node(addAll); } /** * Tests to see if the given rowKey is included in this Set. * @return true If the rowKey is included in this Set. */ - @SuppressWarnings("unchecked") @Override public boolean contains(Object rowKey) { - return _isContained((E) rowKey); + return _isContained(rowKey); } /** * @deprecated do not use. this will be removed post Tier 1. */ - @SuppressWarnings("unchecked") @Override @Deprecated public boolean isContainedByDefault() { TreeModel model = getCollectionModel(); - E rowkey = (E) model.getRowKey(); + Object rowkey = model.getRowKey(); return new Search().find(rowkey).isDefaultContained; } @Override - public Iterator iterator() + public Iterator iterator() { return new PathIterator(); } @@ -90,7 +88,7 @@ * @see #addAll() */ @Override - public boolean add(E rowKey) + public boolean add(Object rowKey) { return _setContained(rowKey, true); } @@ -101,11 +99,10 @@ * @see #add(E) * @see #removeAll() */ - @SuppressWarnings("unchecked") @Override public boolean remove(Object rowKey) { - return _setContained((E) rowKey, false); + return _setContained(rowKey, false); } /** @@ -140,11 +137,11 @@ * optimized to give superior performance and avoid iteration. */ @Override - public boolean addAll(Collection other) + public boolean addAll(Collection other) { if (other instanceof RowKeySetTreeImpl) { - RowKeySetTreeImpl otherset = (RowKeySetTreeImpl) other; + RowKeySetTreeImpl otherset = (RowKeySetTreeImpl) other; return _processOperation(this._root, otherset._root, true); } return super.addAll(other); @@ -161,13 +158,13 @@ { if (other instanceof RowKeySetTreeImpl) { - RowKeySetTreeImpl otherset = (RowKeySetTreeImpl) other; + RowKeySetTreeImpl otherset = (RowKeySetTreeImpl) other; return _processOperation(this._root, otherset._root, false); } return super.removeAll(other); } - private boolean _processOperation(Node set1, Node set2, boolean add) + private boolean _processOperation(Node set1, Node set2, boolean add) { /* * setXdef = setX.isDefaultContained @@ -207,17 +204,17 @@ // has everything): boolean addAll = add ^ set1.isDefaultContained; - for(Entry> en:set2.entrySet()) + for(Entry> en:set2.entrySet()) { - E segment = en.getKey(); - Node subset2 = en.getValue(); - Node subset1 = set1.get(segment); + Object segment = en.getKey(); + Node subset2 = en.getValue(); + Node subset1 = set1.get(segment); if (subset1 == null) { if (addAll) { - subset1 = new Node(set1, segment); + subset1 = new Node(set1, segment); hasChanges = true; } else @@ -306,9 +303,9 @@ * clone without affecting this instance. */ @Override - public RowKeySetTreeImpl clone() + public RowKeySetTreeImpl clone() { - RowKeySetTreeImpl clone = (RowKeySetTreeImpl) super.clone(); + RowKeySetTreeImpl clone = (RowKeySetTreeImpl) super.clone(); clone._root = _root.clone(); return clone; } @@ -345,7 +342,7 @@ * @param exclusions any rowKeys present in this Set are excluded from the count. */ @SuppressWarnings("unchecked") - private int _getTreeSize(TreeModel model, Set exclusions) + private int _getTreeSize(TreeModel model, Set exclusions) { int sz = 0; for(int i=0;true;i++) @@ -353,14 +350,14 @@ model.setRowIndex(i); if (model.isRowAvailable()) { - E rowkey = (E) model.getRowKey(); + Object rowkey = model.getRowKey(); if (exclusions.contains(rowkey)) continue; sz++; if (model.isContainer()) { model.enterContainer(); - Set empty = Collections.emptySet(); + Set empty = Collections.emptySet(); sz += _getTreeSize(model, empty); model.exitContainer(); } @@ -370,7 +367,7 @@ } } - private int _getSize(E rowkey, Node set, TreeModel model, boolean fetchall) + private int _getSize(Object rowkey, Node set, TreeModel model, boolean fetchall) { // special-case the root collection: int sz = ((rowkey != null) && (set.isDefaultContained ^ set.isDifferent)) ? 1 : 0; @@ -400,10 +397,10 @@ } } - for(Entry> en:set.entrySet()) + for(Entry> en:set.entrySet()) { - E newrowkey = en.getKey(); - Node subset = en.getValue(); + Object newrowkey = en.getKey(); + Node subset = en.getValue(); int size = _getSize(newrowkey, subset, model, fetchall); if (size < 0) return -1; @@ -416,13 +413,12 @@ * adds or removes all the paths rooted at the current path * @param isSelectAll if true does an add-all. else does remove-all. */ - @SuppressWarnings("unchecked") private void _selectAll(final boolean isSelectAll) { Search search = new Search() { @Override - protected boolean create(Node parent, E rowkey) + protected boolean create(Node parent, Object rowkey) { // if the parent does not have the correct default, then // we need to add entries for the children, since we need @@ -431,7 +427,7 @@ } @Override - protected Node found(Node child) + protected Node found(Node child) { child.isDefaultContained = isSelectAll; child.isDifferent = false; @@ -441,22 +437,22 @@ }; TreeModel model = getCollectionModel(); - E rowkey = (E) model.getRowKey(); + Object rowkey = model.getRowKey(); search.find(rowkey); } - private boolean _isContained(E rowkey) + private boolean _isContained(Object rowkey) { Search search = new Search() { @Override - protected Node notFound(Node parent, E rowkey) + protected Node notFound(Node parent, Object rowkey) { return parent.isDefaultContained ? parent : null; } @Override - protected Node found(Node child) + protected Node found(Node child) { return (child.isDefaultContained ^ child.isDifferent) ? child : null; } @@ -471,12 +467,12 @@ * it is removed. * @return true if this Set changed due to this operation. */ - private boolean _setContained(E rowkey, final boolean isContained) + private boolean _setContained(Object rowkey, final boolean isContained) { Search search = new Search() { @Override - protected boolean create(Node parent, E rowkey) + protected boolean create(Node parent, Object rowkey) { // only need to create child deltas, if the parent's // default is wrong: @@ -484,13 +480,13 @@ } @Override - protected Node notFound(Node parent, E rowkey) + protected Node notFound(Node parent, Object rowkey) { return null; } }; - Node current = search.find(rowkey); + Node current = search.find(rowkey); if ((current != null) && ((current.isDefaultContained ^ current.isDifferent) != isContained)) { @@ -578,39 +574,38 @@ { } - protected boolean create(Node parent, E rowkey) + protected boolean create(Node parent, Object rowkey) { return false; } - protected Node notFound(Node parent, E rowkey) + protected Node notFound(Node parent, Object rowkey) { return parent; } - protected Node found(Node result) + protected Node found(Node result) { return result; } - @SuppressWarnings("unchecked") - public Node find(E rowkey) + public Node find(Object rowkey) { - Node current = _root; + Node current = _root; if (rowkey != null) { TreeModel model = getCollectionModel(); - List parentkeys = (List)model.getAllAncestorContainerRowKeys(rowkey); - List allkeys = new ArrayList(parentkeys.size() + 1); + List parentkeys = model.getAllAncestorContainerRowKeys(rowkey); + List allkeys = new ArrayList(parentkeys.size() + 1); allkeys.addAll(parentkeys); allkeys.add(rowkey); - for(E key:allkeys) + for(Object key:allkeys) { - Node next = current.get(key); + Node next = current.get(key); if (next == null) { if (create(current, key)) - next = new Node(current, key); + next = new Node(current, key); else return notFound(current, key); } @@ -621,18 +616,18 @@ } } - private final class PathIterator implements Iterator + private final class PathIterator implements Iterator { PathIterator() { _value = _next(); // initialize; } - public E next() + public Object next() { if (!hasNext()) throw new NoSuchElementException(); - E value = _value; + Object value = _value; _value = _next(); return value; } @@ -647,23 +642,22 @@ throw new UnsupportedOperationException(); } - private boolean _containsSubtree(E rowkey) + private boolean _containsSubtree(Object rowkey) { Search search = new Search() { @Override - protected Node notFound(Node parent, E rowkey) + protected Node notFound(Node parent, Object rowkey) { return parent.isDefaultContained ? parent : null; } }; - Node current = search.find(rowkey); + Node current = search.find(rowkey); return (current != null) && ((!current.isEmpty()) || current.isDefaultContained); } - @SuppressWarnings("unchecked") - private E _next() + private Object _next() { TreeModel model = getCollectionModel(); if (model == null) @@ -680,7 +674,7 @@ if (!hasMore) return null; - _currPath = (E) model.getRowKey(); + _currPath = model.getRowKey(); if (contains(_currPath)) return _currPath; } @@ -690,10 +684,10 @@ } } - private E _value; - private E _currPath = null; + private Object _value; + private Object _currPath = null; } - private Node _root; + private Node _root; private transient TreeModel _model = null; } Modified: incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/SortableModel.java URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/SortableModel.java?rev=431848&r1=431847&r2=431848&view=diff ============================================================================== --- incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/SortableModel.java (original) +++ incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/SortableModel.java Wed Aug 16 00:00:16 2006 @@ -169,13 +169,17 @@ } } - @SuppressWarnings("unchecked") @Override public List getSortCriteria() { - return (_sortCriterion == null) - ? Collections.EMPTY_LIST - : Collections.singletonList(_sortCriterion); + if (_sortCriterion == null) + { + return Collections.emptyList(); + } + else + { + return Collections.singletonList(_sortCriterion); + } } @Override Modified: incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/TreeModel.java URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/TreeModel.java?rev=431848&r1=431847&r2=431848&view=diff ============================================================================== --- incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/TreeModel.java (original) +++ incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/TreeModel.java Wed Aug 16 00:00:16 2006 @@ -175,15 +175,14 @@ * The first rowKey (in this list) is the top most container. The last * rowKey is the immediate container of the given childRowKey. */ - @SuppressWarnings("unchecked") public List getAllAncestorContainerRowKeys(Object childRowKey) { if (childRowKey == null) - return Collections.EMPTY_LIST; + return Collections.emptyList(); int size = getDepth(childRowKey); if (size <= 0) - return Collections.EMPTY_LIST; + return Collections.emptyList(); Object[] keys = new Object[size]; for(int i=size-1; i>=0; i--)