@SuppressFBWarnings("ES_COMPARING_STRINGS_WITH_EQ") public MethodDescriptor getMethodDescriptorOperand() { if (nameConstantOperand == NOT_AVAILABLE || classConstantOperand == NOT_AVAILABLE) { throw new IllegalStateException("getMethodDescriptorOperand called but value not available"); } if (referencedMethod == null) { referencedMethod = DescriptorFactory.instance().getMethodDescriptor(classConstantOperand, nameConstantOperand, sigConstantOperand, opcode == Const.INVOKESTATIC); } return referencedMethod; }
public MethodDescriptor toMethodDescriptor() { return DescriptorFactory.instance().getMethodDescriptor(this); }
@Override protected MethodDescriptor parseKey(String methodStr) throws PropertyDatabaseFormatException { String[] tuple = methodStr.split(","); if (tuple.length != 4) { throw new PropertyDatabaseFormatException("Invalid method tuple: " + methodStr); } try { int accessFlags = Integer.parseInt(tuple[3]); // return // XFactory.createMethodDescriptor(XFactory.canonicalizeString(tuple[0]), // XFactory.canonicalizeString( tuple[1]), // XFactory.canonicalizeString(tuple[2]), accessFlags); String className = tuple[0]; String methodName = tuple[1]; String methodSig = tuple[2]; return DescriptorFactory.instance().getMethodDescriptor(ClassName.toSlashedClassName(className), methodName, methodSig, (accessFlags & Const.ACC_STATIC) != 0); } catch (NumberFormatException e) { return null; } }
/** * Construct a MethodDescriptor from JavaClass and method. * * @param jclass * a JavaClass * @param method * a Method belonging to the JavaClass * @return a MethodDescriptor identifying the method */ public static MethodDescriptor getMethodDescriptor(JavaClass jclass, Method method) { return DescriptorFactory.instance().getMethodDescriptor(jclass.getClassName().replace('.', '/'), method.getName(), method.getSignature(), method.isStatic()); }
/** * @param className * @param methodName * @param methodSig * @param isStatic * @return the created XMethod */ public static XMethod createXMethodUsingSlashedClassName(@SlashedClassName String className, String methodName, String methodSig, boolean isStatic) { assertSlashedClassName(className); MethodDescriptor desc = DescriptorFactory.instance().getMethodDescriptor(className, methodName, methodSig, isStatic); return createXMethod(desc); }
/** * Get a MethodDescriptor describing the method called by given * InvokeInstruction. * * @param inv * the InvokeInstruction * @param cpg * ConstantPoolGen of class containing instruction * @return MethodDescriptor describing the called method */ public static MethodDescriptor getCalledMethodDescriptor(InvokeInstruction inv, ConstantPoolGen cpg) { String calledClassName = inv.getClassName(cpg).replace('.', '/'); String calledMethodName = inv.getMethodName(cpg); String calledMethodSig = inv.getSignature(cpg); boolean isStatic = inv.getOpcode() == Const.INVOKESTATIC; return DescriptorFactory.instance().getMethodDescriptor(calledClassName, calledMethodName, calledMethodSig, isStatic); }
public MethodDescriptor getInvokedMethod(ConstantPoolGen cpg, InvokeInstruction inv) { String invoked = inv.getClassName(cpg); String methodName = inv.getMethodName(cpg); String methodSig = inv.getSignature(cpg); MethodDescriptor invokedMethod = DescriptorFactory.instance().getMethodDescriptor(ClassName.toSlashedClassName(invoked), methodName, methodSig, inv instanceof INVOKESTATIC); return invokedMethod; }
/** * Get the MethodDescriptor that (hopefully) uniqely names this method. * * @return the MethodDescriptor uniquely naming this method */ public MethodDescriptor toMethodDescriptor() { return DescriptorFactory.instance().getMethodDescriptor(getSlashedClassName(), method.getName(), method.getSignature(), method.isStatic()); }
/** * @param className * @param methodName * @param methodSig * @param isStatic * @return the created XMethod */ public static XMethod createXMethod(@DottedClassName String className, String methodName, String methodSig, boolean isStatic) { assertDottedClassName(className); MethodDescriptor desc = DescriptorFactory.instance().getMethodDescriptor(ClassName.toSlashedClassName(className), methodName, methodSig, isStatic); return createXMethod(desc); }
public MethodDescriptor getMethodDescriptor(JavaClass jClass, Method method) { return getMethodDescriptor(ClassName.toSlashedClassName(jClass.getClassName()), method.getName(), method.getSignature(), method.isStatic()); }
public MethodDescriptor getMethodDescriptor(MethodAnnotation ma) { return getMethodDescriptor(ClassName.toSlashedClassName(ma.getClassName()), ma.getMethodName(), ma.getMethodSignature(), ma.isStatic()); }
@Override public MethodDescriptor getMethodDescriptor() { return DescriptorFactory.instance().getMethodDescriptor(ClassName.toSlashedClassName(getClassName()), getName(), getSignature(), isStatic()); }
MethodDescriptor descriptor = DescriptorFactory.instance().getMethodDescriptor(jclass, method); MethodGen methodGen = new MethodGen(method, jclass.getClassName(), classGen.getConstantPool());
break; desc = DescriptorFactory.instance().getMethodDescriptor(superClass.getClassName(), desc.getName(), desc.getSignature(), desc.isStatic());
@Override public Method analyze(IAnalysisCache analysisCache, MethodDescriptor descriptor) throws CheckedAnalysisException { JavaClass jclass = analysisCache.getClassAnalysis(JavaClass.class, descriptor.getClassDescriptor()); Method[] methodList = jclass.getMethods(); Method result = null; // As a side-effect, cache all of the Methods for this JavaClass for (Method method : methodList) { MethodDescriptor methodDescriptor = DescriptorFactory.instance().getMethodDescriptor( descriptor.getSlashedClassName(), method.getName(), method.getSignature(), method.isStatic()); // Put in cache eagerly analysisCache.eagerlyPutMethodAnalysis(Method.class, methodDescriptor, method); if (methodDescriptor.equals(descriptor)) { result = method; } } return result; }
ValueNumberDataflow vnaDataflow = classContext.getValueNumberDataflow(method); boolean isGetterMethod = isGetterMethod(classContext, method); MethodDescriptor methodDescriptor = DescriptorFactory.instance().getMethodDescriptor(classContext.getJavaClass(), method); if (DEBUG) { System.out.println("**** Analyzing method " + SignatureConverter.convertMethodSignature(methodGen));
bugReporter.reportSkippedAnalysis(DescriptorFactory.instance().getMethodDescriptor(getClassName(), getMethodName(), getMethodSig(), m.isStatic())); } catch (DataflowAnalysisException e) {
/** * Construct a MethodDescriptor from JavaClass and method. * * @param jclass * a JavaClass * @param method * a Method belonging to the JavaClass * @return a MethodDescriptor identifying the method */ public static MethodDescriptor getMethodDescriptor(JavaClass jclass, Method method) { return DescriptorFactory.instance().getMethodDescriptor(jclass.getClassName().replace('.', '/'), method.getName(), method.getSignature(), method.isStatic()); }
public MethodDescriptor getInvokedMethod(ConstantPoolGen cpg, InvokeInstruction inv) { String invoked = inv.getClassName(cpg); String methodName = inv.getMethodName(cpg); String methodSig = inv.getSignature(cpg); MethodDescriptor invokedMethod = DescriptorFactory.instance().getMethodDescriptor(ClassName.toSlashedClassName(invoked), methodName, methodSig, inv instanceof INVOKESTATIC); return invokedMethod; }
/** * Get the MethodDescriptor that (hopefully) uniqely names this method. * * @return the MethodDescriptor uniquely naming this method */ public MethodDescriptor toMethodDescriptor() { return DescriptorFactory.instance().getMethodDescriptor(getSlashedClassName(), method.getName(), method.getSignature(), method.isStatic()); }