AST ast= node.getAST(); ASTRewrite rewrite= ASTRewrite.create(ast);  StringLiteral newStringLiteral= ast.newStringLiteral(); newStringLiteral.setLiteralValue(warningToken);  Annotation existing= findExistingAnnotation((List) node.getStructuralProperty(property)); if (existing == null) { ListRewrite listRewrite= rewrite.getListRewrite(node, property);  SingleMemberAnnotation newAnnot= ast.newSingleMemberAnnotation(); newAnnot.setTypeName(ast.newSimpleName("SuppressWarnings"));
String label= Messages.format(CorrectionMessages.ModifierCorrectionSubProcessor_suppress_warnings_label, new String[] { warningToken, name }); ASTRewriteCorrectionProposal proposal= new SuppressWarningsProposal(warningToken, label, cu, node, property, relevance);
	private static void addSuppressWarningsProposal(ICompilationUnit cu, ASTNode node, String warningToken, int relevance, Collection proposals) {		ChildListPropertyDescriptor property= null;		String name;		switch (node.getNodeType()) {			case ASTNode.SINGLE_VARIABLE_DECLARATION:				property= SingleVariableDeclaration.MODIFIERS2_PROPERTY;				name= ((SingleVariableDeclaration) node).getName().getIdentifier();				break;			case ASTNode.VARIABLE_DECLARATION_STATEMENT:				property= VariableDeclarationStatement.MODIFIERS2_PROPERTY;				name= getFirstFragmentName(((VariableDeclarationStatement) node).fragments());				break;			case ASTNode.TYPE_DECLARATION:				property= TypeDeclaration.MODIFIERS2_PROPERTY;				name= ((TypeDeclaration) node).getName().getIdentifier();				break;			case ASTNode.ANNOTATION_TYPE_DECLARATION:				property= AnnotationTypeDeclaration.MODIFIERS2_PROPERTY;				name= ((AnnotationTypeDeclaration) node).getName().getIdentifier();				break;			case ASTNode.ENUM_DECLARATION:				property= EnumDeclaration.MODIFIERS2_PROPERTY;				name= ((EnumDeclaration) node).getName().getIdentifier();				break;			case ASTNode.FIELD_DECLARATION:					property= FieldDeclaration.MODIFIERS2_PROPERTY;				name= getFirstFragmentName(((FieldDeclaration) node).fragments());				break;			case ASTNode.INITIALIZER:				property= Initializer.MODIFIERS2_PROPERTY;				name= CorrectionMessages.ModifierCorrectionSubProcessor_suppress_warnings_initializer_label;				break;			case ASTNode.METHOD_DECLARATION:				property= MethodDeclaration.MODIFIERS2_PROPERTY;				name= ((MethodDeclaration) node).getName().getIdentifier() + "()"; //$NON-NLS-1$				break;			case ASTNode.ANNOTATION_TYPE_MEMBER_DECLARATION:				property= AnnotationTypeMemberDeclaration.MODIFIERS2_PROPERTY;				name= ((AnnotationTypeMemberDeclaration) node).getName().getIdentifier() + "()"; //$NON-NLS-1$				break;			case ASTNode.ENUM_CONSTANT_DECLARATION:				property= EnumConstantDeclaration.MODIFIERS2_PROPERTY;				name= ((EnumConstantDeclaration) node).getName().getIdentifier();				break;			default:				JavaPlugin.logErrorMessage("SuppressWarning quick fix: wrong node kind: " + node.getNodeType()); //$NON-NLS-1$				return;		}				AST ast= node.getAST();		ASTRewrite rewrite= ASTRewrite.create(ast);				StringLiteral newStringLiteral= ast.newStringLiteral();		newStringLiteral.setLiteralValue(warningToken);				Annotation existing= findExistingAnnotation((List) node.getStructuralProperty(property));		if (existing == null) {			ListRewrite listRewrite= rewrite.getListRewrite(node, property);						SingleMemberAnnotation newAnnot= ast.newSingleMemberAnnotation();			newAnnot.setTypeName(ast.newSimpleName("SuppressWarnings")); //$NON-NLS-1$			newAnnot.setValue(newStringLiteral);						listRewrite.insertFirst(newAnnot, null);		} else if (existing instanceof SingleMemberAnnotation) {			SingleMemberAnnotation annotation= (SingleMemberAnnotation) existing;			Expression value= annotation.getValue();			if (!addSuppressArgument(rewrite, value, newStringLiteral)) {				rewrite.set(existing, SingleMemberAnnotation.VALUE_PROPERTY, newStringLiteral, null);			}		} else if (existing instanceof NormalAnnotation) {			NormalAnnotation annotation= (NormalAnnotation) existing;			Expression value= findValue(annotation.values());			if (!addSuppressArgument(rewrite, value, newStringLiteral)) {				ListRewrite listRewrite= rewrite.getListRewrite(annotation, NormalAnnotation.VALUES_PROPERTY);				MemberValuePair pair= ast.newMemberValuePair();				pair.setName(ast.newSimpleName("value")); //$NON-NLS-1$				pair.setValue(newStringLiteral);				listRewrite.insertFirst(pair, null);			}			}		String label= Messages.format(CorrectionMessages.ModifierCorrectionSubProcessor_suppress_warnings_label, new String[] { warningToken, name });		Image image= JavaPluginImages.get(JavaPluginImages.IMG_OBJS_ANNOTATION);		ASTRewriteCorrectionProposal proposal= new ASTRewriteCorrectionProposal(label, cu, rewrite, relevance, image);		proposal.setCommandId(ADD_SUPPRESSWARNINGS_ID);		proposals.add(proposal);	}