Return-Path: X-Original-To: apmail-chemistry-commits-archive@www.apache.org Delivered-To: apmail-chemistry-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id ED5291104E for ; Fri, 16 May 2014 13:58:48 +0000 (UTC) Received: (qmail 57466 invoked by uid 500); 16 May 2014 11:46:28 -0000 Delivered-To: apmail-chemistry-commits-archive@chemistry.apache.org Received: (qmail 49013 invoked by uid 500); 16 May 2014 11:30:18 -0000 Mailing-List: contact commits-help@chemistry.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@chemistry.apache.org Delivered-To: mailing list commits@chemistry.apache.org Received: (qmail 62687 invoked by uid 99); 16 May 2014 11:19:01 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 May 2014 11:19:01 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 May 2014 16:47:55 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 1D74F23889E1; Thu, 15 May 2014 16:47:35 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1594976 - /chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/repository/ObjectFactoryImpl.java Date: Thu, 15 May 2014 16:47:35 -0000 To: commits@chemistry.apache.org From: fmui@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20140515164735.1D74F23889E1@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: fmui Date: Thu May 15 16:47:34 2014 New Revision: 1594976 URL: http://svn.apache.org/r1594976 Log: fixed handling of object type ID when it is provided as a list Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/repository/ObjectFactoryImpl.java Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/repository/ObjectFactoryImpl.java URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/repository/ObjectFactoryImpl.java?rev=1594976&r1=1594975&r2=1594976&view=diff ============================================================================== --- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/repository/ObjectFactoryImpl.java (original) +++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/repository/ObjectFactoryImpl.java Thu May 15 16:47:34 2014 @@ -338,7 +338,7 @@ public class ObjectFactoryImpl implement return result; } - @SuppressWarnings("unchecked") + @SuppressWarnings({ "unchecked", "rawtypes" }) public Properties convertProperties(Map properties, ObjectType type, Collection secondaryTypes, Set updatabilityFilter) { // check input @@ -349,11 +349,14 @@ public class ObjectFactoryImpl implement // get the type if (type == null) { Object typeId = properties.get(PropertyIds.OBJECT_TYPE_ID); - if (!(typeId instanceof String)) { + + if (typeId instanceof String) { + type = session.getTypeDefinition(typeId.toString()); + } else if (typeId instanceof List && !((List) typeId).isEmpty() && ((List) typeId).get(0) instanceof String) { + type = session.getTypeDefinition(((List) typeId).get(0).toString()); + } else { throw new IllegalArgumentException("Type or type property must be set!"); } - - type = session.getTypeDefinition(typeId.toString()); } // get secondary types