1 /*******************************************************************************
2 * Copyright (c) 2000, 2008 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
11 package org.eclipse.jdt.internal.corext.refactoring.code.flow;
13 import org.eclipse.jdt.core.dom.IVariableBinding;
15 class LocalFlowInfo extends FlowInfo {
17 private int fVariableId;
19 public LocalFlowInfo(IVariableBinding binding, int localAccessMode, FlowContext context) {
21 fVariableId= binding.getVariableId();
22 if (context.considerAccessMode()) {
23 createAccessModeArray(context);
24 fAccessModes[fVariableId - context.getStartingIndex()]= localAccessMode;
25 context.manageLocal(binding);
29 public LocalFlowInfo(LocalFlowInfo info, int localAccessMode, FlowContext context) {
31 fVariableId= info.fVariableId;
32 if (context.considerAccessMode()) {
33 createAccessModeArray(context);
34 fAccessModes[fVariableId - context.getStartingIndex()]= localAccessMode;
38 public void setWriteAccess(FlowContext context) {
39 if (context.considerAccessMode()) {
40 fAccessModes[fVariableId - context.getStartingIndex()]= FlowInfo.WRITE;