PromoteTempToFieldRefactoring ref= PromoteTempToFieldRefactoring.create(cu, selection.getOffset(), selection.getLength(), JavaPreferencesSettings.getCodeGenerationSettings());
PromoteTempToFieldRefactoring ref= PromoteTempToFieldRefactoring.create(cu, selection.getOffset(), selection.getLength(), JavaPreferencesSettings.getCodeGenerationSettings(cu.getJavaProject()));
	private void failHelper(int startLine, int startColumn, int endLine, int endColumn, 						  String newName,						  boolean declareStatic,						  boolean declareFinal,						  int initializeIn,						  int accessModifier,						  int expectedSeverity) throws Exception{		ICompilationUnit cu= createCUfromTestFile(getPackageP(), false, true);						  			ISourceRange selection= TextRangeUtil.getSelection(cu, startLine, startColumn, endLine, endColumn);        PromoteTempToFieldRefactoring ref= PromoteTempToFieldRefactoring.create(cu, selection.getOffset(), selection.getLength(), JavaPreferencesSettings.getCodeGenerationSettings());				RefactoringStatus result= ref.checkInitialConditions(new NullProgressMonitor());	        ref.setFieldName(newName);        ref.setDeclareFinal(declareFinal);        ref.setDeclareStatic(declareStatic);        ref.setInitializeIn(initializeIn);        ref.setVisibility(accessModifier);		result.merge(ref.checkFinalConditions(new NullProgressMonitor()));		if (result.isOK())			result= null;		assertNotNull("precondition was supposed to fail",result);		assertEquals("incorrect severity:", expectedSeverity, result.getSeverity());	}