Return-Path: X-Original-To: apmail-chemistry-dev-archive@www.apache.org Delivered-To: apmail-chemistry-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 018111854B for ; Tue, 27 Oct 2015 14:57:07 +0000 (UTC) Received: (qmail 61098 invoked by uid 500); 27 Oct 2015 14:50:27 -0000 Delivered-To: apmail-chemistry-dev-archive@chemistry.apache.org Received: (qmail 61039 invoked by uid 500); 27 Oct 2015 14:50:27 -0000 Mailing-List: contact dev-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 dev@chemistry.apache.org Received: (qmail 61023 invoked by uid 99); 27 Oct 2015 14:50:27 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Oct 2015 14:50:27 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id A89B72C1F56 for ; Tue, 27 Oct 2015 14:50:27 +0000 (UTC) Date: Tue, 27 Oct 2015 14:50:27 +0000 (UTC) From: "Srinivas Gannavarapu (JIRA)" To: dev@chemistry.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Reopened] (CMIS-954) getRepositoryInfo always returns available top repository from the list even if the repository id passed into getRepositoryInfo is set to a different repository MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CMIS-954?page=3Dcom.atlassian.= jira.plugin.system.issuetabpanels:all-tabpanel ] Srinivas Gannavarapu reopened CMIS-954: --------------------------------------- Please fix the same at trunk\chemistry-opencmis-client\chemistry-opencmis-c= lient-bindings\src\main\java\org\apache\chemistry\opencmis\client\bindings\= spi\atompub\RepositoryServiceImpl.java > getRepositoryInfo always returns available top repository from the list e= ven if the repository id passed into getRepositoryInfo is set to a differen= t repository > -------------------------------------------------------------------------= ---------------------------------------------------------------------------= ------------ > > Key: CMIS-954 > URL: https://issues.apache.org/jira/browse/CMIS-954 > Project: Chemistry > Issue Type: Bug > Components: opencmis-client, opencmis-client-bindings > Affects Versions: OpenCMIS 0.13.0 > Environment: Windows Server 2012/ RHEL, tomcat/ WAS. Open CMIS 0.= 13.0 / Tip build, IBM FileNet repository=20 > Reporter: Srinivas Gannavarapu > Assignee: Florian M=C3=BCller > Priority: Critical > Labels: easyfix > Fix For: OpenCMIS 0.14.0 > > Original Estimate: 48h > Remaining Estimate: 48h > > The issues is in "Apache Chemistry client code" within the jar file "chem= istry-opencmis-client-bindings-0.13.0". > - The getRepositoryInfo() on the client side is implemented in the class = "RepositoryServiceImpl" (under the package "org.apache.chemistry.opencmis.c= lient.bindings.spi.browser"). JAR file "chemistry-opencmis-client-bindings-= 0.13.0". > - This method has a snippet which does something unexpected. When the len= gth of the repository infos list is 1, it returns that SOLE repository. > Code Snippet below: > public RepositoryInfo getRepositoryInfo(String repositoryId, ExtensionsDa= ta extension) { > List repositoryInfos =3D getRepositoriesInternal(repositoryId); > if (repositoryInfos.isEmpty()) { > throw new CmisObjectNotFoundException("Repository '" + repositoryId= + "'not found!"); > } > if (repositoryInfos.size() =3D=3D 1) { > return (RepositoryInfo)repositoryInfos.get(0); > } > for (RepositoryInfo info : repositoryInfos) { > if (info.getId() =3D=3D null) > { > continue; > } > if (info.getId().equals(repositoryId)) { > return info; > } > } > throw new CmisObjectNotFoundException("Repository '" + repositoryId += "'not found!"); > } > - So, when the number of repositories in the given domain is just one, it= always returns that irrespective what the user has set in the property "or= g.apache.chemistry.opencmis.session.repository.id" > Proposed solution: > The "if " condition above checking for repositoryInfos.size, which return= s the only available repository should be removed.=20 -- This message was sent by Atlassian JIRA (v6.3.4#6332)