View | Details | Raw Unified | Return to bug 304416 | Differences between
and this patch

Collapse All | Expand All

(-)compiler/org/eclipse/jdt/internal/compiler/lookup/BlockScope.java (-3 / +3 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2008 IBM Corporation and others.
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 191-204 Link Here
191
			LocalVariableBinding local = this.locals[ilocal]; // if no local at all, will be locals[ilocal]==null
191
			LocalVariableBinding local = this.locals[ilocal]; // if no local at all, will be locals[ilocal]==null
192
192
193
			// check if variable is actually used, and may force it to be preserved
193
			// check if variable is actually used, and may force it to be preserved
194
			boolean generateCurrentLocalVar = (local.useFlag == LocalVariableBinding.USED && local.constant() == Constant.NotAConstant);
194
			boolean generateCurrentLocalVar = (local.useFlag != LocalVariableBinding.UNUSED && local.constant() == Constant.NotAConstant);
195
195
196
			// do not report fake used variable
196
			// do not report fake used variable
197
			if (local.useFlag == LocalVariableBinding.UNUSED
197
			if (local.useFlag == LocalVariableBinding.UNUSED
198
				&& (local.declaration != null) // unused (and non secret) local
198
				&& (local.declaration != null) // unused (and non secret) local
199
				&& ((local.declaration.bits & ASTNode.IsLocalDeclarationReachable) != 0)) { // declaration is reachable
199
				&& ((local.declaration.bits & ASTNode.IsLocalDeclarationReachable) != 0)) { // declaration is reachable
200
200
201
				if (!(local.declaration instanceof Argument))  // do not report unused catch arguments
201
				if (!(local.declaration instanceof Argument)) // do not report unused catch arguments
202
					problemReporter().unusedLocalVariable(local.declaration);
202
					problemReporter().unusedLocalVariable(local.declaration);
203
			}
203
			}
204
204

Return to bug 304416