private void addDelegate() throws JavaModelException { DelegateMethodCreator creator= new DelegateMethodCreator(); creator.setDeclaration(fMethDecl); creator.setDeclareDeprecated(fDelegateDeprecation); creator.setSourceRewrite(fCuRewrite); creator.prepareDelegate(); /* * The delegate now contains a call and a javadoc reference to the * old method (i.e., to itself). * * Use ReferenceUpdate() / DocReferenceUpdate() to update these * references like any other reference. */ final ASTNode delegateInvocation= creator.getDelegateInvocation(); if (delegateInvocation != null) // may be null if the delegate is an interface method or // abstract -> no body new ReferenceUpdate(delegateInvocation, creator.getDelegateRewrite(), fResult).updateNode(); MethodRef javadocReference= creator.getJavadocReference(); if (javadocReference != null) new DocReferenceUpdate(javadocReference, creator.getDelegateRewrite(), fResult).updateNode(); creator.createEdit(); }
private void addDelegate() throws JavaModelException { DelegateMethodCreator creator= new DelegateMethodCreator(); creator.setDeclaration(fMethDecl); creator.setDeclareDeprecated(fDelegateDeprecation); creator.setSourceRewrite(fCuRewrite); creator.prepareDelegate(); /* * The delegate now contains a call and a javadoc reference to the * old method (i.e., to itself). * * Use ReferenceUpdate() / DocReferenceUpdate() to update these * references like any other reference. */ final ASTNode delegateInvocation= creator.getDelegateInvocation(); if (delegateInvocation != null) // may be null if the delegate is an interface method or // abstract -> no body new ReferenceUpdate(delegateInvocation, creator.getDelegateRewrite(), fResult).updateNode(); MethodRef javadocReference= creator.getJavadocReference(); if (javadocReference != null) new DocReferenceUpdate(javadocReference, creator.getDelegateRewrite(), fResult).updateNode(); creator.createEdit(); }