private void showErrors(List<EditorError> errorAccumulator) {
assert errors != errorAccumulator;
if (hasEditorErrors != null) {
// Allow higher-priority co-editor to spy on errors
for (Iterator<EditorError> it = errorAccumulator.iterator(); it.hasNext();) {
EditorError error = it.next();
if (error.getAbsolutePath().startsWith(getPath())) {
errors.add(error);
it.remove();
}
}
// Include the trailing dot
int length = getPath().length();
int pathPrefixLength = length == 0 ? 0 : (length + 1);
for (EditorError error : errors) {
((SimpleError) error).setPathPrefixLength(pathPrefixLength);
}
// Give all of the errors to the handler and use a new local accumulator
hasEditorErrors.showErrors(Collections.unmodifiableList(errors));
for (EditorError error : errors) {
if (!error.isConsumed()) {
errorAccumulator.add(error);
}
}
// Reset local error list