final String selection= generic.getAttribute(InlineMethodRefactoring.ATTRIBUTE_SELECTION);
final String selection= generic.getAttribute(JavaRefactoringDescriptor.SELECTION);
	public final Refactoring createRefactoring(final RefactoringDescriptor descriptor) throws CoreException {		int selectionStart= -1;		int selectionLength= -1;		ICompilationUnit unit= null;		CompilationUnit node= null;		RefactoringArguments arguments= null;		if (descriptor instanceof JavaRefactoringDescriptor) {			final JavaRefactoringDescriptor extended= (JavaRefactoringDescriptor) descriptor;			arguments= extended.createArguments();		}		if (arguments instanceof JavaRefactoringArguments) {			final JavaRefactoringArguments generic= (JavaRefactoringArguments) arguments;			final String selection= generic.getAttribute(InlineMethodRefactoring.ATTRIBUTE_SELECTION);			if (selection != null) {				int offset= -1;				int length= -1;				final StringTokenizer tokenizer= new StringTokenizer(selection);				if (tokenizer.hasMoreTokens())					offset= Integer.valueOf(tokenizer.nextToken()).intValue();				if (tokenizer.hasMoreTokens())					length= Integer.valueOf(tokenizer.nextToken()).intValue();				if (offset >= 0 && length >= 0) {					selectionStart= offset;					selectionLength= length;				} else					throw new CoreException(new Status(IStatus.ERROR, JavaPlugin.getPluginId(), 0, NLS.bind(RefactoringCoreMessages.InitializableRefactoring_illegal_argument, new Object[] { selection, InlineMethodRefactoring.ATTRIBUTE_SELECTION}), null));			}			final String handle= generic.getAttribute(JavaRefactoringDescriptor.INPUT);			if (handle != null) {				final IJavaElement element= JavaCore.create(handle);				if (element == null || !element.exists())					throw new CoreException(new Status(IStatus.ERROR, JavaPlugin.getPluginId(), 0, NLS.bind(RefactoringCoreMessages.InitializableRefactoring_input_not_exists, InlineMethodRefactoring.ID_INLINE_METHOD), null));				else {					if (element instanceof ICompilationUnit) {						unit= (ICompilationUnit) element;						if (selection == null)							throw new CoreException(new Status(IStatus.ERROR, JavaPlugin.getPluginId(), 0, NLS.bind(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, InlineMethodRefactoring.ATTRIBUTE_SELECTION), null));					} else if (element instanceof IMethod) {						final IMethod method= (IMethod) element;						try {							final ISourceRange range= method.getNameRange();							if (range != null) {								selectionStart= range.getOffset();								selectionLength= range.getLength();							} else								throw new CoreException(new Status(IStatus.ERROR, JavaPlugin.getPluginId(), 0, NLS.bind(RefactoringCoreMessages.InitializableRefactoring_illegal_argument, new Object[] { handle, JavaRefactoringDescriptor.INPUT}), null));						} catch (JavaModelException exception) {							throw new CoreException(new Status(IStatus.ERROR, JavaPlugin.getPluginId(), 0, NLS.bind(RefactoringCoreMessages.InitializableRefactoring_input_not_exists, InlineMethodRefactoring.ID_INLINE_METHOD), exception));						}						unit= method.getCompilationUnit();					} else						throw new CoreException(new Status(IStatus.ERROR, JavaPlugin.getPluginId(), 0, NLS.bind(RefactoringCoreMessages.InitializableRefactoring_illegal_argument, new Object[] { handle, JavaRefactoringDescriptor.INPUT}), null));					final ASTParser parser= ASTParser.newParser(AST.JLS3);					parser.setResolveBindings(true);					parser.setSource(unit);					node= (CompilationUnit) parser.createAST(null);				}			} else				throw new CoreException(new Status(IStatus.ERROR, JavaPlugin.getPluginId(), 0, NLS.bind(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptor.INPUT), null));		} else			throw new CoreException(new Status(IStatus.ERROR, JavaPlugin.getPluginId(), 0, RefactoringCoreMessages.InitializableRefactoring_inacceptable_arguments, null));		return InlineMethodRefactoring.create(unit, node, selectionStart, selectionLength);	}