if (warning.errorLine != null && !warning.errorLine.isEmpty()) {
output.append(warning.errorLine);
}
if (warning.location != null && warning.location.getSecondary() != null) {
Location location = warning.location.getSecondary();
boolean omitted = false;
while (location != null) {
if (location.getMessage() != null
&& !location.getMessage().isEmpty()) {
output.append(" "); //$NON-NLS-1$
String path = mClient.getDisplayPath(warning.project,
location.getFile());
output.append(path);
Position start = location.getStart();
if (start != null) {
int line = start.getLine();
if (line >= 0) {
output.append(':');
output.append(Integer.toString(line + 1));
}
}
if (location.getMessage() != null
&& !location.getMessage().isEmpty()) {
output.append(':');
output.append(' ');
output.append(location.getMessage());
}
output.append('\n');
} else {
omitted = true;
}
location = location.getSecondary();
}
if (!abbreviate && omitted) {
location = warning.location.getSecondary();
StringBuilder sb = new StringBuilder(100);
sb.append("Also affects: ");
int begin = sb.length();
while (location != null) {
if (location.getMessage() == null
|| location.getMessage().isEmpty()) {
if (sb.length() > begin) {
sb.append(", ");
}
String path = mClient.getDisplayPath(warning.project,
location.getFile());
sb.append(path);
Position start = location.getStart();
if (start != null) {
int line = start.getLine();
if (line >= 0) {
sb.append(':');
sb.append(Integer.toString(line + 1));
}
}
}
location = location.getSecondary();
}
String wrapped = Main.wrap(sb.toString(), Main.MAX_LINE_WIDTH, " "); //$NON-NLS-1$
output.append(wrapped);
}
}