minor performance: removed redundant initializers in PSI

This commit is contained in:
Alexey Kudravtsev
2016-04-27 13:31:03 +03:00
parent 4a18a8be0d
commit f9130d3606
48 changed files with 135 additions and 155 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2015 JetBrains s.r.o.
* Copyright 2000-2016 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.
@@ -426,9 +426,9 @@ public abstract class BaseExternalAnnotationsManager extends ExternalAnnotations
private final MostlySingularMultiMap<String, AnnotationData> myData = new MostlySingularMultiMap<String, AnnotationData>();
private final PsiFile myFile;
private String myExternalName = null;
private String myAnnotationFqn = null;
private StringBuilder myArguments = null;
private String myExternalName;
private String myAnnotationFqn;
private StringBuilder myArguments;
private DataParsingSaxHandler(PsiFile file) {
myFile = file;
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
* Copyright 2000-2016 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.
@@ -14,13 +14,6 @@
* limitations under the License.
*/
/**
* Created by IntelliJ IDEA.
* User: igork
* Date: Nov 25, 2002
* Time: 1:44:25 PM
* To change this template use Options | File Templates.
*/
package com.intellij.codeInsight.completion.proc;
import com.intellij.openapi.util.Key;
@@ -43,7 +36,7 @@ import java.util.List;
public class VariablesProcessor
extends BaseScopeProcessor implements ElementClassHint{
private final String myPrefix;
private boolean myStaticScopeFlag = false;
private boolean myStaticScopeFlag;
private final boolean myStaticSensitiveFlag;
private final List<PsiVariable> myResultList;
@@ -1,20 +1,35 @@
/*
* Copyright 2000-2016 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.codeInsight.folding.impl;
import com.intellij.codeInsight.folding.CodeFoldingSettings;
import com.intellij.codeInsight.folding.JavaCodeFoldingSettings;
public class JavaCodeFoldingSettingsBase extends JavaCodeFoldingSettings {
@SuppressWarnings({"WeakerAccess"}) public boolean COLLAPSE_ACCESSORS = false;
@SuppressWarnings({"WeakerAccess"}) public boolean COLLAPSE_ACCESSORS;
@SuppressWarnings({"WeakerAccess"}) public boolean COLLAPSE_ONE_LINE_METHODS = true;
@SuppressWarnings({"WeakerAccess"}) public boolean COLLAPSE_INNER_CLASSES = false;
@SuppressWarnings({"WeakerAccess"}) public boolean COLLAPSE_ANONYMOUS_CLASSES = false;
@SuppressWarnings({"WeakerAccess"}) public boolean COLLAPSE_ANNOTATIONS = false;
@SuppressWarnings({"WeakerAccess"}) public boolean COLLAPSE_INNER_CLASSES;
@SuppressWarnings({"WeakerAccess"}) public boolean COLLAPSE_ANONYMOUS_CLASSES;
@SuppressWarnings({"WeakerAccess"}) public boolean COLLAPSE_ANNOTATIONS;
@SuppressWarnings({"WeakerAccess"}) public boolean COLLAPSE_CLOSURES = true;
@SuppressWarnings({"WeakerAccess"}) public boolean COLLAPSE_CONSTRUCTOR_GENERIC_PARAMETERS = true;
@SuppressWarnings({"WeakerAccess"}) public boolean COLLAPSE_I18N_MESSAGES = true;
@SuppressWarnings({"WeakerAccess"}) public boolean COLLAPSE_SUPPRESS_WARNINGS = true;
@SuppressWarnings({"WeakerAccess"}) public boolean COLLAPSE_END_OF_LINE_COMMENTS = false;
@SuppressWarnings({"WeakerAccess"}) public boolean INLINE_PARAMETER_NAMES_FOR_LITERAL_CALL_ARGUMENTS = false;
@SuppressWarnings({"WeakerAccess"}) public boolean COLLAPSE_END_OF_LINE_COMMENTS;
@SuppressWarnings({"WeakerAccess"}) public boolean INLINE_PARAMETER_NAMES_FOR_LITERAL_CALL_ARGUMENTS;
@Override
public boolean isCollapseImports() {
@@ -41,12 +41,12 @@ public class ReferenceParser {
public static final int INCOMPLETE_ANNO = 0x40;
public static class TypeInfo {
public boolean isPrimitive = false;
public boolean isParameterized = false;
public boolean isArray = false;
public boolean isVarArg = false;
public boolean hasErrors = false;
public PsiBuilder.Marker marker = null;
public boolean isPrimitive;
public boolean isParameterized;
public boolean isArray;
public boolean isVarArg;
public boolean hasErrors;
public PsiBuilder.Marker marker;
}
private static final TokenSet WILDCARD_KEYWORD_SET = TokenSet.create(JavaTokenType.EXTENDS_KEYWORD, JavaTokenType.SUPER_KEYWORD);
@@ -398,7 +398,7 @@ public class PsiDiamondTypeImpl extends PsiDiamondType {
}
else {
buf.append("(").append(StringUtil.join(constructor.getParameterList().getParameters(), new Function<PsiParameter, String>() {
int myIdx = 0;
int myIdx;
@Override
public String fun(PsiParameter psiParameter) {
return psiParameter.getType().getCanonicalText() + " p" + myIdx++;
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2016 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.
@@ -14,9 +14,6 @@
* limitations under the License.
*/
/**
* @author Alexey
*/
package com.intellij.psi.controlFlow;
class CompositeInstructionClientVisitor extends InstructionClientVisitor<Object[]> {
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2015 JetBrains s.r.o.
* Copyright 2000-2016 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.
@@ -735,7 +735,7 @@ class ControlFlowAnalyzer extends JavaElementVisitor {
boolean generateElseFlow = true;
boolean generateThenFlow = true;
boolean generateConditionalJump = true;
/**
/*
* if() statement generated instructions outline:
* 'if (C) { A } [ else { B } ]' :
* generate (C)
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2016 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.
@@ -14,9 +14,6 @@
* limitations under the License.
*/
/**
* @author cdr
*/
package com.intellij.psi.controlFlow;
public class ControlFlowInstructionVisitor {
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2016 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.
@@ -14,9 +14,6 @@
* limitations under the License.
*/
/**
* @author cdr
*/
package com.intellij.psi.controlFlow;
import com.intellij.psi.PsiElement;
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
* Copyright 2000-2016 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.
@@ -68,7 +68,7 @@ public class DefUseUtil {
private Set<PsiVariable> myVariablesUseArmed;
private final int myInstructionIdx;
private final IntArrayList myBackwardTraces;
private boolean myIsVisited = false;
private boolean myIsVisited;
public InstructionState(int instructionIdx) {
myInstructionIdx = instructionIdx;
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2016 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.
@@ -14,9 +14,6 @@
* limitations under the License.
*/
/**
* @author cdr
*/
package com.intellij.psi.controlFlow;
import org.jetbrains.annotations.NonNls;
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2016 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.
@@ -24,7 +24,7 @@ public class ReturnInstruction extends GoToInstruction {
private final ControlFlowStack myStack;
private CallInstruction myCallInstruction;
private boolean myRethrowFromFinally = false;
private boolean myRethrowFromFinally;
public ReturnInstruction(int offset, @NotNull ControlFlowStack stack, CallInstruction callInstruction) {
super(offset, Role.END, false);
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2016 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.
@@ -14,9 +14,6 @@
* limitations under the License.
*/
/**
* @author cdr
*/
package com.intellij.psi.controlFlow;
import com.intellij.openapi.diagnostic.Logger;
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2013 JetBrains s.r.o.
* Copyright 2000-2016 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.
@@ -33,7 +33,7 @@ public class ClsReferenceParameterListImpl extends ClsElementImpl implements Psi
private final PsiElement myParent;
private final ClsTypeElementImpl[] myTypeParameters;
private volatile PsiType[] myTypeParametersCachedTypes = null;
private volatile PsiType[] myTypeParametersCachedTypes;
public ClsReferenceParameterListImpl(PsiElement parent, String[] classParameters) {
myParent = parent;
@@ -482,8 +482,8 @@ public class StubBuildingVisitor<T> extends ClassVisitor {
private final StringBuilder myBuilder = new StringBuilder();
private final Function<String, String> myMapping;
private final Consumer<String> myCallback;
private boolean hasPrefix = false;
private boolean hasParams = false;
private boolean hasPrefix;
private boolean hasParams;
public AnnotationTextCollector(@Nullable String desc, Function<String, String> mapping, Consumer<String> callback) {
super(ASM_API);
@@ -559,7 +559,7 @@ public class StubBuildingVisitor<T> extends ClassVisitor {
private static class FieldAnnotationCollectingVisitor extends FieldVisitor {
private final PsiModifierListStub myModList;
private final Function<String, String> myMapping;
private Set<String> myFilter = null;
private Set<String> myFilter;
private FieldAnnotationCollectingVisitor(PsiModifierListStub modList, Function<String, String> mapping) {
super(ASM_API);
@@ -600,8 +600,8 @@ public class StubBuildingVisitor<T> extends ClassVisitor {
private final int myParamCount;
private final PsiParameterStubImpl[] myParamStubs;
private final Function<String, String> myMapping;
private int myUsedParamSize = 0;
private int myUsedParamCount = 0;
private int myUsedParamSize;
private int myUsedParamCount;
private List<Set<String>> myFilters;
private MethodAnnotationCollectingVisitor(PsiMethodStub owner,
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2015 JetBrains s.r.o.
* Copyright 2000-2016 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.
@@ -28,9 +28,9 @@ public class IndexTree {
public static final int COMPILED = 1 << 7;
public static final int MEMBER = 1 << 8;
public static byte BYTECODE = 0;
public static byte JAVA = 1;
public static byte GROOVY = 2;
public static final byte BYTECODE = 0;
public static final byte JAVA = 1;
public static final byte GROOVY = 2;
public static class Unit {
public final int myFileId;
@@ -45,8 +45,8 @@ public class PsiClassStubImpl<T extends PsiClass> extends StubBase<T> implements
private static final int IN_QUALIFIED_NEW = 0x40;
private static final int DEPRECATED_ANNOTATION = 0x80;
private LanguageLevel myLanguageLevel = null;
private StringRef mySourceFileName = null;
private LanguageLevel myLanguageLevel;
private StringRef mySourceFileName;
public PsiClassStubImpl(final JavaClassElementType type,
final StubElement parent,
@@ -36,7 +36,7 @@ import org.jetbrains.annotations.Nullable;
public class PsiImportStatementStubImpl extends StubBase<PsiImportStatementBase> implements PsiImportStatementStub {
private final byte myFlags;
private final StringRef myText;
private SoftReference<PsiJavaCodeReferenceElement> myReference = null;
private SoftReference<PsiJavaCodeReferenceElement> myReference;
private static final int ON_DEMAND = 0x01;
private static final int STATIC = 0x02;
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
* Copyright 2000-2016 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 org.jetbrains.annotations.Nullable;
* @author Maxim.Medvedev
*/
public class LightFieldBuilder extends LightVariableBuilder<LightFieldBuilder> implements PsiField {
private PsiClass myContainingClass = null;
private PsiExpression myInitializer = null;
private PsiDocComment myDocComment = null;
private boolean myIsDeprecated = false;
private PsiClass myContainingClass;
private PsiExpression myInitializer;
private PsiDocComment myDocComment;
private boolean myIsDeprecated;
public LightFieldBuilder(@NotNull String name, @NotNull String type, @NotNull PsiElement navigationElement) {
super(name, JavaPsiFacade.getElementFactory(navigationElement.getProject()).createTypeFromText(type, navigationElement),
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
* Copyright 2000-2016 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.
@@ -15,7 +15,6 @@
*/
package com.intellij.psi.impl.light;
import com.intellij.psi.OriginInfoAwareElement;
import com.intellij.lang.Language;
import com.intellij.lang.java.JavaLanguage;
import com.intellij.navigation.ItemPresentation;
@@ -53,7 +52,7 @@ public class LightMethodBuilder extends LightElement implements PsiMethod, Origi
private PsiClass myContainingClass;
private boolean myConstructor;
private String myMethodKind = "LightMethodBuilder";
private String myOriginInfo = null;
private String myOriginInfo;
public LightMethodBuilder(PsiClass constructedClass, Language language) {
this(constructedClass.getManager(), language, constructedClass.getName());
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
* Copyright 2000-2016 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.
@@ -29,8 +29,8 @@ import java.util.List;
*/
public class LightReferenceListBuilder extends LightElement implements PsiReferenceList {
private final List<PsiJavaCodeReferenceElement> myRefs = new ArrayList<PsiJavaCodeReferenceElement>();
private PsiJavaCodeReferenceElement[] myCachedRefs = null;
private PsiClassType[] myCachedTypes = null;
private PsiJavaCodeReferenceElement[] myCachedRefs;
private PsiClassType[] myCachedTypes;
private final Role myRole;
private final PsiElementFactory myFactory;
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2013 JetBrains s.r.o.
* Copyright 2000-2016 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.
@@ -27,7 +27,7 @@ import java.util.List;
*/
public class LightTypeParameterListBuilder extends LightElement implements PsiTypeParameterList {
private final List<PsiTypeParameter> myParameters = new ArrayList<PsiTypeParameter>();
private PsiTypeParameter[] cached = null;
private PsiTypeParameter[] cached;
public LightTypeParameterListBuilder(PsiManager manager, final Language language) {
super(manager, language);
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
* Copyright 2000-2016 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.
@@ -15,7 +15,6 @@
*/
package com.intellij.psi.impl.light;
import com.intellij.psi.OriginInfoAwareElement;
import com.intellij.lang.Language;
import com.intellij.lang.java.JavaLanguage;
import com.intellij.openapi.util.text.StringUtil;
@@ -39,7 +38,7 @@ public abstract class LightVariableBase extends LightElement implements PsiVaria
protected PsiType myType;
protected final PsiModifierList myModifierList;
protected boolean myWritable;
private String myOriginInfo = null;
private String myOriginInfo;
public LightVariableBase(PsiManager manager, PsiIdentifier nameIdentifier, PsiType type, boolean writable, PsiElement scope) {
this(manager, nameIdentifier, JavaLanguage.INSTANCE, type, writable, scope);
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2011 JetBrains s.r.o.
* Copyright 2000-2016 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.
@@ -31,7 +31,7 @@ public class JavaDummyElement extends FileElement {
private final JavaParserUtil.ParserWrapper myParser;
private final LanguageLevel myLanguageLevel;
private final boolean myConsumeAll;
private Throwable myParserError = null;
private Throwable myParserError;
public JavaDummyElement(@Nullable final CharSequence text,
@NotNull final JavaParserUtil.ParserWrapper parser,
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2015 JetBrains s.r.o.
* Copyright 2000-2016 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.
@@ -115,8 +115,8 @@ public class JavaLightStubBuilder extends LightStubBuilder {
super.visitNode(element);
}
private IElementType last = null;
private boolean seenNew = false;
private IElementType last;
private boolean seenNew;
@Override
public boolean visit(IElementType type) {
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2013 JetBrains s.r.o.
* Copyright 2000-2016 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.
@@ -27,7 +27,7 @@ import com.intellij.util.IncorrectOperationException;
import org.jetbrains.annotations.NotNull;
public class PsiAnonymousClassImpl extends PsiClassImpl implements PsiAnonymousClass {
private SoftReference<PsiClassType> myCachedBaseType = null;
private SoftReference<PsiClassType> myCachedBaseType;
public PsiAnonymousClassImpl(final PsiClassStub stub) {
super(stub, JavaStubElementTypes.ANONYMOUS_CLASS);
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2016 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.
@@ -25,7 +25,7 @@ import org.jetbrains.annotations.NotNull;
public class PsiEnumConstantInitializerImpl extends PsiClassImpl implements PsiEnumConstantInitializer {
private static final Logger LOG = Logger.getInstance("#com.intellij.psi.impl.source.PsiEnumConstantInitializerImpl");
private PsiClassType myCachedBaseType = null;
private PsiClassType myCachedBaseType;
public PsiEnumConstantInitializerImpl(final PsiClassStub stub) {
super(stub, JavaStubElementTypes.ENUM_CONSTANT_INITIALIZER);
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
* Copyright 2000-2016 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.
@@ -50,8 +50,8 @@ import java.util.Set;
public class PsiFieldImpl extends JavaStubPsiElement<PsiFieldStub> implements PsiField, PsiVariableEx, Queryable {
private static final Logger LOG = Logger.getInstance("#com.intellij.psi.impl.source.PsiFieldImpl");
private volatile SoftReference<PsiType> myCachedType = null;
private volatile Object myCachedInitializerValue = null; // PsiExpression on constant value for literal
private volatile SoftReference<PsiType> myCachedType;
private volatile Object myCachedInitializerValue; // PsiExpression on constant value for literal
public PsiFieldImpl(final PsiFieldStub stub) {
this(stub, JavaStubElementTypes.FIELD);
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2013 JetBrains s.r.o.
* Copyright 2000-2016 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.
@@ -29,9 +29,9 @@ import org.jetbrains.annotations.NotNull;
import java.util.Map;
public class PsiImportListImpl extends JavaStubPsiElement<PsiImportListStub> implements PsiImportList {
private volatile Map<String,PsiImportStatement> myClassNameToImportMap = null;
private volatile Map<String,PsiImportStatement> myPackageNameToImportMap = null;
private volatile Map<String,PsiImportStatementBase> myNameToSingleImportMap = null;
private volatile Map<String,PsiImportStatement> myClassNameToImportMap;
private volatile Map<String,PsiImportStatement> myPackageNameToImportMap;
private volatile Map<String,PsiImportStatementBase> myNameToSingleImportMap;
private static final PsiImportStatementBase[] EMPTY_ARRAY = new PsiImportStatementBase[0];
private static final ArrayFactory<PsiImportStatementBase> ARRAY_FACTORY = new ArrayFactory<PsiImportStatementBase>() {
@NotNull
@@ -55,7 +55,7 @@ import java.util.List;
public class PsiJavaCodeReferenceElementImpl extends CompositePsiElement implements PsiJavaCodeReferenceElement, SourceJavaCodeReference {
private static final Logger LOG = Logger.getInstance("#com.intellij.psi.impl.source.PsiJavaCodeReferenceElementImpl");
private volatile String myCachedQName = null;
private volatile String myCachedQName;
private volatile String myCachedNormalizedText;
private volatile int myKindWhenDummy = CLASS_NAME_KIND;
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2013 JetBrains s.r.o.
* Copyright 2000-2016 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.
@@ -52,7 +52,7 @@ import java.util.Map;
public class PsiMethodImpl extends JavaStubPsiElement<PsiMethodStub> implements PsiMethod, Queryable {
private static final Logger LOG = Logger.getInstance("#com.intellij.psi.impl.source.PsiMethodImpl");
private SoftReference<PsiType> myCachedType = null;
private SoftReference<PsiType> myCachedType;
public PsiMethodImpl(final PsiMethodStub stub) {
this(stub, JavaStubElementTypes.METHOD);
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2015 JetBrains s.r.o.
* Copyright 2000-2016 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.
@@ -47,7 +47,7 @@ import java.util.Arrays;
public class PsiParameterImpl extends JavaStubPsiElement<PsiParameterStub> implements PsiParameter {
private static final Logger LOG = Logger.getInstance("#com.intellij.psi.impl.source.PsiParameterImpl");
private volatile Reference<PsiType> myCachedType = null;
private volatile Reference<PsiType> myCachedType;
public PsiParameterImpl(@NotNull PsiParameterStub stub) {
this(stub, JavaStubElementTypes.PARAMETER);
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
* Copyright 2000-2016 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.
@@ -39,8 +39,8 @@ public class ClassResolverProcessor extends BaseScopeProcessor implements NameHi
private final PsiFile myContainingFile;
private final PsiElement myPlace;
private final PsiResolveHelper myResolveHelper;
private PsiClass myAccessClass = null;
private List<ClassCandidateInfo> myCandidates = null;
private PsiClass myAccessClass;
private List<ClassCandidateInfo> myCandidates;
private boolean myHasAccessibleCandidate;
private boolean myHasInaccessibleCandidate;
private JavaResolveResult[] myResult = JavaResolveResult.EMPTY_ARRAY;
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
* Copyright 2000-2016 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.
@@ -33,8 +33,8 @@ import org.jetbrains.annotations.Nullable;
*/
public class SymbolCollectingProcessor extends BaseScopeProcessor implements ElementClassHint {
private final MostlySingularMultiMap<String, ResultWithContext> myResult = new MostlySingularMultiMap<String, ResultWithContext>();
private PsiElement myCurrentFileContext = null;
private PsiAnchor myCurrentContextAnchor = null;
private PsiElement myCurrentFileContext;
private PsiAnchor myCurrentContextAnchor;
@Override
public <T> T getHint(@NotNull Key<T> hintKey) {
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
* Copyright 2000-2016 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.
@@ -20,11 +20,7 @@ import com.intellij.pom.java.LanguageLevel;
import com.intellij.psi.*;
import com.intellij.psi.filters.ElementFilter;
import com.intellij.psi.infos.CandidateInfo;
import com.intellij.psi.scope.ElementClassFilter;
import com.intellij.psi.scope.ElementClassHint;
import com.intellij.psi.scope.JavaScopeProcessorEvent;
import com.intellij.psi.scope.PsiConflictResolver;
import com.intellij.psi.scope.PsiScopeProcessor;
import com.intellij.psi.scope.*;
import com.intellij.psi.scope.conflictResolvers.JavaVariableConflictResolver;
import com.intellij.psi.scope.processor.ConflictFilterProcessor;
import com.intellij.psi.util.PsiUtil;
@@ -37,9 +33,9 @@ import org.jetbrains.annotations.NotNull;
public class VariableResolverProcessor extends ConflictFilterProcessor implements ElementClassHint {
private static final ElementFilter ourFilter = ElementClassFilter.VARIABLE;
private boolean myStaticScopeFlag = false;
private boolean myStaticScopeFlag;
private final PsiClass myAccessClass;
private PsiElement myCurrentFileContext = null;
private PsiElement myCurrentFileContext;
public VariableResolverProcessor(@NotNull PsiJavaCodeReferenceElement place, @NotNull PsiFile placeFile) {
super(place.getReferenceName(), ourFilter, new PsiConflictResolver[]{new JavaVariableConflictResolver()}, new SmartList<CandidateInfo>(), place, placeFile);
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2015 JetBrains s.r.o.
* Copyright 2000-2016 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.
@@ -76,11 +76,11 @@ public class InferenceSession {
private PsiSubstitutor mySiteSubstitutor;
private final PsiManager myManager;
private int myConstraintIdx = 0;
private int myConstraintIdx;
private List<String> myErrorMessages;
private boolean myErased = false;
private boolean myErased;
public final InferenceIncorporationPhase myIncorporationPhase = new InferenceIncorporationPhase(this);
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2015 JetBrains s.r.o.
* Copyright 2000-2016 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.
@@ -35,7 +35,7 @@ public class InferenceVariable extends LightTypeParameter {
return getDelegate();
}
private boolean myThrownBound = false;
private boolean myThrownBound;
private final Map<InferenceBound, List<PsiType>> myBounds = new HashMap<InferenceBound, List<PsiType>>();
private final String myName;
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
* Copyright 2000-2016 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.
@@ -28,7 +28,7 @@ import com.intellij.psi.scope.util.PsiScopesUtil;
* To change this template use Options | File Templates.
*/
public abstract class GenericReferenceProvider extends PsiReferenceProvider {
private boolean mySoft = false;
private boolean mySoft;
public void handleEmptyContext(PsiScopeProcessor processor, PsiElement position) {
PsiScopesUtil.treeWalkUp(processor, position, null);
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2012 JetBrains s.r.o.
* Copyright 2000-2016 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.
@@ -44,7 +44,7 @@ public class PsiCatchSectionImpl extends CompositePsiElement implements PsiCatch
private static final Logger LOG = Logger.getInstance("#com.intellij.psi.impl.source.tree.java.PsiCatchSectionImpl");
private final Object myTypesCacheLock = new Object();
private CachedValue<List<PsiType>> myTypesCache = null;
private CachedValue<List<PsiType>> myTypesCache;
public PsiCatchSectionImpl() {
super(CATCH_SECTION);
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
* Copyright 2000-2016 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.
@@ -86,9 +86,9 @@ public class PsiCodeBlockImpl extends LazyParseablePsiElement implements PsiCode
return (PsiJavaToken)findChildByRoleAsPsiElement(ChildRole.RBRACE);
}
private volatile Set<String> myVariablesSet = null;
private volatile Set<String> myClassesSet = null;
private volatile boolean myConflict = false;
private volatile Set<String> myVariablesSet;
private volatile Set<String> myClassesSet;
private volatile boolean myConflict;
// return Pair(classes, locals) or null if there was conflict
@Nullable
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2013 JetBrains s.r.o.
* Copyright 2000-2016 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.
@@ -46,7 +46,7 @@ import java.util.Set;
public class PsiLocalVariableImpl extends CompositePsiElement implements PsiLocalVariable, PsiVariableEx, Constants {
private static final Logger LOG = Logger.getInstance("#com.intellij.psi.impl.source.tree.java.PsiLocalVariableImpl");
private volatile String myCachedName = null;
private volatile String myCachedName;
@SuppressWarnings({"UnusedDeclaration"})
public PsiLocalVariableImpl() {
@@ -61,8 +61,8 @@ import java.util.Set;
public class PsiReferenceExpressionImpl extends PsiReferenceExpressionBase implements PsiReferenceExpression, SourceJavaCodeReference {
private static final Logger LOG = Logger.getInstance("#com.intellij.psi.impl.source.tree.java.PsiReferenceExpressionImpl");
private volatile String myCachedQName = null;
private volatile String myCachedNormalizedText = null;
private volatile String myCachedQName;
private volatile String myCachedNormalizedText;
public PsiReferenceExpressionImpl() {
super(JavaElementType.REFERENCE_EXPRESSION);
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2012 JetBrains s.r.o.
* Copyright 2000-2016 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.
@@ -34,7 +34,7 @@ import java.util.ArrayList;
public class PsiTryStatementImpl extends CompositePsiElement implements PsiTryStatement, Constants {
private static final Logger LOG = Logger.getInstance("#com.intellij.psi.impl.source.tree.java.PsiTryStatementImpl");
private volatile PsiParameter[] myCachedCatchParameters = null;
private volatile PsiParameter[] myCachedCatchParameters;
public PsiTryStatementImpl() {
super(TRY_STATEMENT);
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
* Copyright 2000-2016 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.
@@ -33,7 +33,7 @@ import java.util.List;
* Date: 31.01.2003
*/
public class MethodCandidatesProcessor extends MethodsProcessor{
protected boolean myHasAccessibleStaticCorrectCandidate = false;
protected boolean myHasAccessibleStaticCorrectCandidate;
public MethodCandidatesProcessor(@NotNull PsiElement place, PsiFile placeFile, @NotNull PsiConflictResolver[] resolvers, @NotNull List<CandidateInfo> container) {
super(resolvers, container, place, placeFile);
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
* Copyright 2000-2016 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.
@@ -25,7 +25,7 @@ import com.intellij.util.SmartList;
import org.jetbrains.annotations.NotNull;
public class MethodResolverProcessor extends MethodCandidatesProcessor {
private boolean myStopAcceptingCandidates = false;
private boolean myStopAcceptingCandidates;
public MethodResolverProcessor(@NotNull PsiMethodCallExpression place, @NotNull PsiFile placeFile) {
this(place, place.getArgumentList(), placeFile);
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
* Copyright 2000-2016 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.
@@ -40,10 +40,10 @@ import java.util.List;
public abstract class MethodsProcessor extends ConflictFilterProcessor implements ElementClassHint {
private static final ElementFilter ourFilter = ElementClassFilter.METHOD;
private boolean myStaticScopeFlag = false;
private boolean myIsConstructor = false;
protected PsiElement myCurrentFileContext = null;
protected PsiClass myAccessClass = null;
private boolean myStaticScopeFlag;
private boolean myIsConstructor;
protected PsiElement myCurrentFileContext;
protected PsiClass myAccessClass;
private PsiExpressionList myArgumentList;
private PsiType[] myTypeArguments;
private final LanguageLevel myLanguageLevel;
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
* Copyright 2000-2016 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.
@@ -29,7 +29,7 @@ import org.jetbrains.annotations.NotNull;
import java.util.List;
public abstract class VariablesProcessor extends BaseScopeProcessor implements ElementClassHint {
private boolean myStaticScopeFlag = false;
private boolean myStaticScopeFlag;
private final boolean myStaticSensitiveFlag;
private final List<PsiVariable> myResultList;
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2011 JetBrains s.r.o.
* Copyright 2000-2016 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.
@@ -14,13 +14,6 @@
* limitations under the License.
*/
/**
* Created by IntelliJ IDEA.
* User: igork
* Date: Nov 25, 2002
* Time: 2:05:49 PM
* To change this template use Options | File Templates.
*/
package com.intellij.psi.scope.util;
import com.intellij.openapi.diagnostic.Logger;