private IProblemLocationCore[] getProblemLocationCores(ICompilationUnit unit, List<Diagnostic> diagnostics) { IProblemLocationCore[] locations = new IProblemLocationCore[diagnostics.size()]; for (int i = 0; i < diagnostics.size(); i++) { Diagnostic diagnostic = diagnostics.get(i); int problemId = getProblemId(diagnostic); int start = DiagnosticsHelper.getStartOffset(unit, diagnostic.getRange()); int end = DiagnosticsHelper.getEndOffset(unit, diagnostic.getRange()); boolean isError = diagnostic.getSeverity() == DiagnosticSeverity.Error; locations[i] = new ProblemLocationCore(start, end - start, problemId, new String[0], isError, IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER); } return locations; }