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

Collapse All | Expand All

(-)search/org/eclipse/jdt/internal/core/search/indexing/IndexManager.java (-4 / +5 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2009 IBM Corporation and others.
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 47-53 Link Here
47
47
48
	/* need to save ? */
48
	/* need to save ? */
49
	private boolean needToSave = false;
49
	private boolean needToSave = false;
50
	private static final CRC32 checksumCalculator = new CRC32();
51
	private IPath javaPluginLocation = null;
50
	private IPath javaPluginLocation = null;
52
51
53
	/* can only replace a current state if its less than the new one */
52
	/* can only replace a current state if its less than the new one */
Lines 134-147 Link Here
134
	IPath indexLocation = (IPath) this.indexLocations.get(containerPath);
133
	IPath indexLocation = (IPath) this.indexLocations.get(containerPath);
135
	if (indexLocation == null) {
134
	if (indexLocation == null) {
136
		String pathString = containerPath.toOSString();
135
		String pathString = containerPath.toOSString();
137
		checksumCalculator.reset();
136
		CRC32 checksumCalculator = new CRC32();
138
		checksumCalculator.update(pathString.getBytes());
137
		checksumCalculator.update(pathString.getBytes());
139
		String fileName = Long.toString(checksumCalculator.getValue()) + ".index"; //$NON-NLS-1$
138
		String fileName = Long.toString(checksumCalculator.getValue()) + ".index"; //$NON-NLS-1$
140
		if (VERBOSE)
139
		if (VERBOSE)
141
			Util.verbose("-> index name for " + pathString + " is " + fileName); //$NON-NLS-1$ //$NON-NLS-2$
140
			Util.verbose("-> index name for " + pathString + " is " + fileName); //$NON-NLS-1$ //$NON-NLS-2$
142
		// to share the indexLocation between the indexLocations and indexStates tables, get the key from the indexStates table
141
		// to share the indexLocation between the indexLocations and indexStates tables, get the key from the indexStates table
143
		indexLocation = (IPath) getIndexStates().getKey(getJavaPluginWorkingLocation().append(fileName));
142
		indexLocation = (IPath) getIndexStates().getKey(getJavaPluginWorkingLocation().append(fileName));
144
		this.indexLocations.put(containerPath, indexLocation);
143
		synchronized (this.indexLocations) {
144
			this.indexLocations.put(containerPath, indexLocation);
145
		}
145
	}
146
	}
146
	return indexLocation;
147
	return indexLocation;
147
}
148
}

Return to bug 312326