Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
33,900
String () { return super.toString() + " MAYBE_YIELD"; }
toString
33,901
boolean () { return myNegated; }
isNegated
33,902
String () { @NonNls StringBuilder builder = new StringBuilder(); builder.append("Condition ").append(getElement()); if (myNegated) builder.append(", negated"); if (myDependent.size() > 1) { builder.append(", dependent: "); builder.append(StringUtil.join(ContainerUtil.filter(myDependent, d -> d != this), i -> String.val...
getElementPresentation
33,903
Set<ConditionInstruction> () { return myDependent; }
getDependentConditions
33,904
String () { return super.toString() + " MAYBE_RETURN"; }
toString
33,905
boolean () { GrExpression expression = (GrExpression) getElement(); assert expression != null; final PsiType type = expression.getType(); return !PsiTypes.voidType().equals(type) && !PsiUtil.isVoidMethodCall(expression); }
mayReturnValue
33,906
GrControlFlowPolicy () { return INSTANCE; }
getInstance
33,907
boolean (@NotNull GrReferenceExpression ref) { return !ref.isQualified() || isThisRef(ref.getQualifierExpression()); }
isReferenceAccepted
33,908
boolean (@NotNull GrVariable variable) { return true; }
isVariableInitialized
33,909
String () { @NonNls final StringBuilder builder = new StringBuilder(); builder.append(num()); builder.append("("); for (Instruction successor : allSuccessors()) { builder.append(successor.num()); builder.append(','); } if (allPredecessors().iterator().hasNext()) builder.delete(builder.length() - 1, builder.length()); b...
toString
33,910
boolean (@NotNull GrReferenceExpression ref) { return !ref.isQualified() || isThisRef(ref.getQualifierExpression()); }
isReferenceAccepted
33,911
boolean (@NotNull GrVariable variable) { return variable.getInitializerGroovy() != null || hasTupleInitializer(variable) || variable instanceof GrParameter; }
isVariableInitialized
33,912
boolean (@NotNull GrVariable variable) { final PsiElement parent = variable.getParent(); return parent instanceof GrVariableDeclaration && ((GrVariableDeclaration)parent).getTupleInitializer() != null; }
hasTupleInitializer
33,913
GrResolverPolicy () { return INSTANCE; }
getInstance
33,914
Deque<CallInstruction> (@NotNull Instruction instruction) { return myEnv.get(instruction.num()); }
callStack
33,915
void (@NotNull Deque<CallInstruction> callStack, @NotNull Instruction instruction) { myEnv.set(instruction.num(), callStack); }
update
33,916
List<Optional<E>> (int n) { //noinspection unchecked Optional<E>[] optionals = new Optional[n]; Arrays.fill(optionals, Optional.empty()); return Arrays.asList(optionals); }
getEmptyInfo
33,917
List<E> (@NotNull Instruction instruction, @NotNull List<Optional<E>> info, @NotNull CallEnvironment env) { List<E> prevInfos = new SmartList<>(); for (Instruction i : getPrevious(instruction, env)) { Optional<E> prevInfo = info.get(i.num()); prevInfo.ifPresent(e -> prevInfos.add(e)); } return prevInfos; }
getPrevInfos
33,918
Iterable<Instruction> (@NotNull Instruction instruction, @NotNull CallEnvironment env) { return myDfa.isForward() ? instruction.predecessors(env) : instruction.successors(env); }
getPrevious
33,919
Iterable<Instruction> (@NotNull Instruction instruction, @NotNull CallEnvironment env) { return myDfa.isForward() ? instruction.successors(env) : instruction.predecessors(env); }
getNext
33,920
boolean () { if (myCounter == null) { myCounter = new WorkCounter(); return false; } return myCounter.isTimeOver(); }
checkCounter
33,921
long () { return ourThreadMXBean != null ? ourThreadMXBean.getCurrentThreadUserTime() : System.nanoTime(); }
getCurrentTime
33,922
boolean () { return getCurrentTime() - myStart > myTimeLimit; }
isTimeOver
33,923
DFAType (@Nullable PsiType mixin, @Nullable ConditionInstruction instruction) { if (mixin == null) { return this; } Mixin newMixin = new Mixin(mixin, instruction, instruction != null && instruction.isNegated()); if (mixins.contains(newMixin)) { return this; } DFAType newDfaType = new DFAType(this.primary); newDfaType.m...
withNewMixin
33,924
DFAType (@NotNull NegatingGotoInstruction negation) { if (mixins.isEmpty()) { return this; } final Set<ConditionInstruction> conditionsToNegate = negation.getCondition().getDependentConditions(); if (ContainerUtil.and(mixins, mixin -> !conditionsToNegate.contains(mixin.myCondition))) { return this; } DFAType result = c...
withNegated
33,925
DFAType (DFAType t1, DFAType t2, PsiManager manager) { if (t1.equals(t2)) return t1; if (dominates(t1, t2)) { return t1; } if (dominates(t2, t1)) { return t2; } final PsiType primary = TypesUtil.getLeastUpperBoundNullable(t1.primary, t2.primary, manager); final PsiType type1 = reduce(t1.mixins); final PsiType type2 = r...
merge
33,926
boolean (Object obj) { if (obj == this) return true; if (!(obj instanceof DFAType other)) return false; if (!eq(primary, other.primary)) return false; if (mixins.size() != other.mixins.size()) return false; for (Mixin mixin1 : mixins) { boolean contains = false; for (Mixin mixin2 : other.mixins) { if (mixin1.equals(mix...
equals
33,927
PsiType () { if (mixins.isEmpty()) return primary; List<PsiType> types = new ArrayList<>(); if (primary != null) { types.add(primary); } for (Mixin mixin : mixins) { if (mixin.myNegated) { continue; } if (mixin.myType.equals(PsiTypes.nullType())) { continue; } types.add(mixin.myType); } if (types.isEmpty()) return null...
getResultType
33,928
DFAType (@Nullable PsiType type) { return type == null ? NULL_DFA_TYPE : new DFAType(type); }
create
33,929
boolean (PsiType t1, PsiType t2) { return t1 == t2 || Comparing.equal(TypeConversionUtil.erasure(t1), TypeConversionUtil.erasure(t2)); }
eq
33,930
boolean (DFAType dominating, DFAType dominated) { boolean primaryDominating = dominated.primary == null || dominated.primary == PsiTypes.nullType() || dominated.primary == dominating.primary; if (!primaryDominating) return false; return dominating.mixins.isEmpty() || dominated.mixins == dominating.mixins; }
dominates
33,931
PsiType (List<Mixin> mixins) { List<PsiType> types = mixins.stream() .filter(it -> !it.myNegated) .map(it -> it.myType) .collect(toList()); return types.isEmpty() ? null : PsiIntersectionType.createIntersection(types); }
reduce
33,932
DFAType () { final DFAType type = new DFAType(primary); type.mixins.addAll(mixins); return type; }
copy
33,933
String () { return "{" + primary + " : " + mixins + "}"; }
toString
33,934
Mixin () { return new Mixin(myType, myCondition, !myNegated); }
negate
33,935
String () { return (myNegated ? "!" : "") + myType; }
toString
33,936
boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Mixin mixin = (Mixin)o; if (!myType.equals(mixin.myType)) return false; if (!Objects.equals(myCondition, mixin.myCondition)) return false; return true; }
equals
33,937
int () { int result = myType.hashCode(); result = 31 * result + (myCondition != null ? myCondition.hashCode() : 0); return result; }
hashCode
33,938
TypeDfaState (@NotNull List<? extends TypeDfaState> ins) { if (ins.size() == 0) { return TypeDfaState.EMPTY_STATE; } if (ins.size() == 1) { return ins.get(0); } TypeDfaState result = ins.get(0); for (int i = 1; i < ins.size(); i++) { if (ins.get(i) != TypeDfaState.EMPTY_STATE) { result = TypeDfaState.merge(result, ins....
join
33,939
boolean (@NotNull TypeDfaState e1, @NotNull TypeDfaState e2) { return e1 == e2 || e1.contentsEqual(e2); }
eq
33,940
Int2ObjectMap<DFAType> (@NotNull Int2ObjectMap<DFAType> cached, @Nullable TypeDfaState candidate) { if (candidate == null || candidate.getRawVarTypes().isEmpty()) { return cached; } List<Int2ObjectMap.Entry<DFAType>> newTypes = new SmartList<>(); for (Int2ObjectMap.Entry<DFAType> candidateEntry : candidate.getRawVarTyp...
mergeForCaching
33,941
boolean (@NotNull Int2ObjectMap<DFAType> cached, @NotNull Int2ObjectMap.Entry<DFAType> incoming) { if (!ApplicationManager.getApplication().isUnitTestMode() || ApplicationManagerEx.isInStressTest() || DfaCacheConsistencyKt.mustSkipConsistencyCheck()) { return true; } DFAType cachedType = cached.get(incoming.getIntKey()...
checkDfaStatesConsistency
33,942
TypeDfaState (@NotNull TypeDfaState left, @NotNull TypeDfaState right, PsiManager manager) { if (left == right) { return left; } Int2ObjectMap<DFAType> dominantMap = guessDominantMap(left.myVarTypes, right.myVarTypes); if (dominates(left, right, dominantMap)) { return left; } if (dominates(right, left, dominantMap)) { ...
merge
33,943
TypeDfaState (int variableIndex, @NotNull DFAType type) { BitSet newSet; if (variableIndex == 0 || !myProhibitedCachingVars.get(variableIndex)) { newSet = myProhibitedCachingVars; } else { newSet = (BitSet)myProhibitedCachingVars.clone(); newSet.set(variableIndex, false); } Int2ObjectMap<DFAType> newTypes; if (myVarTyp...
withNewType
33,944
TypeDfaState (int variableIndex) { if (variableIndex == 0 || myProhibitedCachingVars.get(variableIndex)) { return this; } BitSet newProhibitedVars = (BitSet)myProhibitedCachingVars.clone(); newProhibitedVars.set(variableIndex, true); return new TypeDfaState(myVarTypes, newProhibitedVars); }
withRemovedBinding
33,945
String () { String evicted = myProhibitedCachingVars.isEmpty() ? "" : ", (caching prohibited: " + myProhibitedCachingVars + ")"; return myVarTypes.toString() + evicted; }
toString
33,946
BitSet (BitSet leftSet, BitSet rightSet) { if (leftSet.equals(rightSet)) { return leftSet; } BitSet prohibited = ((BitSet)leftSet.clone()); prohibited.or(rightSet); return prohibited; }
mergeProhibitedVariables
33,947
Int2ObjectMap<DFAType> (Int2ObjectMap<DFAType> leftMap, Int2ObjectMap<DFAType> rightMap, PsiManager manager, BitSet prohibited) { Int2ObjectMap<DFAType> newFMap = new Int2ObjectOpenHashMap<>(); Stream.concat(rightMap.int2ObjectEntrySet().stream(), leftMap.int2ObjectEntrySet().stream()).forEach(entry -> { int descriptor...
mergeTypeMaps
33,948
boolean (Int2ObjectMap<DFAType> dominator, Int2ObjectMap<DFAType> dominated) { for (Int2ObjectMap.Entry<DFAType> dominatedEntry : dominated.int2ObjectEntrySet()) { DFAType dominatingType = dominator.get(dominatedEntry.getIntKey()); if (dominatingType == null || !DFAType.dominates(dominatingType, dominatedEntry.getValue...
dominatesAll
33,949
boolean (TypeDfaState dominator, TypeDfaState dominated, Int2ObjectMap<DFAType> dominantMap) { boolean dominateByTypes = dominated.myVarTypes.isEmpty() || dominantMap == dominator.myVarTypes; if (!dominateByTypes) return false; return dominator.myProhibitedCachingVars.equals(dominated.myProhibitedCachingVars); }
dominates
33,950
InferenceContext () { InferenceContext context = ourInferenceContext.get(); return context != null ? context : getTopContext(); }
getCurrentContext
33,951
InferenceContext () { return InferenceContext.TOP_CONTEXT; }
getTopContext
33,952
PsiType (@NotNull final GrReferenceExpression refExpr) { final GrControlFlowOwner scope = isFlatDFAAllowed() ? ControlFlowUtils.getTopmostOwner(refExpr) : ControlFlowUtils.findControlFlowOwner(refExpr); if (scope == null) return null; final GroovyReference rValueReference = refExpr.getRValueReference(); PsiElement reso...
getInferredType
33,953
PsiType (int descriptor, Instruction instruction, GrControlFlowOwner scope) { InferenceCache cache = getInferenceCache(scope); return cache.getInferredType(descriptor, instruction, false); }
getInferredType
33,954
PsiType (@Nullable PsiElement context, @NotNull GrVariable variable) { if (context == null) return variable.getType(); final GrControlFlowOwner scope = isFlatDFAAllowed() ? ControlFlowUtils.getTopmostOwner(ControlFlowUtils.findControlFlowOwner(context)) : ControlFlowUtils.findControlFlowOwner(context); if (scope == nul...
getVariableTypeInContext
33,955
boolean (@NotNull GrControlFlowOwner scope) { return getInferenceCache(scope).isTooComplexToAnalyze(); }
isTooComplexTooAnalyze
33,956
InferenceCache (@NotNull final GrControlFlowOwner scope) { if (isFlatDFAAllowed() && ControlFlowUtils.getTopmostOwner(scope) != scope) { LOG.error("Flat DFA inconsistency: scope is " + scope + ", but topmost owner is " + ControlFlowUtils.getTopmostOwner(scope)); } return CachedValuesManager.getCachedValue(scope, () -> ...
getInferenceCache
33,957
GroovyControlFlow (@NotNull final GrControlFlowOwner scope) { if (isFlatDFAAllowed()) { return CachedValuesManager.getCachedValue(scope, () -> Result.create(ControlFlowBuilder.buildFlatControlFlow(scope), MODIFICATION_COUNT)); } else { return ControlFlowUtils.getGroovyControlFlow(scope); } }
getFlatControlFlow
33,958
List<DefinitionMap> (@NotNull GroovyControlFlow flow) { final ReachingDefinitionsDfaInstance dfaInstance = new TypesReachingDefinitionsInstance(); final ReachingDefinitionsSemilattice lattice = new ReachingDefinitionsSemilattice(); final DFAEngine<DefinitionMap> engine = new DFAEngine<>(flow.getFlow(), dfaInstance, lat...
getDefUseMaps
33,959
PsiType (final PsiElement element) { if (element instanceof GrReferenceExpression && ((GrReferenceExpression)element).getQualifierExpression() == null) { return getInitializerTypeFor(element); } if (element instanceof GrVariable) { return ((GrVariable)element).getTypeGroovy(); } return null; }
getInitializerType
33,960
PsiType (PsiElement element) { final PsiElement parent = skipParentheses(element.getParent(), true); if (parent instanceof GrAssignmentExpression) { if (element instanceof GrIndexProperty) { final GrExpression rvalue = ((GrAssignmentExpression)parent).getRValue(); return rvalue != null ? rvalue.getType() : null; //don'...
getInitializerTypeFor
33,961
GrExpression (GrExpression lValue) { final PsiElement parent = lValue.getParent(); if (parent instanceof GrAssignmentExpression) return ((GrAssignmentExpression)parent).getRValue(); if (parent instanceof GrTuple) { final int i = ((GrTuple)parent).indexOf(lValue); final GrTupleAssignmentExpression grandParent = ((GrTupl...
getInitializerFor
33,962
boolean (Instruction @NotNull [] flow) { // in large flows there are a lot of variables, so minor inability to infer type for a parameter should not be noticeable. // on the other side, people may omit types of parameters in short methods, so augmenting may be useful there return flow.length < 20; }
isSimpleEnoughForAugmenting
33,963
DFAFlowInfo (@NotNull List<DefinitionMap> definitionMaps, @NotNull Instruction instruction, int descriptorId, @NotNull Predicate<? super Instruction> predicate) { Map<Pair<Instruction, Integer>, Collection<Pair<Instruction, Integer>>> interesting = new LinkedHashMap<>(); LinkedList<Pair<Instruction, Integer>> queue = n...
collectFlowInfo
33,964
void (@NotNull List<@Nullable TypeDfaState> dfaResult, Set<Instruction> storingInstructions) { for (var instruction : storingInstructions) { int index = instruction.num(); myVarTypes[index].getAndUpdate(oldState -> TypesSemilattice.mergeForCaching(oldState, dfaResult.get(index))); } }
cacheDfaResult
33,965
DefinitionMap (int instructionNum) { return myDefinitionMaps.getValue().get(instructionNum); }
getDefinitionMaps
33,966
TypeDfaState (@NotNull final TypeDfaState state, @NotNull final Instruction instruction) { TypeDfaState newState; if (instruction.num() == 0) { newState = handleStartInstruction(); } else if (instruction instanceof ReadWriteVariableInstruction) { newState = handleReadWriteVariable(state, (ReadWriteVariableInstruction)i...
fun
33,967
TypeDfaState () { TypeDfaState state = TypeDfaState.EMPTY_STATE; for (int descriptor : myFlowInfo.getInterestingDescriptors()) { PsiType initialType = myInitialTypeProvider.initialType(descriptor); if (initialType != null) { state = state.withNewType(descriptor, DFAType.create(initialType)); } } return state; }
handleStartInstruction
33,968
boolean (@NotNull TypeDfaState baseDfaState, @NotNull Int2ObjectMap<DFAType> newDfaTypes) { var oldMap = baseDfaState.getRawVarTypes(); for (var entry : newDfaTypes.int2ObjectEntrySet()) { if (!oldMap.containsKey(entry.getIntKey()) || !oldMap.get(entry.getIntKey()).equals(entry.getValue())) { return false; } } return t...
hasNoChanges
33,969
TypeDfaState (@NotNull final TypeDfaState state, @NotNull final MixinTypeInstruction instruction) { final int descriptor = instruction.getVariableDescriptor(); if (descriptor == 0) return state; return updateVariableType(state, instruction, descriptor, () -> { ReadWriteVariableInstruction originalInstr = instruction.ge...
handleMixin
33,970
TypeDfaState (@NotNull TypeDfaState state, @NotNull ReadWriteVariableInstruction instruction) { final PsiElement element = instruction.getElement(); if (element == null) return state; int descriptor = instruction.getDescriptor(); if (instruction.isWrite()) { return updateVariableType( state, instruction, descriptor, ()...
handleReadWriteVariable
33,971
TypeDfaState (TypeDfaState state, ArgumentsInstruction instruction) { TypeDfaState newState = state; for (Map.Entry<Integer, Collection<Argument>> entry : instruction.getArguments().entrySet()) { final int descriptor = entry.getKey(); final Collection<Argument> arguments = entry.getValue(); newState = handleArgument(ne...
handleArguments
33,972
TypeDfaState (TypeDfaState state, ArgumentsInstruction instruction, int descriptorId, Collection<Argument> arguments) { return updateVariableType(state, instruction, descriptorId, () -> { DFAType result = state.getNotNullDFAType(descriptorId); final GroovyResolveResult[] results = instruction.getElement().multiResolve(...
handleArgument
33,973
TypeDfaState (@NotNull TypeDfaState state, @NotNull Instruction instruction, int descriptorId, @NotNull Supplier<DFAType> computation) { if (descriptorId == 0) { return state; } if (!myFlowInfo.getInterestingInstructions().contains(instruction)) { return state.withRemovedBinding(descriptorId); } DFAType type = myCache....
updateVariableType
33,974
TypeDfaState (@NotNull TypeDfaState state, @NotNull NegatingGotoInstruction negation) { TypeDfaState newState = state; for (Int2ObjectMap.Entry<DFAType> entry : state.getRawVarTypes().int2ObjectEntrySet()) { DFAType before = entry.getValue(); DFAType after = before.withNegated(negation); if (before != after) { newState...
handleNegation
33,975
DefinitionMap (@NotNull List<? extends DefinitionMap> ins) { if (ins.size() == 0) { return NEUTRAL; } DefinitionMap result = ins.get(0); for (int i = 1; i < ins.size(); i++) { result = result.withMerged(ins.get(i)); } return result; }
join
33,976
FragmentVariableInfos (@NotNull final GrStatement first, @NotNull final GrStatement last, @NotNull final GrControlFlowOwner flowOwner, @NotNull GroovyControlFlow flow) { final Int2ObjectMap<int[]> dfaResult = inferDfaResult(flow.getFlow()); final LinkedHashSet<Integer> fragmentInstructions = getFragmentInstructions(fir...
obtainVariableFlowInformation
33,977
VariableInfo[] () { return imap.values().toArray(VariableInfo.EMPTY_ARRAY); }
getInputVariableNames
33,978
VariableInfo[] () { return omap.values().toArray(VariableInfo.EMPTY_ARRAY); }
getOutputVariableNames
33,979
PsiType (GrControlFlowOwner flowOwner, Instruction instruction, int descriptorId, VariableDescriptor descriptor) { PsiElement context = instruction.getElement(); PsiType outputType = TypeInferenceHelper.getInferredType(descriptorId, instruction, flowOwner); if (outputType == null) { GrVariable variable = resolveToLocal...
getVariableTypeAt
33,980
GrVariable (@Nullable PsiElement element, @NotNull String name) { if (element == null) return null; ElementResolveResult<GrVariable> result = GrReferenceResolveRunnerKt.resolveToLocalVariable(element, name); return result != null ? result.getElement() : null; }
resolveToLocalVariable
33,981
boolean (@Nullable PsiElement element, @NotNull VariableDescriptor descriptor, @NotNull GrControlFlowOwner flowOwner) { GrVariable variable = resolveToLocalVariable(element, descriptor.getName()); if (variable == null) return false; return !PsiImplUtilKt.isDeclaredIn(variable, flowOwner); }
isLocallyDeclaredOutOf
33,982
Int2ObjectMap<int[]> (Instruction @NotNull [] flow) { final ReachingDefinitionsDfaInstance dfaInstance = new ReachingDefinitionsDfaInstance(); final ReachingDefinitionsSemilattice lattice = new ReachingDefinitionsSemilattice(); final DFAEngine<DefinitionMap> engine = new DFAEngine<>(flow, dfaInstance, lattice); return ...
inferDfaResult
33,983
void (final Map<String, VariableInfo> imap, final Map<String, VariableInfo> omap, final GrStatement first, final GrStatement last, GrControlFlowOwner flowOwner) { flowOwner.accept(new GroovyRecursiveElementVisitor() { @Override public void visitClosure(@NotNull GrClosableBlock closure) { addUsagesInClosure(imap, omap, ...
addClosureUsages
33,984
void (@NotNull GrClosableBlock closure) { addUsagesInClosure(imap, omap, closure, first, last); super.visitClosure(closure); }
visitClosure
33,985
void (final Map<String, VariableInfo> imap, final Map<String, VariableInfo> omap, final GrClosableBlock closure, final GrStatement first, final GrStatement last) { closure.accept(new GroovyRecursiveElementVisitor() { @Override public void visitReferenceExpression(@NotNull GrReferenceExpression refExpr) { if (refExpr.is...
addUsagesInClosure
33,986
void (@NotNull GrReferenceExpression refExpr) { if (refExpr.isQualified()) { return; } String name = refExpr.getReferenceName(); if (name == null) return; GrVariable variable = resolveToLocalVariable(refExpr, name); if (variable == null) return; if (PsiImplUtilKt.isDeclaredIn(variable, closure)) return; if (!(variable ...
visitReferenceExpression
33,987
void (String name, Map<String, VariableInfo> map, PsiManager manager, PsiType type) { VariableInfoImpl info = (VariableInfoImpl)map.get(name); if (info == null) { info = new VariableInfoImpl(name, manager); map.put(name, info); } info.addSubtype(type); }
addVariable
33,988
LinkedHashSet<Integer> (final LinkedHashSet<Integer> instructions, final Instruction[] flow) { final LinkedHashSet<Integer> result = new LinkedHashSet<>(); for (final Integer i : instructions) { final Instruction instruction = flow[i]; if (isReadInsn(instruction)) { result.add(i); } } return result; }
filterReads
33,989
boolean (int[] defs, LinkedHashSet<Integer> fragmentInstructions) { for (int def : defs) { if (!fragmentInstructions.contains(def)) return false; } return true; }
allDefsInFragment
33,990
boolean (int[] defs, int ref, LinkedHashSet<Integer> fragmentInstructions, int[] postorder) { for (int def : defs) { if (!fragmentInstructions.contains(def) && postorder[def] < postorder[ref]) return false; } return true; }
allProperDefsInFragment
33,991
boolean (int[] defs, LinkedHashSet<Integer> fragmentInstructions) { for (int def : defs) { if (fragmentInstructions.contains(def)) return true; } return false; }
anyDefInFragment
33,992
PsiType (PsiElement element) { if (element instanceof GrVariable) { return ((GrVariable)element).getTypeGroovy(); } else if (element instanceof GrReferenceExpression) return ((GrReferenceExpression)element).getType(); return null; }
getType
33,993
LinkedHashSet<Integer> (GrStatement first, GrStatement last, Instruction[] flow) { LinkedHashSet<Integer> result = new LinkedHashSet<>(); for (Instruction instruction : flow) { if (isInFragment(instruction, first, last)) { result.add(instruction.num()); } } return result; }
getFragmentInstructions
33,994
boolean (Instruction instruction, GrStatement first, GrStatement last) { final PsiElement element = instruction.getElement(); if (element == null) return false; return isInFragment(first, last, element); }
isInFragment
33,995
boolean (GrStatement first, GrStatement last, PsiElement element) { final PsiElement parent = first.getParent(); if (!PsiTreeUtil.isAncestor(parent, element, true)) return false; PsiElement run = element; while (run.getParent() != parent) run = run.getParent(); return isBetween(first, last, run); }
isInFragment
33,996
boolean (PsiElement first, PsiElement last, PsiElement run) { while (first != null && first != run) first = first.getNextSibling(); if (first == null) return false; while (last != null && last != run) last = last.getPrevSibling(); if (last == null) return false; return true; }
isBetween
33,997
LinkedHashSet<Integer> (final LinkedHashSet<Integer> fragmentInsns, final Instruction[] flow, final @NotNull Int2ObjectMap<int[]> dfaResult, final int[] postorder) { final LinkedHashSet<Integer> result = new LinkedHashSet<>(); for (final Instruction insn : flow) { if (isReadInsn(insn)) { final int ref = insn.num(); int...
getReachable
33,998
Set<Integer> (@NotNull LinkedHashSet<Integer> fragmentInstructions, Instruction @NotNull [] flow) { final Set<Integer> result = new HashSet<>(); for (Integer num : fragmentInstructions) { for (Instruction successor : flow[num].allSuccessors()) { if (!fragmentInstructions.contains(successor.num())) { result.add(num); } ...
getFragmentOuterBound
33,999
boolean (int def, int ref, Instruction[] flow, LinkedHashSet<Integer> fragmentInsns) { Boolean path = findPath(flow[def], ref, fragmentInsns, false, new HashMap<>()); assert path != null : "def=" + def + ", ref=" + ref; return path.booleanValue(); }
checkPathIsOutsideOfFragment