#fixed code
                                public void pause(final String pid,
        final boolean pause) throws IOException {
        this.checkExist(pid);
        try (final Item item = this.item()) {
            new Xocument(item.path()).modify(
                new Directives().xpath(
                    String.format("/catalog/project[@id='%s']/alive", pid)
                ).strict(1).set(!pause)
            );
        }
    }
#vulnerable code 
                                public void pause(final String pid,
        final boolean pause) throws IOException {
        if (!this.exists(pid)) {
            throw new IllegalArgumentException(
                new Par("Project %s doesn't exist, can't pause").say(pid)
            );
        }
        try (final Item item = this.item()) {
            new Xocument(item.path()).modify(
                new Directives().xpath(
                    String.format("/catalog/project[@id='%s']/alive", pid)
                ).strict(1).set(!pause)
            );
        }
    } 
                            #location 5 
                            #vulnerability type RESOURCE_LEAK