Bug 116223 [refactoring] ProcessorBasedRefactoring does not handle exceptions thrown by participants
I20051108-1011 ProcessorBasedRefactoring protects itself against participants that throw an exception in createChange(..). However, it does not catch execptions thrown in initialize(..) or in checkConditions(..). We had a case where initialize(..) threw a ClassCastException, which generated a wrong error message (participant does not extend required type). I think we should protect all call backs and disable participants that throw a RuntimeException.
org.eclipse.ltk.core.refactoring/src/org/eclipse/ltk/core/refactoring/participants/CheckConditionsContext.java
}
	}
	
	/**
	 * Checks the condition of all registered condition checkers and returns a
	 * merge status result.
	 * 
	 * @param pm a progress monitor or <code>null</code> if no progress 
	 *  reporting is desired
	 * 
	 * @return the combined status result
	 * 
	 * @throws CoreException if an error occurs during condition checking
	 */
	public RefactoringStatus check(IProgressMonitor pm) throws CoreException {
		if (pm == null)
			pm= new NullProgressMonitor();
		RefactoringStatus result= new RefactoringStatus();
		Collection values = fCheckers.values();
		pm.beginTask("", values.size()); 
		for (Iterator iter= values.iterator(); iter.hasNext();) {
			IConditionChecker checker= (IConditionChecker)iter.next();
			result.merge(checker.check(new SubProgressMonitor(pm, 1)));
			if (pm.isCanceled())
				throw new OperationCanceledException();
		}
		return result;
	}
}