mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-10-06 10:07:41 +07:00
BiUtil.isSet() usages extracted
This commit is contained in:
+3
-2
@@ -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.
|
||||
@@ -31,6 +31,7 @@ import com.intellij.psi.tree.IElementType;
|
||||
import com.intellij.psi.util.FileTypeUtils;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.psi.util.PsiUtil;
|
||||
import com.intellij.util.BitUtil;
|
||||
import com.intellij.util.Processor;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -779,7 +780,7 @@ public class HighlightControlFlowUtil {
|
||||
try {
|
||||
final ControlFlow controlFlow = getControlFlowNoConstantEvaluate(body);
|
||||
final int completionReasons = ControlFlowUtil.getCompletionReasons(controlFlow, 0, controlFlow.getSize());
|
||||
if ((completionReasons & ControlFlowUtil.NORMAL_COMPLETION_REASON) == 0) {
|
||||
if (!BitUtil.isSet(completionReasons, ControlFlowUtil.NORMAL_COMPLETION_REASON)) {
|
||||
String description = JavaErrorMessages.message("initializer.must.be.able.to.complete.normally");
|
||||
return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(body).descriptionAndTooltip(description).create();
|
||||
}
|
||||
|
||||
+5
-4
@@ -33,6 +33,7 @@ import com.intellij.psi.search.searches.ClassInheritorsSearch;
|
||||
import com.intellij.psi.search.searches.ReferencesSearch;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.psi.util.PsiUtil;
|
||||
import com.intellij.util.BitUtil;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import gnu.trove.THashMap;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -274,18 +275,18 @@ public class GuessManagerImpl extends GuessManager {
|
||||
//System.out.println("analyzing usages of " + var + " in file " + scopeFile);
|
||||
SearchScope searchScope = new LocalSearchScope(scopeFile);
|
||||
|
||||
if ((flags & (CHECK_USAGE | CHECK_DOWN)) != 0){
|
||||
if (BitUtil.isSet(flags, CHECK_USAGE) || BitUtil.isSet(flags, CHECK_DOWN)) {
|
||||
for (PsiReference varRef : ReferencesSearch.search(var, searchScope, false)) {
|
||||
PsiElement ref = varRef.getElement();
|
||||
|
||||
if ((flags & CHECK_USAGE) != 0) {
|
||||
if (BitUtil.isSet(flags, CHECK_USAGE)) {
|
||||
PsiType type = guessElementTypeFromReference(myMethodPatternMap, ref, rangeToIgnore);
|
||||
if (type != null && !(type instanceof PsiPrimitiveType)) {
|
||||
typesSet.add(type);
|
||||
}
|
||||
}
|
||||
|
||||
if ((flags & CHECK_DOWN) != 0) {
|
||||
if (BitUtil.isSet(flags, CHECK_DOWN)) {
|
||||
if (ref.getParent() instanceof PsiExpressionList && ref.getParent().getParent() instanceof PsiMethodCallExpression) { //TODO : new
|
||||
PsiExpressionList list = (PsiExpressionList)ref.getParent();
|
||||
PsiExpression[] args = list.getExpressions();
|
||||
@@ -312,7 +313,7 @@ public class GuessManagerImpl extends GuessManager {
|
||||
}
|
||||
}
|
||||
|
||||
if ((flags & CHECK_UP) != 0){
|
||||
if (BitUtil.isSet(flags, CHECK_UP)){
|
||||
if (var instanceof PsiParameter && var.getParent() instanceof PsiParameterList && var.getParent().getParent() instanceof PsiMethod){
|
||||
PsiParameterList list = (PsiParameterList)var.getParent();
|
||||
PsiParameter[] parameters = list.getParameters();
|
||||
|
||||
Reference in New Issue
Block a user