You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "David Leangen (JIRA)" <ji...@apache.org> on 2017/07/31 05:14:00 UTC

[jira] [Updated] (FELIX-5666) Serializer goes into infinite loop

     [ https://issues.apache.org/jira/browse/FELIX-5666?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Leangen updated FELIX-5666:
---------------------------------
    Description: 
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.

  was:
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:

public class MyDtoType {
  public String id;

  public MyDtoType( String anID ) {
    id = anID;
  }

  public static MyDtoType error() {
    return new MyDtoType( "ERROR" );
  }
}

It looks like the serializer keeps calling the error() method infinitely, but I am not able to easily pinpoint where this happens.


> 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
>
> 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)