#fixed code
                                private boolean findNext() throws IOException {
        if (currentPartStream != null) {
            InputStream is = currentPartStream.branch();
            try {
                while (is.read() != -1) { /* nop */}    // advance stream to end of next boundary 
                finishReadingLine(stream);              // and consume the rest of the boundary line including the newline
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        if (stream.peek() != -1) {
            currentPartStream = new BranchableInputStream(new OneTokenInputStream(stream.branch(), boundary));
            return true;
        }
        return false;
    }
#vulnerable code 
                                private boolean findNext() throws IOException {
        if (currentPartStream != null && !currentPartStream.done()) {
            InputStream is = new OneTokenInputStream(stream, boundary);
            try {
                while (is.read() != -1) { /* nop */}
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        if (stream.peek() != -1) {
            currentPartStream = new OneTokenInputStream(stream.branch(), boundary);
            return true;
        }
        return false;
    } 
                            #location 5 
                            #vulnerability type RESOURCE_LEAK