This commit is contained in:
Alexey Kudravtsev
2015-07-06 14:14:52 +03:00
parent 070001afc1
commit ba275cc6c5
4 changed files with 28 additions and 11 deletions
@@ -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()]);
@@ -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<Object> myObjectArray = new AtomicReferenceArray<Object>(SEGMENT_SIZE);
private final AtomicReferenceArray<Object> myObjectArray = new AtomicReferenceArray<Object>(SEGMENT_SIZE);
// <nameId, flags> pairs, "flags" part containing flags per se and modification stamp
private final AtomicIntegerArray myIntArray = new AtomicIntegerArray(SEGMENT_SIZE * 2);
@@ -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<E> extends AbstractList<E> 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() { }
@@ -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<V> {
@NotNull
Collection<V> 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<V> {