#vulnerable code 
                                public boolean applied(final String uid) throws IOException {
        if (!this.exists(uid)) {
            throw new IllegalArgumentException(
                new Par("Person @%s doesn't exist").say(uid)
            );
        }
        try (final Item item = this.item()) {
            return !new Xocument(item).nodes(
                String.format("//people/person[@id  ='%s']/applied", uid)
            ).isEmpty();
        }
    } 
                            #location 4 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                public boolean applied(final String uid) throws IOException {
        this.checkExisting(uid);
        try (final Item item = this.item()) {
            return !new Xocument(item).nodes(
                String.format("//people/person[@id  ='%s']/applied", uid)
            ).isEmpty();
        }
    }