### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: compiler/org/eclipse/jdt/internal/compiler/ast/Assignment.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Assignment.java,v retrieving revision 1.94 diff -u -r1.94 Assignment.java --- compiler/org/eclipse/jdt/internal/compiler/ast/Assignment.java 16 Jan 2011 22:43:21 -0000 1.94 +++ compiler/org/eclipse/jdt/internal/compiler/ast/Assignment.java 22 Jan 2011 19:39:16 -0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2010 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 @@ -8,8 +8,10 @@ * Contributors: * IBM Corporation - initial API and implementation * Genady Beriozkin - added support for reporting assignment with no effect - * Stephan Herrmann - Contribution for bug 319201 - [null] no warning when unboxing SingleNameReference causes NPE - * and bug 292478 - Report potentially null across variable assignment + * Stephan Herrmann - Contributions for + * bug 319201 - [null] no warning when unboxing SingleNameReference causes NPE + * bug 292478 - Report potentially null across variable assignment + * bug 335093 - [compiler][null] minimal hook for future null annotation support *******************************************************************************/ package org.eclipse.jdt.internal.compiler.ast; @@ -52,6 +54,7 @@ flowInfo = ((Reference) this.lhs) .analyseAssignment(currentScope, flowContext, flowInfo, this, false) .unconditionalInits(); + nullStatus = checkAgainstNullAnnotation(currentScope, local, nullStatus); if (local != null && (local.type.tagBits & TagBits.IsBaseType) == 0) { flowInfo.markNullStatus(local, nullStatus); if (flowContext.initsOnFinally != null) Index: compiler/org/eclipse/jdt/internal/compiler/ast/LocalDeclaration.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LocalDeclaration.java,v retrieving revision 1.77 diff -u -r1.77 LocalDeclaration.java --- compiler/org/eclipse/jdt/internal/compiler/ast/LocalDeclaration.java 16 Jan 2011 22:43:21 -0000 1.77 +++ compiler/org/eclipse/jdt/internal/compiler/ast/LocalDeclaration.java 22 Jan 2011 19:39:16 -0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2010 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 @@ -7,8 +7,10 @@ * * Contributors: * IBM Corporation - initial API and implementation - * Stephan Herrmann - Contribution for bug 319201 - [null] no warning when unboxing SingleNameReference causes NPE - * and bug 292478 - Report potentially null across variable assignment + * Stephan Herrmann - Contributions for + * bug 319201 - [null] no warning when unboxing SingleNameReference causes NPE + * bug 292478 - Report potentially null across variable assignment + * bug 335093 - [compiler][null] minimal hook for future null annotation support *******************************************************************************/ package org.eclipse.jdt.internal.compiler.ast; @@ -80,6 +82,7 @@ this.bits &= ~FirstAssignmentToLocal; // int i = (i = 0); } flowInfo.markAsDefinitelyAssigned(this.binding); + nullStatus = checkAgainstNullAnnotation(currentScope, this.binding, nullStatus); if ((this.binding.type.tagBits & TagBits.IsBaseType) == 0) { flowInfo.markNullStatus(this.binding, nullStatus); // no need to inform enclosing try block since its locals won't get Index: compiler/org/eclipse/jdt/internal/compiler/ast/Statement.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Statement.java,v retrieving revision 1.50 diff -u -r1.50 Statement.java --- compiler/org/eclipse/jdt/internal/compiler/ast/Statement.java 14 Jan 2011 17:02:24 -0000 1.50 +++ compiler/org/eclipse/jdt/internal/compiler/ast/Statement.java 22 Jan 2011 19:39:16 -0000 @@ -7,6 +7,7 @@ * * Contributors: * IBM Corporation - initial API and implementation + * Stephan Herrmann - Contribution for bug 335093 - [compiler][null] minimal hook for future null annotation support *******************************************************************************/ package org.eclipse.jdt.internal.compiler.ast; @@ -54,6 +55,11 @@ public static final int COMPLAINED_FAKE_REACHABLE = 1; public static final int COMPLAINED_UNREACHABLE = 2; +/** Empty hook for checking null status against declaration using null annotations, once this will be supported. */ +protected int checkAgainstNullAnnotation(BlockScope currentScope, LocalVariableBinding local, int nullStatus) { + return nullStatus; +} + /** * INTERNAL USE ONLY. * This is used to redirect inter-statements jumps. #P org.eclipse.jdt.core.tests.compiler Index: src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java,v retrieving revision 1.126 diff -u -r1.126 AbstractRegressionTest.java --- src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java 22 Jul 2010 18:49:01 -0000 1.126 +++ src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java 22 Jan 2011 19:39:26 -0000 @@ -2614,7 +2614,7 @@ // JavacTestOptions.SKIP /* skip javac tests */); // JavacTestOptions.DEFAULT /* default javac test options */); // javacTestOptions /* javac test options */); -void runNegativeTest( +protected void runNegativeTest( // test directory preparation boolean shouldFlushOutputDirectory, String[] testFiles,