public static ASTRewriteCorrectionProposal createCastProposal(IInvocationContext context, ITypeBinding castTypeBinding, Expression nodeToCast, int relevance) { ICompilationUnit cu= context.getCompilationUnit(); String label; String castType= BindingLabelProvider.getBindingLabel(castTypeBinding, JavaElementLabels.ALL_DEFAULT); if (nodeToCast.getNodeType() == ASTNode.CAST_EXPRESSION) { label= Messages.format(CorrectionMessages.TypeMismatchSubProcessor_changecast_description, castType); } else { label= Messages.format(CorrectionMessages.TypeMismatchSubProcessor_addcast_description, castType); } return new CastCorrectionProposal(label, cu, nodeToCast, castTypeBinding, relevance); }
public static ASTRewriteCorrectionProposal createCastProposal(IInvocationContext context, ITypeBinding castTypeBinding, Expression nodeToCast, int relevance) { ICompilationUnit cu= context.getCompilationUnit(); String label; String castType= BindingLabelProvider.getBindingLabel(castTypeBinding, JavaElementLabels.ALL_DEFAULT); if (nodeToCast.getNodeType() == ASTNode.CAST_EXPRESSION) { label= Messages.format(CorrectionMessages.TypeMismatchSubProcessor_changecast_description, castType); } else { label= Messages.format(CorrectionMessages.TypeMismatchSubProcessor_addcast_description, castType); } return new CastCorrectionProposal(label, cu, nodeToCast, castTypeBinding, relevance); }
proposals.add(new CastCorrectionProposal(label, cu, target, (ITypeBinding) null, IProposalRelevance.CHANGE_CAST));
proposals.add(new CastCorrectionProposal(label, cu, target, (ITypeBinding) null, IProposalRelevance.CHANGE_CAST));