Examples of InvokeInstruction


Examples of org.apache.bcel.generic.InvokeInstruction

            AnalysisContext.logError("error", e);
        } catch (CFGBuilderException e) {
            AnalysisContext.logError("error", e);
        }

        InvokeInstruction instruction = (InvokeInstruction) location.getHandle().getInstruction();
        SignatureParser sigParser = new SignatureParser(instruction.getSignature(classContext.getConstantPoolGen()));

        for (int i = violatedParamSet.nextSetBit(0); i >= 0; i = violatedParamSet.nextSetBit(i + 1)) {
            boolean definitelyNull = definitelyNullArgSet.get(i);

            if (definitelyNull) {
View Full Code Here

Examples of org.apache.bcel.generic.InvokeInstruction

        BugAnnotation variable = ValueNumberSourceInfo.findAnnotationFromValueNumber(method, location, valueNumber, vnaFrame,
                "VALUE_OF");
        addPropertiesForDereferenceLocations(propertySet, Collections.singleton(location), isConsistent);
        Instruction ins = location.getHandle().getInstruction();
        if (ins instanceof InvokeInstruction && refValue.isDefinitelyNull()) {
            InvokeInstruction iins = (InvokeInstruction) ins;
            if (iins.getMethodName(classContext.getConstantPoolGen()).equals("close")
                    && iins.getSignature(classContext.getConstantPoolGen()).equals("()V")) {
                propertySet.addProperty(NullDerefProperty.CLOSING_NULL);
            }
        }
        boolean duplicated = isDuplicated(propertySet, pc, isConsistent);
View Full Code Here

Examples of org.apache.bcel.generic.InvokeInstruction

                    break;
                }
            }
            Instruction i = h.getInstruction();
            if (i instanceof InvokeInstruction) {
                InvokeInstruction ii = (InvokeInstruction) i;
                String name = ii.getMethodName(classContext.getConstantPoolGen());
                if (name.startsWith("check") || name.startsWith("assert")) {
                    return true;
                }
            }
            h = h.getNext();
View Full Code Here

Examples of org.apache.bcel.generic.InvokeInstruction

                InstructionHandle handle = location.getHandle();
                Instruction ins = handle.getInstruction();
                ValueNumberFrame valueNumberFrame = vna.getFactAtLocation(location);
                TypeFrame typeFrame = typeDataflow.getFactAtLocation(location);
                if (ins instanceof InvokeInstruction) {
                    InvokeInstruction inv = (InvokeInstruction) ins;
                    XMethod m = XFactory.createXMethod(inv, cpg);
                    SignatureParser sigParser = new SignatureParser(m.getSignature());
                    int numParams = sigParser.getNumParameters();

                    // Check nonnull annotations
View Full Code Here

Examples of org.apache.bcel.generic.InvokeInstruction

        if (actionList == null) {
            Instruction ins = handle.getInstruction();
            actionList = Collections.emptyList();
            if (ins instanceof InvokeInstruction) {

                InvokeInstruction inv = (InvokeInstruction) ins;
                XMethod invokedMethod = XFactory.createXMethod(inv, cpg);
                String signature = invokedMethod.getSignature();
                String methodName = invokedMethod.getName();

                if (DEBUG_LOOKUP) {
                    System.out.println("Looking up actions for call to " + invokedMethod);
                }


                if (invokedMethod.getAnnotationDescriptors().contains(WILL_CLOSE) && methodName.startsWith("close") && signature.endsWith(")V")) {
                    actionList = Collections.singletonList(ObligationPolicyDatabaseAction.CLEAR);
                } else if (signature.indexOf(';') >= -1) {
                    ReferenceType receiverType = inv.getReferenceType(cpg);

                    boolean isStatic = inv.getOpcode() == Constants.INVOKESTATIC;
                    actionList = new LinkedList<ObligationPolicyDatabaseAction>();

                    database.getActions(receiverType, methodName, signature, isStatic, actionList);

                    if (actionList.isEmpty()) {
View Full Code Here

Examples of org.apache.bcel.generic.InvokeInstruction

            }

            // Is invoked class a subtype of the base class we want
            // FIXME: should test be different for INVOKESPECIAL and
            // INVOKESTATIC?
            InvokeInstruction inv = (InvokeInstruction) ins;
            ReferenceType classType = inv.getReferenceType(cpg);
            if (!Hierarchy.isSubtype(classType, baseClassType)) {
                return null;
            }

            // See if method name and signature match
            String methodName = inv.getMethodName(cpg);
            String methodSig = inv.getSignature(cpg);
            if (!this.methodName.equals(methodName) || !this.methodSig.equals(methodSig)) {
                return null;
            }

            String streamClass = type.getClassName();
View Full Code Here

Examples of org.apache.bcel.generic.InvokeInstruction

            if (!(ins instanceof InvokeInstruction)) {
                continue;
            }

            InvokeInstruction invoke = (InvokeInstruction) ins;
            String mName = invoke.getMethodName(cpg);
            if (!mName.equals("writeObject")) {
                continue;
            }
            String cName = invoke.getClassName(cpg);
            if (!cName.equals("java.io.ObjectOutput") && !cName.equals("java.io.ObjectOutputStream")) {
                continue;
            }

            TypeFrame frame = typeDataflow.getFactAtLocation(location);
View Full Code Here

Examples of org.apache.bcel.generic.InvokeInstruction

        }
        if (ins.getOpcode() == Constants.INVOKESTATIC) {
            return false;
        }

        InvokeInstruction inv = (InvokeInstruction) ins;
        String methodName = inv.getMethodName(cpg);
        String methodSig = inv.getSignature(cpg);

        return isMonitorWait(methodName, methodSig);
    }
View Full Code Here

Examples of org.apache.bcel.generic.InvokeInstruction

        }
        if (ins.getOpcode() == Constants.INVOKESTATIC) {
            return false;
        }

        InvokeInstruction inv = (InvokeInstruction) ins;
        String methodName = inv.getMethodName(cpg);
        String methodSig = inv.getSignature(cpg);

        return isMonitorNotify(methodName, methodSig);
    }
View Full Code Here

Examples of org.apache.bcel.generic.InvokeInstruction

        }
        Location location = new Location(handle, basicBlock);

        Instruction i = handle.getInstruction();
        if (i instanceof InvokeInstruction) {
            InvokeInstruction ii = (InvokeInstruction) i;
            XMethod m = XFactory.createXMethod(ii, cpg);
            if (TypeQualifierDataflowAnalysis.isIdentifyFunctionForTypeQualifiers(m)) {
                ValueNumberFrame vnaFrameAtLocation = vnaDataflow.getFactAtLocation(location);
                ValueNumberFrame vnaFrameAfterInstruction = vnaDataflow.getFactAfterLocation(location);
                ValueNumber in = vnaFrameAtLocation.getStackValue(0);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.