* @param locations the locations (can be <code>null</code>)
* @return a (fake) located exception
* @throws ProcessingException or <code>LocatedRuntimeException</code>
*/
public static ProcessingException throwLocated(String message, Throwable thr, List locations) throws ProcessingException {
MultiLocatable multiloc;
if (thr instanceof ProcessingException) {
multiloc = (ProcessingException)thr;
} else if (thr instanceof LocatedRuntimeException) {
multiloc = (LocatedRuntimeException)thr;
} else {
multiloc = new ProcessingException(message, thr);
}
if (locations != null) {
for (int i = 0; i < locations.size(); i++) {
multiloc.addLocation((Location)locations.get(i));
}
}
if (multiloc instanceof LocatedRuntimeException) {
throw (LocatedRuntimeException)multiloc;