From 99290d81043483ae644bb00e9cbcfd6a6d70e647 Mon Sep 17 00:00:00 2001 From: "Maxim.Mossienko" Date: Mon, 2 Jul 2012 23:30:43 +0400 Subject: [PATCH] avoid EOF exception on empty attribute value, consider file not indexed (EA-37015 - EOFE: DataInputOutputUtil.readTIME) --- .../intellij/util/indexing/IndexingStamp.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/util/indexing/IndexingStamp.java b/platform/lang-impl/src/com/intellij/util/indexing/IndexingStamp.java index b9167e8129ec..7cc78437591f 100644 --- a/platform/lang-impl/src/com/intellij/util/indexing/IndexingStamp.java +++ b/platform/lang-impl/src/com/intellij/util/indexing/IndexingStamp.java @@ -50,13 +50,15 @@ public class IndexingStamp { private Timestamps(@Nullable DataInputStream stream) throws IOException { if (stream != null) { try { - long dominatingIndexStamp = DataInputOutputUtil.readTIME(stream); - while(stream.available() > 0) { - ID id = ID.findById(DataInputOutputUtil.readINT(stream)); - if (id != null) { - long stamp = IndexInfrastructure.getIndexCreationStamp(id); - if (myIndexStamps == null) myIndexStamps = new TObjectLongHashMap>(5, 0.98f); - if (stamp <= dominatingIndexStamp) myIndexStamps.put(id, stamp); + if (stream.available() > 0) { + long dominatingIndexStamp = DataInputOutputUtil.readTIME(stream); + while(stream.available() > 0) { + ID id = ID.findById(DataInputOutputUtil.readINT(stream)); + if (id != null) { + long stamp = IndexInfrastructure.getIndexCreationStamp(id); + if (myIndexStamps == null) myIndexStamps = new TObjectLongHashMap>(5, 0.98f); + if (stamp <= dominatingIndexStamp) myIndexStamps.put(id, stamp); + } } } }