class ClearCaseHistoryParser implements Executor.StreamHandler {

    private History history;
    private ClearCaseRepository repository = new ClearCaseRepository();

    History parse(File file, Repository repos) throws HistoryException {
        repository = (ClearCaseRepository) repos;
        try {
            Executor executor = repository.getHistoryLogExecutor(file);
            int status = executor.exec(true, this);

            if (status != 0) {
                throw new HistoryException("Failed to get history for: \"" +
                                           file.getAbsolutePath() + "\" Exit code: " + status);
            }

            return history;
        } catch (IOException e) {
            throw new HistoryException("Failed to get history for: \"" +
                                       file.getAbsolutePath() + "\"", e);
        }
    }

   /**
     * Process the output from the log command and insert the HistoryEntries
     * into the history field.
     *
     * @param input The output from the process
     * @throws java.io.IOException If an error occurs while reading the stream
     */
    @Override
    public void processStream(InputStream input) throws IOException {<FILL_FUNCTION_BODY>}

    /**
     * Parse the given string.
     *
     * @param buffer The string to be parsed
     * @return The parsed history
     * @throws IOException if we fail to parse the buffer
     */
    History parse(String buffer) throws IOException {
        processStream(new ByteArrayInputStream(buffer.getBytes(StandardCharsets.UTF_8)));
        return history;
    }
}

        BufferedReader in = new BufferedReader(new InputStreamReader(input));
        List<HistoryEntry> entries = new ArrayList<>();
        String s;
        HistoryEntry entry = null;
        while ((s = in.readLine()) != null) {
            if (!"create version".equals(s) && !"create directory version".equals(s)) {
                // skip this history entry
                while ((s = in.readLine()) != null) {
                    if (".".equals(s)) {
                        break;
                    }
                }
                continue;
            }

            entry = new HistoryEntry();
            if ((s = in.readLine()) != null) {
                try {
                    entry.setDate(repository.parse(s));
                } catch (ParseException pe) {
                    //
                    // Overriding processStream() thus need to comply with the
                    // set of exceptions it can throw.
                    //
                    throw new IOException("Could not parse date: " + s, pe);
                }
            }
            if ((s = in.readLine()) != null) {
                entry.setAuthor(s);
            }
            if ((s = in.readLine()) != null) {
                s = s.replace('\\', '/');
                entry.setRevision(s);
            }

            StringBuilder message = new StringBuilder();
            String glue = "";
            while ((s = in.readLine()) != null && !".".equals(s)) {
                if (s.isEmpty()) {
                    // avoid empty lines in comments
                    continue;
                }
                message.append(glue);
                message.append(s.trim());
                glue = "\n";
            }
            entry.setMessage(message.toString());
            entry.setActive(true);
            entries.add(entry);
        }
        history = new History();
        history.setHistoryEntries(entries);
    
<no_super_class>