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

The EntryBuilder.buildWithHistory () method there is a potential problem of circular reference. #33

Closed
yososs opened this issue May 2, 2016 · 0 comments

Comments

@yososs
Copy link
Contributor

yososs commented May 2, 2016

The EntryBuilder.buildWithHistory () method there is a potential problem of circular reference.
Stack overflow exception is thrown at the timing to write the KeePassFile to file.

Circulation call occurs in Entry.hashCode () method.

    @Test
    public void testBuildWithHistory() {
        UUID uuid = UUID.randomUUID();
        Entry entry = new EntryBuilder("v1").uuid(uuid).build();
        Entry entry2 = new EntryBuilder(entry).title("v2").buildWithHistory();
        Entry entry3 = new EntryBuilder(entry2).title("v3").buildWithHistory();
        try{
            entry.hashCode();
            entry2.hashCode();
            entry3.hashCode();
        }catch(StackOverflowError e){
            e.printStackTrace();
            Assert.fail();
        }
    }
@cternes cternes closed this as completed in 80332ab May 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant