Return-Path: X-Original-To: apmail-isis-users-archive@www.apache.org Delivered-To: apmail-isis-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 01D8B17880 for ; Thu, 20 Aug 2015 08:40:08 +0000 (UTC) Received: (qmail 42431 invoked by uid 500); 20 Aug 2015 08:40:07 -0000 Delivered-To: apmail-isis-users-archive@isis.apache.org Received: (qmail 42400 invoked by uid 500); 20 Aug 2015 08:40:07 -0000 Mailing-List: contact users-help@isis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@isis.apache.org Delivered-To: mailing list users@isis.apache.org Received: (qmail 42389 invoked by uid 99); 20 Aug 2015 08:40:07 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Aug 2015 08:40:07 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 28E0DC0721 for ; Thu, 20 Aug 2015 08:40:07 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 4.01 X-Spam-Level: **** X-Spam-Status: No, score=4.01 tagged_above=-999 required=6.31 tests=[HTML_MESSAGE=3, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_MSPIKE_H2=-0.001, T_REMOTE_IMAGE=0.01, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id gYcpk9H-hK3b for ; Thu, 20 Aug 2015 08:40:01 +0000 (UTC) Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.130]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id 950C924F53 for ; Thu, 20 Aug 2015 08:40:00 +0000 (UTC) Received: from [127.0.0.1] ([95.23.135.78]) by mrelayeu.kundenserver.de (mreue004) with ESMTPSA (Nemesis) id 0M21ZH-1Ydxel2hsR-00u3uB for ; Thu, 20 Aug 2015 10:39:53 +0200 To: users@isis.apache.org From: =?UTF-8?B?TmFjaG8gQ8Ohbm92YXMgUmVqw7Nu?= Subject: ISIS-1044 issue with Collections Message-ID: <55D59251.5070709@gesconsultor.com> Date: Thu, 20 Aug 2015 10:39:45 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="------------080703000703080807090106" X-Antivirus: avast! (VPS 150819-1, 19/08/2015), Outbound message X-Antivirus-Status: Clean X-Provags-ID: V03:K0:UVSLhv6JhEwZ/uAvQ9hZerPVrfMlT8dFYOzG+9z4WXwZ/wBtajH L0ZyGp5L6mFzJBRIKQ4pqS8YC+PR775dSQUuV8tvPSD8/zfNLV51hK12BEPQioUD+clQ74N tpx7fxIblifggm9ZP/nqd69iaikzS2hMblTKmwvS04KlkSTXqzNQ52IRvuidboTGAus5eaR xdWiIXroPE46WhJ4CzOsg== X-UI-Out-Filterresults: notjunk:1;V01:K0:jkZboeP3f9s=:wS1FhGALTHR9B5qZ8e7Mga 5BBReNxm7NisENz/4L0lpKfZFo3cDK/yAkrNULxJ/2mptleWXXym3z7WIAR/CEo918CkxcEoP TnTPiyI7/RTr0OFEXi6hAqhK5qkxVEYUC5QHkNi3PVbZugspC7MdKhPKHcDVSo20UytmzT2M1 QOaNc+M9CAiKfsRZg2yc5fN37GyVmCknzt4gprRc9v3+FZg8jUh1yVD9r9ipqPRTTULEaMSsX 7yTqSPFxBQENR4SbqZLFuTUQQhHP8Sy+kAnpx0it3JQyJOtaaGi1gU1yfrGVVgzAsMA/6XivI xyF8FTu7IbjXMnBIBadAO42OYq+O+CzD4r7LH+BlCdeI2ZH3NaQldvoWJ46/rwWVuNgJwo6vh cxeYettlGDvbKBaXfEnzYqh+u+zHlsJJQw7U1psGT5sq2Qc5Kasx2WWhV2/tixtIyxCr7onad b9WxoqaSIwIJKvJ8J76ueVJ/n9czgDhXdPKRneDwPCorW+pgz8tk9Az/7u0gr9qzDpzJIR5zp 33tIODh1Jity8t2OQZwSiOlXZcUHMvID6gGWvzrmd1UtIvQWL6JS+CBbSKwLE7pl632f5FCnV pmWJx3JTYgO1qrOsGwfPu1ALn5G3idnEhgoT2Nb1pAdbzSttojb2S1TQWr183zNTzqihr70r6 iukhRag+XTuELUOTq0e3GqaUCeJkRLot1toZdXPY40jEbUti9R7uvHyexozPdLEWlLxDppK5Z epu6fJ0Q+Z9rkFSP --------------080703000703080807090106 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Hi Dan. In order to test new changes on 1.9.0 release, I think I find some bug. My problem is in "*ISIS-1044: fixing by filtering the PropertyAccessorFacet and CollectionAccessorFacet, also the ActionInvocationFacet (for contributed collections/properties):*" issue. You modified "*getProperty*" method on class "*CollectionAccessorFacetViaAccessor*". I show you the code: *OLD Code* final Object collectionOrArray = ObjectAdapter.InvokeUtils.invoke(method, owningAdapter); *NEW Code* final Object collectionOrArray = ObjectAdapter.InvokeUtils.invoke(method, owningAdapter); final ObjectAdapter collectionAdapter = getAdapterManager().adapterFor(collectionOrArray); final FacetedMethod facetedMethod = (FacetedMethod) getFacetHolder(); final Class collectionElementType = facetedMethod.getType(); final List visibleAdapters = ObjectAdapter.Util.visibleAdapters( collectionAdapter, authenticationSession, deploymentCategory); final List visibleObjects = Lists.newArrayList( Iterables.transform(visibleAdapters, ObjectAdapter.Functions.getObject())); return visibleObjects; Now I explain my problem. I have for example this property defined in one of my entities. private SortedSet customSelectedProducts = new TreeSet(); public SortedSet getCustomSelectedProducts() { return this.customSelectedProducts; } public void setCustomSelectedProducts( final SortedSet customSelectedProducts) { this.customSelectedProducts = customSelectedProducts; } And when I try to get his value, I received: java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.util.SortedSet You will see that you return always an ArrayList when it's a Collection, but maybe there is other kind of collections (SortedSet in my case) and it will failed on get method. I did some dirty and not to well modification for performance to work with it in order to advance changing next code: final List visibleObjects = Lists.newArrayList( Iterables.transform(visibleAdapters, ObjectAdapter.Functions.getObject())); return visibleObjects; * **to* ((Collection) collectionOrArray).clear(); ((Collection) collectionOrArray).addAll(Lists.newArrayList( Iterables.transform(visibleAdapters, ObjectAdapter.Functions.getObject()))); return collectionOrArray; I have the same problem in method "*invoke*" from class "*ActionInvocationFacetForDomainEventAbstract*" and I fixed it with a similar way than last mail: final List visibleObjects = Lists.newArrayList(Lists.transform( visibleAdapters, ObjectAdapter.Functions.getObject())); final ObjectAdapter visibleObjectsAsAdapter = getAdapterManager().adapterFor(visibleObjects); *to* ((Collection) result).clear(); ((Collection) result).addAll(Lists.newArrayList(Lists.transform(visibleAdapters, ObjectAdapter.Functions.getObject()))); final ObjectAdapter visibleObjectsAsAdapter = this.getAdapterManager().adapterFor(result); I hope you're well. Best regards and thanks. -- Ignacio Cánovas Rejón Tel. 902 900 231 Fax 96 353 19 09 n.canovas@gesconsultor.com www.gesconsultor.com Este mensaje y los ficheros anexos son confidenciales. Los mismos contienen información reservada que no puede ser difundida. Si usted ha recibido este correo por error, tenga la amabilidad de eliminarlo de su sistema y avisar al remitente mediante reenvío a su dirección electrónica; no deberá copiar el mensaje ni divulgar su contenido a ninguna persona. Su dirección de correo electrónico junto a sus datos personales constan en un fichero titularidad de GESDATOS SOFTWARE S.L. cuya finalidad es la de mantener el contacto con Ud. Si quiere saber de qué información disponemos de Ud., modificarla, y en su caso, cancelarla, puede hacerlo enviando un escrito al efecto, acompañado de una fotocopia de su D.N.I. a la siguiente dirección: GESDATOS SOFTWARE S.L. Av. Cortes Valencianas 50-1º-C, C.P. 46015 de Valencia. Asimismo, es su responsabilidad comprobar que este mensaje o sus archivos adjuntos no contengan virus informáticos, y en caso que los tuvieran eliminarlos. --- El software de antivirus Avast ha analizado este correo electrónico en busca de virus. http://www.avast.com --------------080703000703080807090106--