class WeakTrustManagerDetector implements Detector {

    private static final boolean DEBUG = false;
    private static final String WEAK_TRUST_MANAGER_TYPE = "WEAK_TRUST_MANAGER";
    private static final String WEAK_HOSTNAME_VERIFIER_TYPE = "WEAK_HOSTNAME_VERIFIER";
    private BugReporter bugReporter;

    public WeakTrustManagerDetector(BugReporter bugReporter) {
        this.bugReporter = bugReporter;
    }

    @Override
    public void visitClassContext(ClassContext classContext) {<FILL_FUNCTION_BODY>}

    /**
     * Currently the detection is pretty weak.
     * It will catch Dummy implementation that have empty method implementation
     *
     * @return If the implementation is "empty" (direct return or dummy code)
     */
    private boolean isEmptyImplementation(MethodGen methodGen){
        boolean invokeInst = false;
        boolean loadField = false;

        for (Iterator itIns = methodGen.getInstructionList().iterator();itIns.hasNext();) {
            Instruction inst = ((InstructionHandle) itIns.next()).getInstruction();
            if (DEBUG)
                System.out.println(inst.toString(true));

            if (inst instanceof InvokeInstruction) {
                invokeInst = true;
            }
            if (inst instanceof GETFIELD) {
                loadField = true;
            }
        }
        return !invokeInst && !loadField;
    }

    @Override
    public void report() {

    }
}

        JavaClass javaClass = classContext.getJavaClass();

        //The class extends X509TrustManager
        boolean isTrustManager = InterfaceUtils.isSubtype(javaClass, "javax.net.ssl.X509TrustManager");
        boolean isHostnameVerifier = InterfaceUtils.isSubtype(javaClass, "javax.net.ssl.HostnameVerifier");

        //Not the target of this detector
        if (!isTrustManager && !isHostnameVerifier) return;

        Method[] methodList = javaClass.getMethods();

        for (Method m : methodList) {
            MethodGen methodGen = classContext.getMethodGen(m);

            if (DEBUG) System.out.println(">>> Method: " + m.getName());

            if (isTrustManager &&
                    (m.getName().equals("checkClientTrusted") ||
                    m.getName().equals("checkServerTrusted") ||
                    m.getName().equals("getAcceptedIssuers"))) {


                if(isEmptyImplementation(methodGen)) {
                    bugReporter.reportBug(new BugInstance(this, WEAK_TRUST_MANAGER_TYPE, Priorities.NORMAL_PRIORITY) //
                            .addClassAndMethod(javaClass, m));
                }
            }
            else if (isHostnameVerifier && m.getName().equals("verify")) {

                if(isEmptyImplementation(methodGen)) {
                    bugReporter.reportBug(new BugInstance(this, WEAK_HOSTNAME_VERIFIER_TYPE, Priorities.NORMAL_PRIORITY) //
                            .addClassAndMethod(javaClass, m));
                }
            }

        }
    
<no_super_class>