ITypeBinding sender= fSenderBinding; if (sender.isParameterizedType() || sender.isRawType()) { sender= sender.getGenericType(); }
	protected ASTRewrite getRewrite() throws CoreException {		ITypeBinding sender= fSenderBinding;		if (sender.isParameterizedType() || sender.isRawType()) {			sender= sender.getGenericType();		}		CompilationUnit astRoot= ASTResolving.findParentCompilationUnit(fNode);		ASTNode typeDecl= astRoot.findDeclaringNode(sender);		ASTNode newTypeDecl= null;		boolean isInDifferentCU;		if (typeDecl != null) {			isInDifferentCU= false;			newTypeDecl= typeDecl;		} else {			isInDifferentCU= true;			ASTParser astParser= ASTParser.newParser(ASTProvider.AST_LEVEL);			astParser.setSource(getCompilationUnit());			astParser.setResolveBindings(true);			astRoot= (CompilationUnit) astParser.createAST(null);			newTypeDecl= astRoot.findDeclaringNode(sender.getKey());		}		if (newTypeDecl != null) {			ASTRewrite rewrite= ASTRewrite.create(astRoot.getAST());						MethodDeclaration newStub= getStub(rewrite, newTypeDecl);						ChildListPropertyDescriptor property= ASTNodes.getBodyDeclarationsProperty(newTypeDecl);			List members= (List) newTypeDecl.getStructuralProperty(property);						int insertIndex;			if (isConstructor()) {				insertIndex= findConstructorInsertIndex(members);			} else if (!isInDifferentCU) {				insertIndex= findMethodInsertIndex(members, fNode.getStartPosition());			} else {				insertIndex= members.size();			}			ListRewrite listRewriter= rewrite.getListRewrite(newTypeDecl, property);			listRewriter.insertAt(newStub, insertIndex, null);							return rewrite;		}		return null;	}