final String name= createRefactoringScriptName(); if (name != null) { final IPackageFragment fragment= getRefactoringScriptPackage(); if (fragment != null) { final IResource resource= fragment.getResource(); if (resource instanceof IFolder) {                       } }
try { final ByteArrayOutputStream stream= new ByteArrayOutputStream(1024); RefactoringCore.getHistoryService().writeRefactoringSession(descriptor, stream, false); fDeprecationScript= stream.toString(SCRIPT_ENCODING); } catch (CoreException exception) { JavaPlugin.log(exception); } catch (UnsupportedEncodingException exception) { Assert.isTrue(false);
	public void prepareDelegate() throws JavaModelException {		Assert.isNotNull(fDelegateRewrite);		Assert.isNotNull(fDeclaration);		initialize();		// Moving to a new type?		if (fDestinationTypeBinding != null) {			fDestinationType= fOriginalRewrite.getImportRewrite().addImport(fDestinationTypeBinding, getAst());			fIsMoveToAnotherFile= true;		} else			fIsMoveToAnotherFile= false;		fTrackedPosition= fDelegateRewrite.getASTRewrite().track(fDeclaration);		ASTNode delegateBody= createBody(fDeclaration);		if (delegateBody != null) {			// is null for interface and abstract methods			fDelegateRewrite.getASTRewrite().set(getBodyHead(fDeclaration), getBodyProperty(), delegateBody, null);		}		if (fDeclareDeprecated) {			final RefactoringSessionDescriptor descriptor= createRefactoringScript();			if (descriptor != null) {				final String name= createRefactoringScriptName();				if (name != null) {					final IPackageFragment fragment= getRefactoringScriptPackage();					if (fragment != null) {						final IResource resource= fragment.getResource();						if (resource instanceof IFolder) {//							final IFolder folder= (IFolder) resource;//							final URI uri= folder.getFile(name).getLocationURI();//							if (uri != null) {//								OutputStream stream= null;//								try {//									final IFileStore store= EFS.getStore(uri);//									if (store != null) {//										stream= new BufferedOutputStream(store.openOutputStream(EFS.NONE, null));//										RefactoringCore.getRefactoringHistoryService().writeRefactoringSession(descriptor, stream, false);//									}//								} catch (CoreException exception) {//									JavaPlugin.log(exception);//								} finally {//									if (stream != null) {//										try {//											stream.close();//										} catch (IOException exception) {//											// Do nothing//										}//									}//								}//							}						}					}				}			}			createJavadoc();		}	}