This commit is contained in:
Vladimir Krivosheev
2014-09-01 10:03:42 +02:00
parent 54c5fe5e64
commit 2e79811f04
2 changed files with 4 additions and 3 deletions
@@ -301,7 +301,6 @@ public class DirectoryBasedStorage implements StateStorage, Disposable {
filesToSave.add(file);
}
}
}
});
@@ -57,11 +57,12 @@ import java.util.Set;
* @author mike
*/
public class StorageUtil {
private static final Logger LOG = Logger.getInstance("#com.intellij.openapi.components.impl.stores.StorageUtil");
private static final Logger LOG = Logger.getInstance(StorageUtil.class);
private static final boolean DUMP_COMPONENT_STATES = SystemProperties.getBooleanProperty("idea.log.externally.changed.component.states", false);
@SuppressWarnings("SpellCheckingInspection")
private static final SimpleDateFormat LOG_DIR_FORMAT = new SimpleDateFormat("yyyyMMdd-HHmmss");
private static final Pair<byte[], String> NON_EXISTENT_FILE_DATA = Pair.create(null, SystemProperties.getLineSeparator());
private StorageUtil() { }
@@ -182,9 +183,10 @@ public class StorageUtil {
/**
* @return pair.first - file contents (null if file does not exist), pair.second - file line separators
*/
@NotNull
private static Pair<byte[], String> loadFile(@Nullable final VirtualFile file) throws IOException {
if (file == null || !file.exists()) {
return Pair.create(null, SystemProperties.getLineSeparator());
return NON_EXISTENT_FILE_DATA;
}
byte[] bytes = file.contentsToByteArray();