Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 24416200CD9 for ; Thu, 3 Aug 2017 14:33:07 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 22B7316B737; Thu, 3 Aug 2017 12:33:07 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 682DC16B738 for ; Thu, 3 Aug 2017 14:33:06 +0200 (CEST) Received: (qmail 33798 invoked by uid 500); 3 Aug 2017 12:33:05 -0000 Mailing-List: contact dev-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@felix.apache.org Delivered-To: mailing list dev@felix.apache.org Received: (qmail 33787 invoked by uid 99); 3 Aug 2017 12:33:05 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Aug 2017 12:33:05 +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 EFDE1C0286 for ; Thu, 3 Aug 2017 12:33:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-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 (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id lyNSFxEy0HUS for ; Thu, 3 Aug 2017 12:33:03 +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 A68705FE02 for ; Thu, 3 Aug 2017 12:33: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 76817E0DDB for ; Thu, 3 Aug 2017 12:33: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 A612524656 for ; Thu, 3 Aug 2017 12:33:00 +0000 (UTC) Date: Thu, 3 Aug 2017 12:33:00 +0000 (UTC) From: "David Bosschaert (JIRA)" To: dev@felix.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (FELIX-5666) Serializer goes into infinite loop MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 03 Aug 2017 12:33:07 -0000 [ https://issues.apache.org/jira/browse/FELIX-5666?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16112648#comment-16112648 ] David Bosschaert commented on FELIX-5666: ----------------------------------------- Ah yes, exactly. The sourceAsDTO() is context information to the converter in relation to the provided object. It has no connection to the Json Serializer and it's also not stored in the converter. So when the serializer is called that information is simply not there any more. I guess it might make sense to add things like sourceAsDTO() and others to the serializer? It might even inherit the Specifying.java interface from the Converter ([see here|https://oss.sonatype.org/content/repositories/osgi/org/osgi/org.osgi.util.converter/1.0.0-SNAPSHOT/org.osgi.util.converter-1.0.0-20170803.091235-72-sources.jar])... WDYT about adding something like this to the serializer? > Serializer goes into infinite loop > ---------------------------------- > > Key: FELIX-5666 > URL: https://issues.apache.org/jira/browse/FELIX-5666 > Project: Felix > Issue Type: Bug > Components: Converter > Reporter: David Leangen > Assignee: David Bosschaert > > I'm only guessing as to what the problem is, following some stepping through the code. I could not find any similar existing test cases, but if the following does not immediately click for [~bosschaert], I will try to add one. > It appears that, when serializing an object to a "DTO-Type" object to a Map, some kind of backing object is created. > If the backing object contains a field that instantiates the same DTO, then the loop gets created. > Example: > {code} > public class MyDtoType { > public String id; > public MyDtoType( String anID ) { > id = anID; > } > public static MyDtoType error() { > return new MyDtoType( "ERROR" ); > } > } > {code} > It looks like the serializer keeps calling the error() method infinitely, but I am not able to easily pinpoint where this happens. -- This message was sent by Atlassian JIRA (v6.4.14#64029)