Skip to content

replaceValue crashes when the target property has no value or separator #82

Closed

Description

@nx-eric-jarosch

TestCase

public class TestProperties {
    @Test
    void testPutReplaceMissingSepOrValue() throws IOException, URISyntaxException {
        final String given = "key1=val1\n" +
                "key2=\n" +
                "key3";
        final String expected = "key1=value1\n" +
                "key2=value2\n" +
                "key3=value3";

        Properties p = Properties.loadProperties(new StringReader(given));
        p.put("key1", "value1");
        p.put("key2", "value2");
        p.put("key3", "value3");

        StringWriter sw = new StringWriter();
        p.store(sw);
        assertThat(sw.toString()).isEqualTo(expected);
    }
}

Activity

  1. quintesse commented on Sep 27, 2026

    @quintesse
    Collaborator

    Confirmed! Thanks! (PS don't try to fix it, I'll be fixed together with some other stuff I'm working on)

  2. self-assigned this
    on Sep 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions