protected TemplateIssue createTemplateIssue(String sourcePath,
                                                    CompileEvent event) {
            SourceInfo info = event.getSourceInfo();
            if (info == null) {
                return null;
            }

            CompilationUnit unit = event.getCompilationUnit();
            if (unit == null) {
                return null;
            }

            Date lastModifiedDate = new Date(new File(sourcePath).lastModified());

            String message = event.getMessage();
            String detailedMessage = event.getDetailedMessage();
            String sourceInfoMessage = event.getSourceInfoMessage();

            int lineNumber = -1;
            int startPos = -1;
            int eEndPos = -1;
            int detailPos = -1;

            int linePos = -1;

            String lineStr = null;
            String underline = null;

            try {
                lineNumber = info.getLine();
                startPos = info.getStartPosition();
                eEndPos = info.getEndPosition();
                detailPos = info.getDetailPosition();

                if (mOpenReader == null ||
                    mOpenUnit != unit ||
                    mOpenReader.getLineNumber() >= lineNumber) {

                    if (mOpenReader != null) {
                        mOpenReader.close();
                    }

                    mOpenUnit = unit;
                    mOpenReader = new LinePositionReader(new BufferedReader(unit.getReader()));
                }

                mOpenReader.skipForwardToLine(lineNumber);
                linePos = mOpenReader.getNextPosition();

                lineStr = mOpenReader.readLine();
                lineStr = LinePositionReader.cleanWhitespace(lineStr);

                int indentSize = startPos - linePos;
                String indent = LinePositionReader.createSequence(' ', indentSize);

                int markerSize = eEndPos - startPos + 1;
                String marker = LinePositionReader.createSequence('^', markerSize);
                underline = indent + marker;
            }
            catch (IOException ex) {
                mLog.error(ex);
            }

            int state = -1;
            if (event.isError()) { state = TemplateIssue.ERROR; }
            else if (event.isWarning()) { state = TemplateIssue.WARNING; }

            return new TemplateIssue
                (sourcePath, lastModifiedDate, state,
                 message, detailedMessage, sourceInfoMessage,
                 lineStr, underline, lineNumber,
                 startPos, eEndPos,
                 startPos - linePos,
                 eEndPos - linePos + 1,
                 detailPos - linePos);
        }