#fixed code
                                public void speed(final String uid, final double speed)
        throws IOException {
        this.checkExisting(uid);
        try (final Item item = this.item()) {
            new Xocument(item.path()).modify(
                new Directives().xpath(
                    String.format(
                        "/people/person[@id='%s']",
                        uid
                    )
                ).addIf("speed").set(speed)
            );
        }
    }
#vulnerable code 
                                public void speed(final String uid, final double speed)
        throws IOException {
        if (!this.exists(uid)) {
            throw new IllegalArgumentException(
                    new Par("Person @%s doesn't exist").say(uid)
            );
        }
        try (final Item item = this.item()) {
            new Xocument(item.path()).modify(
                new Directives().xpath(
                    String.format(
                        "/people/person[@id='%s']",
                        uid
                    )
                ).addIf("speed").set(speed)
            );
        }
    } 
                            #location 5 
                            #vulnerability type RESOURCE_LEAK