Buggy code:
public class SetVariablesOperation extends ChangeClasspathOperation { String [ ] variableNames ; IPath [ ] variablePaths ; boolean updatePreferences ; public SetVariablesOperation ( String [ ] variableNames , IPath [ ] variablePaths , boolean updatePreferences ) { } protected void executeOperation ( ) throws JavaModelException { checkCanceled ( ) ; try { beginTask ( "" , 1 ) ; if ( JavaModelManager . CP_RESOLVE_VERBOSE ) verbose_set_variables ( ) ; JavaModelManager manager = JavaModelManager . getJavaModelManager ( ) ; if ( manager . variablePutIfInitializingWithSameValue ( this . variableNames , this . variablePaths ) ) return ; int varLength = this . variableNames . length ; final HashMap affectedProjectClasspaths = new HashMap ( 5 ) ; IJavaModel model = getJavaModel ( ) ; int discardCount = 0 ; for ( int i = 0 ; i < varLength ; i ++ ) { String variableName = this . variableNames [ i ] ; IPath oldPath = manager . variableGet ( variableName ) ; if ( oldPath == ( JavaModelManager . VARIABLE_INITIALIZATION_IN_PROGRESS ) ) { oldPath = null ; } if ( ( oldPath != null ) && ( oldPath . equals ( this . variablePaths [ i ] ) ) ) { this . variableNames [ i ] = null ; discardCount ++ ; } } if ( discardCount > 0 ) { if ( discardCount == varLength ) return ; int changedLength = varLength - discardCount ; String [ ] changedVariableNames = new String [ changedLength ] ; IPath [ ] changedVariablePaths = new IPath [ changedLength ] ; for ( int i = 0 , index = 0 ; i < varLength ; i ++ ) { if ( ( this . variableNames [ i ] ) != null ) { changedVariableNames [ index ] = this . variableNames [ i ] ; changedVariablePaths [ index ] = this . variablePaths [ i ] ; index ++ ; } } this . variableNames = changedVariableNames ; this . variablePaths = changedVariablePaths ; varLength = changedLength ; } if ( isCanceled ( ) ) return ; IJavaProject [ ] projects = model . getJavaProjects ( ) ; nextProject : for ( int i = 0 , projectLength = projects . length ; i < projectLength ; i ++ ) { JavaProject project = ( ( JavaProject ) ( projects [ i ] ) ) ; IClasspathEntry [ ] classpath = project . getRawClasspath ( ) ; for ( int j = 0 , cpLength = classpath . length ; j < cpLength ; j ++ ) { IClasspathEntry entry = classpath [ j ] ; for ( int k = 0 ; k < varLength ; k ++ ) { String variableName = this . variableNames [ k ] ; if ( ( entry . getEntryKind ( ) ) == ( IClasspathEntry . CPE_VARIABLE ) ) { if ( variableName . equals ( entry . getPath ( ) . segment ( 0 ) ) ) { affectedProjectClasspaths . put ( project , project . getResolvedClasspath ( ) ) ; continue nextProject ; } IPath sourcePath ; IPath sourceRootPath ; if ( ( ( ( sourcePath = entry . getSourceAttachmentPath ( ) ) != null ) && ( variableName . equals ( sourcePath . segment ( 0 ) ) ) ) || ( ( ( sourceRootPath = entry . getSourceAttachmentRootPath ( ) ) != null ) && ( variableName . equals ( sourceRootPath . segment ( 0 ) ) ) ) ) { affectedProjectClasspaths . put ( project , project . getResolvedClasspath ( ) ) ; continue nextProject ; } } } } } for ( int i = 0 ; i < varLength ; i ++ ) { manager . variablePut ( this . variableNames [ i ] , this . variablePaths [ i ] ) ; if ( this . updatePreferences ) manager . variablePreferencesPut ( this . variableNames [ i ] , this . variablePaths [ i ] ) ; } if ( ! ( affectedProjectClasspaths . isEmpty ( ) ) ) { String [ ] dbgVariableNames = this . variableNames ; try { Iterator projectsToUpdate = affectedProjectClasspaths . keySet ( ) . iterator ( ) ; while ( projectsToUpdate . hasNext ( ) ) { if ( ( ( this . progressMonitor ) != null ) && ( this . progressMonitor . isCanceled ( ) ) ) return ; JavaProject affectedProject = ( ( JavaProject ) ( projectsToUpdate . next ( ) ) ) ; if ( JavaModelManager . CP_RESOLVE_VERBOSE_ADVANCED ) verbose_update_project ( dbgVariableNames , affectedProject ) ; ClasspathChange classpathChange = affectedProject . getPerProjectInfo ( ) . resetResolvedClasspath ( ) ; <START_BUG> classpathChanged ( classpathChange ) ; <END_BUG> if ( this . canChangeResources ) { affectedProject . getProject ( ) . touch ( this . progressMonitor ) ; } } } catch ( CoreException e ) { if ( ( JavaModelManager . CP_RESOLVE_VERBOSE ) || ( JavaModelManager . CP_RESOLVE_VERBOSE_FAILURE ) ) { verbose_failure ( dbgVariableNames ) ; e . printStackTrace ( ) ; } if ( e instanceof JavaModelException ) { throw ( ( JavaModelException ) ( e ) ) ; } else { throw new JavaModelException ( e ) ; } } } } finally { done ( ) ; } } private void verbose_failure ( String [ ] dbgVariableNames ) { } private void verbose_update_project ( String [ ] dbgVariableNames , JavaProject affectedProject ) { } private void verbose_set_variables ( ) { } }

Fix:
classpathChanged ( classpathChange , true ) ;