From commits-return-13263-archive-asf-public=cust-asf.ponee.io@poi.apache.org Sun Sep 13 18:13:47 2020 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mxout1-he-de.apache.org (mxout1-he-de.apache.org [95.216.194.37]) by mx-eu-01.ponee.io (Postfix) with ESMTPS id 3456018063D for ; Sun, 13 Sep 2020 20:13:47 +0200 (CEST) Received: from mail.apache.org (mailroute1-lw-us.apache.org [207.244.88.153]) by mxout1-he-de.apache.org (ASF Mail Server at mxout1-he-de.apache.org) with SMTP id 93A7B629CA for ; Sun, 13 Sep 2020 18:13:46 +0000 (UTC) Received: (qmail 78406 invoked by uid 500); 13 Sep 2020 18:13:45 -0000 Mailing-List: contact commits-help@poi.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@poi.apache.org Delivered-To: mailing list commits@poi.apache.org Received: (qmail 78393 invoked by uid 99); 13 Sep 2020 18:13:45 -0000 Received: from Unknown (HELO svn01-us-east.apache.org) (13.90.137.153) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 13 Sep 2020 18:13:45 +0000 Received: from svn01-us-east.apache.org (svn01-us-east.apache.org [127.0.0.1]) by svn01-us-east.apache.org (ASF Mail Server at svn01-us-east.apache.org) with ESMTP id 72A4E17C67E for ; Sun, 13 Sep 2020 18:13:45 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1881686 - in /xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl: store/Xobj.java values/TypeStore.java Date: Sun, 13 Sep 2020 18:13:45 -0000 To: commits@poi.apache.org From: kiwiwings@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20200913181345.72A4E17C67E@svn01-us-east.apache.org> Author: kiwiwings Date: Sun Sep 13 18:13:44 2020 New Revision: 1881686 URL: http://svn.apache.org/viewvc?rev=1881686&view=rev Log: Fix cast error on TypeStore (in POI) Modified: xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/store/Xobj.java xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/values/TypeStore.java Modified: xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/store/Xobj.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/store/Xobj.java?rev=1881686&r1=1881685&r2=1881686&view=diff ============================================================================== --- xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/store/Xobj.java (original) +++ xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/store/Xobj.java Sun Sep 13 18:13:44 2020 @@ -1984,20 +1984,22 @@ abstract class Xobj implements TypeStore return null; } + @SuppressWarnings("unchecked") @Override - public void find_all_element_users(QName name, List fillMeUp) { + public void find_all_element_users(QName name, List fillMeUp) { for (Xobj x = _firstChild; x != null; x = x._nextSibling) { if (x.isElem() && x._name.equals(name)) { - fillMeUp.add(x.getUser()); + fillMeUp.add((T)x.getUser()); } } } + @SuppressWarnings("unchecked") @Override - public void find_all_element_users(QNameSet names, List fillMeUp) { + public void find_all_element_users(QNameSet names, List fillMeUp) { for (Xobj x = _firstChild; x != null; x = x._nextSibling) { if (x.isElem() && names.contains(x._name)) { - fillMeUp.add(x.getUser()); + fillMeUp.add((T)x.getUser()); } } } @@ -2338,11 +2340,12 @@ abstract class Xobj implements TypeStore assert m == n; - List elementsUser = new ArrayList<>(); + List elementsUser = new ArrayList<>(); find_all_element_users(elementName, elementsUser); List elements = elementsUser.stream() + .map(x -> (TypeStoreUser)x) .map(TypeStoreUser::get_store) .map(x -> (Xobj)x) .collect(Collectors.toList()); Modified: xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/values/TypeStore.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/values/TypeStore.java?rev=1881686&r1=1881685&r2=1881686&view=diff ============================================================================== --- xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/values/TypeStore.java (original) +++ xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/values/TypeStore.java Sun Sep 13 18:13:44 2020 @@ -176,14 +176,14 @@ public interface TypeStore extends Names * given name owned by this typestore, or the empty array of * TypeStoreUsers if none was found. */ - void find_all_element_users(QName name, List fillMeUp); + void find_all_element_users(QName name, List fillMeUp); /** * Returns all TypeStoreUsers corresponding to elements with one * of the names is the QNameSet. */ - void find_all_element_users(QNameSet name, List fillMeUp); + void find_all_element_users(QNameSet name, List fillMeUp); /** * Inserts a new element at the position that will make it --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org For additional commands, e-mail: commits-help@poi.apache.org