Expression rightExpression= (Expression) rewrite.createCopyTarget(switchCase.getExpression());
Expression rightExpression= null; Expression expression= switchCase.getExpression(); if (expression instanceof SimpleName && ((SimpleName) expression).resolveBinding() instanceof IVariableBinding) { IVariableBinding binding= (IVariableBinding) ((SimpleName) expression).resolveBinding(); if (binding.isEnumConstant()) { String qualifiedName= importRewrite.addImport(binding.getDeclaringClass()) + '.' + binding.getName(); rightExpression= ast.newName(qualifiedName); } } if (rightExpression == null) { rightExpression= (Expression) rewrite.createCopyTarget(expression); }
	private static InfixExpression createSwitchCaseCondition(AST ast,			ASTRewrite rewrite,			SwitchStatement switchStatement,			SwitchCase switchCase) {		InfixExpression condition= ast.newInfixExpression();		condition.setOperator(InfixExpression.Operator.EQUALS);		//		Expression leftExpression= (Expression) rewrite.createCopyTarget(switchStatement.getExpression());		condition.setLeftOperand(leftExpression);		//		Expression rightExpression= (Expression) rewrite.createCopyTarget(switchCase.getExpression());		condition.setRightOperand(rightExpression);		//		return condition;	}