From commits-return-10008-apmail-sis-commits-archive=sis.apache.org@sis.apache.org Fri Nov 17 14:22:04 2017 Return-Path: X-Original-To: apmail-sis-commits-archive@www.apache.org Delivered-To: apmail-sis-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 91AB71049D for ; Fri, 17 Nov 2017 14:22:04 +0000 (UTC) Received: (qmail 39680 invoked by uid 500); 17 Nov 2017 14:22:04 -0000 Delivered-To: apmail-sis-commits-archive@sis.apache.org Received: (qmail 39618 invoked by uid 500); 17 Nov 2017 14:22:04 -0000 Mailing-List: contact commits-help@sis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: sis-dev@sis.apache.org Delivered-To: mailing list commits@sis.apache.org Received: (qmail 39602 invoked by uid 99); 17 Nov 2017 14:22:04 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Nov 2017 14:22:04 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id C9A2E1A1353 for ; Fri, 17 Nov 2017 14:22:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.002 X-Spam-Level: X-Spam-Status: No, score=-100.002 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id nse3VsQWvJZC for ; Fri, 17 Nov 2017 14:22:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 4683660D12 for ; Fri, 17 Nov 2017 14:22:02 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 7F9E2E0295 for ; Fri, 17 Nov 2017 14:22:01 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id C9066240CE for ; Fri, 17 Nov 2017 14:22:00 +0000 (UTC) Date: Fri, 17 Nov 2017 14:22:00 +0000 (UTC) From: "Martin Desruisseaux (JIRA)" To: commits@sis.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Closed] (SIS-355) Provide a "deep copy" operation on ISO 19115 metadata MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/SIS-355?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Martin Desruisseaux closed SIS-355. ----------------------------------- > Provide a "deep copy" operation on ISO 19115 metadata > ----------------------------------------------------- > > Key: SIS-355 > URL: https://issues.apache.org/jira/browse/SIS-355 > Project: Spatial Information Systems > Issue Type: Task > Components: Metadata > Affects Versions: 0.3, 0.4, 0.5, 0.6, 0.7 > Reporter: Martin Desruisseaux > Assignee: Martin Desruisseaux > Priority: Minor > Fix For: 0.8 > > > In Apache SIS, all implementation classes of ISO 19115 metadata types have a shallow copy constructor. However there is nothing for performing a deep copy (the {{clone()}} method is not for this purpose). While deep copy should be avoided, it is sometime useful for example when using an existing metadata as a template. > h3. Better alternative > Note that the {{ModifiableMetadata.unmodifiable()}} method provides a better way to use a metadata as a template, as it returns a snapshot and allows the caller to continue to modify the original metadata object and create new snapshots. This approach allows sharing the children that have the same content, thus reducing memory usage. In comparison, deep copy operations unconditionally duplicate everything, no matter if it was needed or not. Nevertheless deep copies are still sometime useful, for example when we do not have the original {{ModifiableMetadata}} instance anymore. -- This message was sent by Atlassian JIRA (v6.4.14#64029)