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

Collapse All | Expand All

(-)a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LocalDeclaration.java (-3 / +2 lines)
Lines 135-143 Link Here
135
			this.initialization.generateCode(currentScope, codeStream, true);
135
			this.initialization.generateCode(currentScope, codeStream, true);
136
			// 26903, need extra cast to store null in array local var
136
			// 26903, need extra cast to store null in array local var
137
			if (this.binding.type.isArrayType()
137
			if (this.binding.type.isArrayType()
138
				&& (this.initialization.resolvedType == TypeBinding.NULL	// arrayLoc = null
138
				&& ((this.initialization instanceof CastExpression)	// arrayLoc = (type[])null
139
					|| ((this.initialization instanceof CastExpression)	// arrayLoc = (type[])null
139
						&& (((CastExpression)this.initialization).innermostCastedExpression().resolvedType == TypeBinding.NULL))){
140
						&& (((CastExpression)this.initialization).innermostCastedExpression().resolvedType == TypeBinding.NULL)))){
141
				codeStream.checkcast(this.binding.type);
140
				codeStream.checkcast(this.binding.type);
142
			}
141
			}
143
			codeStream.store(this.binding, false);
142
			codeStream.store(this.binding, false);
(-)a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SingleNameReference.java (-3 / +2 lines)
Lines 352-360 Link Here
352
			}
352
			}
353
			// 26903, need extra cast to store null in array local var
353
			// 26903, need extra cast to store null in array local var
354
			if (localBinding.type.isArrayType()
354
			if (localBinding.type.isArrayType()
355
				&& (assignment.expression.resolvedType == TypeBinding.NULL	// arrayLoc = null
355
				&& ((assignment.expression instanceof CastExpression)	// arrayLoc = (type[])null
356
					|| ((assignment.expression instanceof CastExpression)	// arrayLoc = (type[])null
356
						&& (((CastExpression)assignment.expression).innermostCastedExpression().resolvedType == TypeBinding.NULL))){
357
						&& (((CastExpression)assignment.expression).innermostCastedExpression().resolvedType == TypeBinding.NULL)))){
358
				codeStream.checkcast(localBinding.type);
357
				codeStream.checkcast(localBinding.type);
359
			}
358
			}
360
359

Return to bug 359284