Lines 622-627
Link Here
|
622 |
this.indexLocations = new SimpleLookupTable(); |
622 |
this.indexLocations = new SimpleLookupTable(); |
623 |
this.javaPluginLocation = null; |
623 |
this.javaPluginLocation = null; |
624 |
} |
624 |
} |
|
|
625 |
/** |
626 |
* Resets the index for a given path. |
627 |
* Returns true if the index was reset, false otherwise. |
628 |
*/ |
629 |
public synchronized boolean resetIndex(IPath containerPath) { |
630 |
// only called to over write an existing cached index... |
631 |
String containerPathString = containerPath.getDevice() == null ? containerPath.toString() : containerPath.toOSString(); |
632 |
try { |
633 |
if (VERBOSE) { |
634 |
Util.verbose("-> reseting index: "+indexLocation+" for path: "+containerPathString); //$NON-NLS-1$ //$NON-NLS-2$ |
635 |
} |
636 |
// Path is already canonical |
637 |
IPath indexLocation = computeIndexLocation(containerPath); |
638 |
Index index = getIndex(indexLocation); |
639 |
if (index == null) { |
640 |
// the index does not exist, try to recreate it |
641 |
return recreateIndex(containerPath) != null; |
642 |
} |
643 |
index.reset(true/*reuse index file*/); |
644 |
return true; |
645 |
} catch (IOException e) { |
646 |
// The file could not be created. Possible reason: the project has been deleted. |
647 |
if (VERBOSE) { |
648 |
Util.verbose("-> failed to reset index for path: "+containerPathString); //$NON-NLS-1$ |
649 |
e.printStackTrace(); |
650 |
} |
651 |
return false; |
652 |
} |
653 |
} |
625 |
public void saveIndex(Index index) throws IOException { |
654 |
public void saveIndex(Index index) throws IOException { |
626 |
// must have permission to write from the write monitor |
655 |
// must have permission to write from the write monitor |
627 |
if (index.hasChanged()) { |
656 |
if (index.hasChanged()) { |