### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: search/org/eclipse/jdt/internal/core/search/indexing/IndexManager.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/IndexManager.java,v retrieving revision 1.165 diff -u -r1.165 IndexManager.java --- search/org/eclipse/jdt/internal/core/search/indexing/IndexManager.java 22 Oct 2009 12:29:08 -0000 1.165 +++ search/org/eclipse/jdt/internal/core/search/indexing/IndexManager.java 12 May 2010 08:57:02 -0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2009 IBM Corporation and others. + * Copyright (c) 2000, 2010 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 @@ -47,7 +47,6 @@ /* need to save ? */ private boolean needToSave = false; - private static final CRC32 checksumCalculator = new CRC32(); private IPath javaPluginLocation = null; /* can only replace a current state if its less than the new one */ @@ -134,14 +133,16 @@ IPath indexLocation = (IPath) this.indexLocations.get(containerPath); if (indexLocation == null) { String pathString = containerPath.toOSString(); - checksumCalculator.reset(); + CRC32 checksumCalculator = new CRC32(); checksumCalculator.update(pathString.getBytes()); String fileName = Long.toString(checksumCalculator.getValue()) + ".index"; //$NON-NLS-1$ if (VERBOSE) Util.verbose("-> index name for " + pathString + " is " + fileName); //$NON-NLS-1$ //$NON-NLS-2$ // to share the indexLocation between the indexLocations and indexStates tables, get the key from the indexStates table indexLocation = (IPath) getIndexStates().getKey(getJavaPluginWorkingLocation().append(fileName)); - this.indexLocations.put(containerPath, indexLocation); + synchronized (this.indexLocations) { + this.indexLocations.put(containerPath, indexLocation); + } } return indexLocation; }