### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: compiler/org/eclipse/jdt/internal/compiler/ast/CompoundAssignment.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CompoundAssignment.java,v retrieving revision 1.60 diff -u -r1.60 CompoundAssignment.java --- compiler/org/eclipse/jdt/internal/compiler/ast/CompoundAssignment.java 22 Jul 2009 17:08:54 -0000 1.60 +++ compiler/org/eclipse/jdt/internal/compiler/ast/CompoundAssignment.java 9 Mar 2011 07:57:58 -0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2009 IBM Corporation and others. + * Copyright (c) 2000, 2011 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -42,7 +42,17 @@ if (this.resolvedType.id != T_JavaLangString) { this.lhs.checkNPE(currentScope, flowContext, flowInfo); } - return ((Reference) this.lhs).analyseAssignment(currentScope, flowContext, flowInfo, this, true).unconditionalInits(); + flowInfo = ((Reference) this.lhs).analyseAssignment(currentScope, flowContext, flowInfo, this, true).unconditionalInits(); + if (this.resolvedType.id == T_JavaLangString) { + LocalVariableBinding local = this.lhs.localVariableBinding(); + if (local != null && this.resolvedType.id == T_JavaLangString) { + // compound assignment results in a definitely non null value for String + flowInfo.markAsDefinitelyNonNull(local); + if (flowContext.initsOnFinally != null) + flowContext.initsOnFinally.markAsDefinitelyNonNull(local); + } + } + return flowInfo; } public boolean checkCastCompatibility() {