1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Check for directories during import/export of team-shared index database, related to bug 243682.

This commit is contained in:
Markus Schorn 2008-12-09 11:51:30 +00:00
parent a7e14e4271
commit 4ad132f821
2 changed files with 8 additions and 3 deletions

View file

@ -115,7 +115,7 @@ public class Checksums {
IPath location= file.getLocation(); IPath location= file.getLocation();
if (location != null) { if (location != null) {
File f= location.toFile(); File f= location.toFile();
if (f.exists()) { if (f.isFile()) {
try { try {
byte[] checksum= computeChecksum(md, f); byte[] checksum= computeChecksum(md, f);
putChecksum(result, file, checksum); putChecksum(result, file, checksum);

View file

@ -303,9 +303,14 @@ public class TeamPDOMImportOperation implements IWorkspaceRunnable {
IPath location= tu.getLocation(); IPath location= tu.getLocation();
if (location != null) { if (location != null) {
try { try {
byte[] checksum= Checksums.computeChecksum(md, location.toFile()); final File file = location.toFile();
if (!Arrays.equals(checksum, cs.fChecksum)) { if (!file.isFile()) {
i.remove(); i.remove();
} else {
byte[] checksum= Checksums.computeChecksum(md, file);
if (!Arrays.equals(checksum, cs.fChecksum)) {
i.remove();
}
} }
} }
catch (IOException e) { catch (IOException e) {