String noStarWarning = null;
String actionMessage = null;
List<ImportPattern> patterns = getClauses();
if (!patterns.isEmpty()) {
for (Iterator<ImportPattern> iter = patterns.iterator(); iter.hasNext();) {
ImportPattern pattern = iter.next();
if (pattern.getName().equals("*") && iter.hasNext()) {
noStarWarning = "The catch-all pattern \"*\" should be in the last position.";
actionMessage = "Move \"*\" pattern to the last position.";
break;
}
}
if (noStarWarning == null) {
ImportPattern last = patterns.get(patterns.size() - 1);
if (!last.getName().equals("*")) {
noStarWarning = "The catch-all pattern \"*\" should be present and in the last position.";
actionMessage = "Add missing \"*\" pattern.";
}
}
}