Map<Integer, List<IMessage>> messagesByType = getMessagesByType(l);
for (int type : messagesByType.keySet()) {
l = messagesByType.get(type);
//the values are guaranteed to have size at least equal to 1
IMessage message = l.get(0);
//messages are grouped by type, and the severity is set by type, so, this is ok...
if (message.getSeverity() == IMarker.SEVERITY_INFO) {
if (doIgnoreMessageIfJustInformational(message.getType())) {
//ok, let's ignore it for real (and don't add it) as those are not likely to be
//used anyways for other actions)
continue;
}
}
//we add even ignore messages because they might be used later in actions dependent on code analysis
if (l.size() == 1) {
//don't add additional info: not being used
// addAdditionalInfoToUnusedWildImport(message);
addToResult(result, message);
} else {
//the generator token has many associated messages - the messages may have different types,
//so, we need to get them by types
IToken generator = message.getGenerator();
CompositeMessage compositeMessage;
if (generator != null) {
compositeMessage = new CompositeMessage(message.getType(), generator, prefs);
} else {
compositeMessage = new CompositeMessage(message.getType(), message.getStartLine(document),
message.getEndLine(document), message.getStartCol(document),
message.getEndCol(document), prefs);
}
for (IMessage m : l) {
compositeMessage.addMessage(m);
}
//don't add additional info: not being used
// addAdditionalInfoToUnusedWildImport(compositeMessage);
addToResult(result, compositeMessage);
}
}
}
for (IMessage message : independentMessages) {
if (message.getSeverity() == IMarker.SEVERITY_INFO) {
if (doIgnoreMessageIfJustInformational(message.getType())) {
//ok, let's ignore it for real (and don't add it) as those are not likely to be
//used anyways for other actions)
continue;
}