This commit is contained in:
Ilya Klyuchnikov
2014-10-01 17:50:41 +04:00
parent 9420896533
commit 212272a485
3 changed files with 7 additions and 1 deletions
@@ -336,6 +336,7 @@ public class ClassDataIndexer implements DataIndexer<Bytes, HEquations, FileCont
return result;
}
@NotNull
private LeakingParameters leakingParametersAndFrames(Method method, MethodNode methodNode, Type[] argumentTypes, boolean jsr)
throws AnalyzerException {
return argumentTypes.length < 32 ?
@@ -39,6 +39,7 @@ public class LeakingParameters {
this.nullableParameters = nullableParameters;
}
@NotNull
public static LeakingParameters build(String className, MethodNode methodNode, boolean jsr) throws AnalyzerException {
Frame<ParamsValue>[] frames = jsr ?
new Analyzer<ParamsValue>(new ParametersUsage(methodNode)).analyze(className, methodNode) :
@@ -67,6 +68,7 @@ public class LeakingParameters {
return new LeakingParameters((Frame<Value>[])(Frame<?>[])frames, notNullParameters, nullableParameters);
}
@NotNull
public static LeakingParameters buildFast(String className, MethodNode methodNode, boolean jsr) throws AnalyzerException {
IParametersUsage parametersUsage = new IParametersUsage(methodNode);
Frame<?>[] frames = jsr ?
@@ -16,6 +16,7 @@
package com.intellij.codeInspection.bytecodeAnalysis.asm;
import gnu.trove.TIntArrayList;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.org.objectweb.asm.Opcodes;
import org.jetbrains.org.objectweb.asm.tree.AbstractInsnNode;
@@ -93,6 +94,7 @@ public class OriginsAnalysis {
* @return array, array[i] == true means that the result of a method execution may originate at an i-th instruction
* @throws AnalyzerException
*/
@NotNull
public static boolean[] resultOrigins(Frame<Value>[] frames, InsnList instructions, ControlFlowGraph graph) throws AnalyzerException {
TIntArrayList[] backTransitions = new TIntArrayList[instructions.size()];
@@ -178,7 +180,8 @@ public class OriginsAnalysis {
return null;
}
private static Frame<SourceValue> makePreFrame(Frame<Value> frame) {
@NotNull
private static Frame<SourceValue> makePreFrame(@NotNull Frame<Value> frame) {
Frame<SourceValue> preFrame = new Frame<SourceValue>(frame.getLocals(), frame.getMaxStackSize());
for (int i = 0; i < frame.getLocals(); i++) {
preFrame.setLocal(i, new PreValue(true, i, frame.getLocal(i).getSize()));