IDEA-88779 java.lang.IndexOutOfBoundsException: queue is empty

This commit is contained in:
Eugene Zhuravlev
2012-07-13 13:49:04 +02:00
parent b1ed6b4646
commit 677303b39a
2 changed files with 4 additions and 2 deletions
@@ -1,5 +1,6 @@
package org.jetbrains.ether;
import com.intellij.openapi.util.io.FileUtil;
import org.jetbrains.ether.dependencyView.Mappings;
import java.io.File;
@@ -118,8 +119,9 @@ public class StorageDumper {
}
else {
try {
final String outputPath = (oath == null ? "" : oath) + File.separator + "snapshot-" + new SimpleDateFormat("dd-MM-yy(hh:mm:ss)").format(new Date()) + ".log";
final File outputPath = new File(oath == null ? "" : oath, "snapshot-" + new SimpleDateFormat("dd-MM-yy(hh-mm-ss)").format(new Date()) + ".log");
final File dataStorageRoot = new File(path + File.separator + "mappings");
FileUtil.createIfDoesntExist(outputPath);
final Mappings mappings = new Mappings(dataStorageRoot, true);
final PrintStream p = new PrintStream(outputPath);
@@ -364,7 +364,7 @@ public class DumbServiceImpl extends DumbService {
public void run() {
IndexUpdateRunnable nextUpdateRunnable = null;
try {
nextUpdateRunnable = myUpdatesQueue.pullFirst();
nextUpdateRunnable = myUpdatesQueue.isEmpty()? null : myUpdatesQueue.pullFirst();
if (nextUpdateRunnable == null) {
// really terminate the task
myActionQueue.offer(NULL_ACTION);