diff --git a/platform/indexing-impl/src/com/intellij/psi/stubs/StubProcessingHelperBase.java b/platform/indexing-impl/src/com/intellij/psi/stubs/StubProcessingHelperBase.java index 5bf1bdae2ff2..f0954e0d14a7 100644 --- a/platform/indexing-impl/src/com/intellij/psi/stubs/StubProcessingHelperBase.java +++ b/platform/indexing-impl/src/com/intellij/psi/stubs/StubProcessingHelperBase.java @@ -1,3 +1,18 @@ +/* + * Copyright 2000-2015 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.intellij.psi.stubs; import com.intellij.lang.ASTNode; @@ -74,10 +89,8 @@ public abstract class StubProcessingHelperBase { if (stubbedRoot.second == stubBindingRoot) continue; if (stubbedRoot.second instanceof PsiFileImpl) { final StubTree secondaryStubTree = ((PsiFileImpl)stubbedRoot.second).calcStubTree(); - if (secondaryStubTree != null) { - final PsiFileStub root = secondaryStubTree.getRoot(); - roots.add(root); - } + final PsiFileStub root = secondaryStubTree.getRoot(); + roots.add(root); } } final PsiFileStub[] rootsArray = roots.toArray(new PsiFileStub[roots.size()]); diff --git a/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/impl/VfsData.java b/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/impl/VfsData.java index 5c13920a2772..3290e982a060 100644 --- a/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/impl/VfsData.java +++ b/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/impl/VfsData.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2015 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. @@ -182,7 +182,7 @@ public class VfsData { public static class Segment { // user data for files, DirectoryData for folders - final AtomicReferenceArray myObjectArray = new AtomicReferenceArray(SEGMENT_SIZE); + private final AtomicReferenceArray myObjectArray = new AtomicReferenceArray(SEGMENT_SIZE); // pairs, "flags" part containing flags per se and modification stamp private final AtomicIntegerArray myIntArray = new AtomicIntegerArray(SEGMENT_SIZE * 2); diff --git a/platform/util/src/com/intellij/util/SmartList.java b/platform/util/src/com/intellij/util/SmartList.java index 21bcd4978d5c..21b48741aeb1 100644 --- a/platform/util/src/com/intellij/util/SmartList.java +++ b/platform/util/src/com/intellij/util/SmartList.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2015 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. @@ -26,10 +26,10 @@ import java.util.*; * A List which is optimised for the sizes of 0 and 1, * in which cases it would not allocate array at all. */ -@SuppressWarnings({"unchecked"}) +@SuppressWarnings("unchecked") public class SmartList extends AbstractList implements RandomAccess { - private int mySize = 0; - private Object myElem = null; // null if mySize==0, (E)elem if mySize==1, Object[] if mySize>=2 + private int mySize; + private Object myElem; // null if mySize==0, (E)elem if mySize==1, Object[] if mySize>=2 public SmartList() { } diff --git a/platform/util/src/com/intellij/util/containers/ConcurrentIntObjectMap.java b/platform/util/src/com/intellij/util/containers/ConcurrentIntObjectMap.java index 56d90468a408..f4bf8e7b5b8c 100644 --- a/platform/util/src/com/intellij/util/containers/ConcurrentIntObjectMap.java +++ b/platform/util/src/com/intellij/util/containers/ConcurrentIntObjectMap.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2015 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. @@ -63,6 +63,10 @@ public interface ConcurrentIntObjectMap { @NotNull Collection values(); boolean containsValue(@NotNull V value); + /** + * @return the previous value associated with the specified key, + * or {@code null} if there was no mapping for the key + */ V putIfAbsent(int key, @NotNull V value); interface IntEntry {