diff --git a/platform/platform-impl/src/com/intellij/openapi/vfs/impl/FilePointerPartNode.java b/platform/platform-impl/src/com/intellij/openapi/vfs/impl/FilePointerPartNode.java index e3821821b8a7..d72696664117 100644 --- a/platform/platform-impl/src/com/intellij/openapi/vfs/impl/FilePointerPartNode.java +++ b/platform/platform-impl/src/com/intellij/openapi/vfs/impl/FilePointerPartNode.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * Copyright 2000-2014 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -57,7 +57,7 @@ class FilePointerPartNode { } boolean getPointersUnder(@NotNull String path, int start, @NotNull List out) { - checkStructure(); + checkConsistency(); if (pointersUnder == 0) return false; // invariant: upper nodes are matched int index = indexOfFirstDifferentChar(path, start); @@ -76,12 +76,12 @@ class FilePointerPartNode { return false; } - void checkStructure() { + void checkConsistency() { if (!DEBUG) return; int childSum = 0; for (FilePointerPartNode child : children) { childSum += child.pointersUnder; - child.checkStructure(); + child.checkConsistency(); assert child.parent == this; } if (leaf != null) childSum++; diff --git a/platform/platform-impl/src/com/intellij/openapi/vfs/impl/VirtualFilePointerManagerImpl.java b/platform/platform-impl/src/com/intellij/openapi/vfs/impl/VirtualFilePointerManagerImpl.java index ed10fba51e59..e94354d16d0b 100644 --- a/platform/platform-impl/src/com/intellij/openapi/vfs/impl/VirtualFilePointerManagerImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/vfs/impl/VirtualFilePointerManagerImpl.java @@ -37,7 +37,6 @@ import com.intellij.util.containers.ContainerUtil; import com.intellij.util.io.URLUtil; import com.intellij.util.messages.MessageBus; import gnu.trove.THashMap; -import gnu.trove.TObjectHashingStrategy; import gnu.trove.TObjectIntHashMap; import gnu.trove.TObjectIntProcedure; import org.jetbrains.annotations.NonNls; @@ -196,7 +195,7 @@ public class VirtualFilePointerManagerImpl extends VirtualFilePointerManager imp String path; if (file == null) { - path = protocolEnd == -1 ? url : url.substring(protocolEnd + URLUtil.SCHEME_SEPARATOR.length()); + path = url.substring(protocolEnd + URLUtil.SCHEME_SEPARATOR.length()); String cleanPath = cleanupPath(path, isJar); // if newly created path is the same as substringed one then the url did not change, we can reuse it //noinspection StringEquality @@ -263,7 +262,7 @@ public class VirtualFilePointerManagerImpl extends VirtualFilePointerManager imp } pointer.myNode.incrementUsageCount(1); - root.checkStructure(); + root.checkConsistency(); return pointer; } @@ -327,7 +326,7 @@ public class VirtualFilePointerManagerImpl extends VirtualFilePointerManager imp } } - private void addAllPointers(Collection pointers) { + private void addAllPointers(@NotNull Collection pointers) { List out = new ArrayList(); for (FilePointerPartNode root : myPointers.values()) { root.getPointersUnder("", 0, out); @@ -381,9 +380,9 @@ public class VirtualFilePointerManagerImpl extends VirtualFilePointerManager imp return virtualFilePointerContainer; } - @Nullable private List myEvents = Collections.emptyList(); - @Nullable private List myPointersToUpdateUrl = Collections.emptyList(); - @Nullable private List myPointersToFire = Collections.emptyList(); + private List myEvents = Collections.emptyList(); + private List myPointersToUpdateUrl = Collections.emptyList(); + private List myPointersToFire = Collections.emptyList(); @Override public void before(@NotNull final List events) { @@ -518,7 +517,7 @@ public class VirtualFilePointerManagerImpl extends VirtualFilePointerManager imp myEvents = Collections.emptyList(); myPointersToFire = Collections.emptyList(); for (FilePointerPartNode root : myPointers.values()) { - root.checkStructure(); + root.checkConsistency(); } } @@ -528,12 +527,12 @@ public class VirtualFilePointerManagerImpl extends VirtualFilePointerManager imp myPointers.remove(listener); } else { - myPointers.get(listener).checkStructure(); + myPointers.get(listener).checkConsistency(); } } private static class DelegatingDisposable implements Disposable { - private static final ConcurrentMap ourInstances = new ConcurrentHashMap(TObjectHashingStrategy.IDENTITY); + private static final ConcurrentMap ourInstances = new ConcurrentHashMap(ContainerUtil.identityStrategy()); private final TObjectIntHashMap myCounts = new TObjectIntHashMap(); private final Disposable myParent;