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

Off by one error in basic example #633

Closed
Beetle-Lord opened this issue Nov 12, 2024 · 2 comments
Closed

Off by one error in basic example #633

Beetle-Lord opened this issue Nov 12, 2024 · 2 comments
Labels

Comments

@Beetle-Lord
Copy link

Hello. I was attempting to use eo-yaml with an extremely basic test, and I immediately ran into an issue...

    static public class Test {
        private List<String> entries = new ArrayList<>();

        public List<String> getEntries() {
            return entries;
        }

        public void setEntries(List<String> entries) {
            this.entries = entries;
        }
    }

    public static void main(String[] args) {
        Test m = new Test();
        m.entries.add("Test1");
        m.entries.add("Test2");
        m.entries.add("Test3");
        System.out.println(Yaml.createYamlDump(m).dumpMapping());
    }

The result of running this code is:

entries:
  - Test1
  - Test2

If you include Test4 in the example code, then the output will go up to Test3, etc. The final entry does not get included.

amihaiemil added a commit that referenced this issue Nov 13, 2024
@amihaiemil
Copy link
Member

amihaiemil commented Nov 13, 2024

@Beetle-Lord I added the exact scenario as a unit test here and it passes with no problems. What version of the library are you using? We release quite often so you always want to take the latest version.

@amihaiemil
Copy link
Member

No feedback after 3 days, closing. Feel free to open another issue if you have any other problems or questions.

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

No branches or pull requests

2 participants