Examples of SootClass


Examples of soot.SootClass

                    ValueBox box = (ValueBox) boxes.next();
                    Value value = box.getValue();

                    if (value instanceof FieldRef) {
                        SootField field = ((FieldRef) value).getField();
                        SootClass refClass = field.getDeclaringClass();

                        if (!refClass.equals(theClass)) {
                            _addClass(refClass);
                        }
                    } else if (value instanceof InvokeExpr) {
                        SootMethod refMethod = ((InvokeExpr) value).getMethod();
                        SootClass refClass = refMethod.getDeclaringClass();

                        if (!refClass.equals(theClass)) {
                            _addClass(refClass);
                        }
                    } else if (value instanceof NewExpr) {
                        SootClass refClass = ((NewExpr) value).getBaseType()
                                .getSootClass();

                        if (!refClass.equals(theClass)) {
                            _addClass(refClass);
                        }
                    }
                }
            }
View Full Code Here

Examples of soot.SootClass

        } else {
            // Can't say anything?
            return;
        }

        SootClass checkClass = (checkRef).getSootClass();
        SootClass opClass = (opRef).getSootClass();

        if (debug) {
            System.out.println("checkClass = " + checkClass);
        }

        if (debug) {
            System.out.println("opClass = " + opClass);
        }

        if (checkClass.isInterface()) {
            if (opClass.isInterface()) {
                if (hierarchy.isInterfaceSubinterfaceOf(opClass, checkClass)
                        || opClass.equals(checkClass)) {
                    // Then we know the instanceof will be true.
                    if (debug) {
                        System.out.println("Replacing " + box.getValue()
                                + " with true.");
                    }

                    box.setValue(IntConstant.v(1));
                }
            } else {
                // opClass is a class, not an interface.
                List implementorList = hierarchy.getImplementersOf(checkClass);

                if (implementorList.contains(opClass)) {
                    // Then we know the instanceof will be true.
                    if (debug) {
                        System.out.println("Replacing " + box.getValue()
                                + " with true.");
                    }

                    box.setValue(IntConstant.v(1));
                } else {
                    // We need to ensure that no subclass
                    // of opclass implements the
                    // interface.  This will mean we
                    // replace with false.
                    boolean foundOne = false;

                    for (Iterator implementors = implementorList.iterator(); implementors
                            .hasNext()
                            && !foundOne;) {
                        SootClass implementor = (SootClass) implementors.next();

                        if (hierarchy.getSuperclassesOf(implementor).contains(
                                opClass)) {
                            foundOne = true;
                        }
View Full Code Here

Examples of soot.SootClass

        } else {
            // Can't say anything?
            return;
        }

        SootClass checkClass = (checkRef).getSootClass();
        SootClass opClass = (opRef).getSootClass();

        if (debug) {
            System.out.println("castClass = " + checkClass);
        }

        if (debug) {
            System.out.println("opClass = " + opClass);
        }

        if (checkClass.isInterface()) {
            if (opClass.isInterface()) {
                if (hierarchy.isInterfaceSubinterfaceOf(opClass, checkClass)
                        || opClass.equals(checkClass)) {
                    // Then we know the instanceof will be true.
                    if (debug) {
                        System.out.println("Replacing " + "with assignment.");
                    }

                    box.setValue(op);
                }
            } else {
                // opClass is a class, not an interface.
                if (hierarchy.getImplementersOf(checkClass).contains(opClass)) {
                    // Then we know the instanceof will be true.
                    //if (debug) System.out.println("Replacing " +
                    //       box.getValue() + " with true.");
                    //   box.setValue(IntConstant.v(1));
                } else {
                    // We need to ensure that no subclass
                    // of opclass implements the
                    // interface.  This will mean we
                    // replace with false.
                }
            }
        } else {
            if (opClass.isInterface()) {
                //???
            } else {
                if (hierarchy.isClassSuperclassOfIncluding(checkClass, opClass)) {
                    // Then we know the instanceof will be true.
                    if (debug) {
View Full Code Here

Examples of soot.SootClass

    private boolean _isDeclarable(SootMethod method) {
        if (RequiredFileGenerator.isRequired(method)) {
            return true;
        }

        SootClass source = method.getDeclaringClass();

        while (source.hasSuperclass()) {
            source = source.getSuperclass();

            if (source.declaresMethod(method.getSubSignature())) {
                SootMethod m = source.getMethod(method.getSubSignature());

                if (RequiredFileGenerator.isRequired(m)) {
                    return true;
                }
            }
View Full Code Here

Examples of soot.SootClass

        // Extract the non-static fields, and insert them into the struct
        // that is declared to implement the class.
        Iterator superClasses = _getSuperClasses(source).iterator();

        while (superClasses.hasNext()) {
            SootClass superClass = (SootClass) superClasses.next();
            code.append(_generateInheritedFields(source, superClass));
        }

        code.append(_generateFields(source));
View Full Code Here

Examples of soot.SootClass

        CallGraph cg = Scene.v().getCallGraph();

        Iterator classesIt = Scene.v().getApplicationClasses().iterator();

        while (classesIt.hasNext()) {
            SootClass c = (SootClass) classesIt.next();

            LinkedList methodsList = new LinkedList();
            methodsList.addAll(c.getMethods());

            while (!methodsList.isEmpty()) {
                SootMethod container = (SootMethod) methodsList.removeFirst();

                if (!container.isConcrete()) {
View Full Code Here

Examples of soot.SootClass

        while (type instanceof ArrayType) {
            type = ((ArrayType) type).getElementType();
        }

        if (type instanceof RefType) {
            SootClass source = ((RefType) type).getSootClass();

            if (!classes.contains(source)) {
                classes.add(source);
            }
        }
View Full Code Here

Examples of soot.SootClass

            if (type instanceof ArrayType) {
                type = ((ArrayType) type).getElementType();
            }

            if (type instanceof RefType) {
                SootClass source = ((RefType) type).getSootClass();

                if (!classes.contains(source)) {
                    classes.add(source);
                }
            }
View Full Code Here

Examples of soot.SootClass

        LinkedList gray = new LinkedList();

        gray.addAll(source.getInterfaces());

        while (!gray.isEmpty()) {
            SootClass s = (SootClass) gray.getFirst();

            if (s.isInterface()) {
                Iterator classes = s.getInterfaces().iterator();

                while (classes.hasNext()) {
                    SootClass superclass = (SootClass) classes.next();

                    if (!interfaceSet.contains(superclass)
                            && !gray.contains(superclass)) {
                        gray.addLast(superclass);
                    }
View Full Code Here

Examples of soot.SootClass

        // Directly implemented interfaces.
        Iterator interfaces = source.getInterfaces().iterator();

        while (interfaces.hasNext()) {
            SootClass thisInterface = (SootClass) interfaces.next();
            code.append(_indent(2) + _comment(thisInterface.toString()));
            code.append(_indent(2) + "case "
                    + CNames.hashNumberOf(thisInterface) + ": "
                    + "return 1;\n\n");
        }
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.