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/ParticipantExtensionPoint.java
RefactoringCorePlugin.getPluginId(), 
			fParticipantID);
		fParticipants= new ArrayList(ces.length); 
		for (int i= 0; i < ces.length; i++) {
			ParticipantDescriptor descriptor= new ParticipantDescriptor(ces[i]);
			IStatus status= descriptor.checkSyntax();
			switch (status.getSeverity()) {
				case IStatus.ERROR:
					RefactoringCorePlugin.log(status);
					break;
				case IStatus.WARNING:
				case IStatus.INFO:
					RefactoringCorePlugin.log(status);
					
				default:
					fParticipants.add(descriptor);
			}
		}
	}
	
	
	
	private static EvaluationContext createEvaluationContext(RefactoringProcessor processor, Object element, String[] affectedNatures) {
		EvaluationContext result= new EvaluationContext(null, element);
		result.addVariable("element", element); 
		result.addVariable("affectedNatures", Arrays.asList(affectedNatures)); 
		result.addVariable("processorIdentifier", processor.getIdentifier()); 
		return result;
	}
}