Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wires.reset does not perform as expected for marshals with fields of Bytes #45

Closed
RobAustin opened this issue Jun 14, 2017 · 7 comments
Closed
Assignees

Comments

@RobAustin
Copy link
Member

RobAustin commented Jun 14, 2017

see net.openhft.chronicle.wire.WiresTest#test

 public static class Base {
        Bytes base = Bytes.elasticByteBuffer();
    }

    @Test
    public void test() {

        Base base1 = new Base();
        base1.base.clear().append("value1");

        Base base2 = new Base();
        base2.base.clear().append("value2");

        Wires.reset(base1);
        Wires.reset(base2);

        base1.base.clear().append("value1");

        Assert.assertEquals("", base2.base.toString());

    }
@epickrram
Copy link
Contributor

I've committed a workaround for now to get the build passing.

bb34735

Unclear as to what the long-term solution should be, as the need to add an annotation is non-obvious, and garbage is generated on each reset() operation.

@peter-lawrey
Copy link
Member

peter-lawrey commented Jun 16, 2017 via email

@epickrram
Copy link
Contributor

Fixed for Bytes and StringBuilder - the cleanest solution to this may be documentation + allowing the user to register a custom FieldAccess handler in WireMarshaller.

@RobAustin
Copy link
Member Author

@epickrram could you document this as you suggest and close this issue.

@RobAustin
Copy link
Member Author

RobAustin commented Feb 20, 2018

@epickrram could you pick this up today ? ( in other words add the documentation ) and close

@epickrram
Copy link
Contributor

Will do...

@hft-team-city
Copy link
Collaborator

Released in Chronicle-Wire-2.20.101, BOM-2.20.134

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants