class SslDisablerDetector extends OpcodeStackDetector {

    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 SslDisablerDetector(BugReporter bugReporter) {
        this.bugReporter = bugReporter;
    }

    @Override
    public void sawOpcode(int seen) {<FILL_FUNCTION_BODY>}

}

//        printOpCode(seen);

//        SslDisablerDetector: [0000]  getstatic
//        SslDisablerDetector: [0003]  invokevirtual   SecurityBypasser$.destroyAllSSLSecurityForTheEntireVMForever ()V

        if(seen == INVOKEVIRTUAL && getClassConstantOperand().endsWith("SecurityBypasser$") && getNameConstantOperand().equals("destroyAllSSLSecurityForTheEntireVMForever")) {
            bugReporter.reportBug(new BugInstance(this, WEAK_TRUST_MANAGER_TYPE, Priorities.NORMAL_PRIORITY) //
                    .addClass(this).addMethod(this).addSourceLine(this));
        }

        if(seen == GETSTATIC) {
            XField field = this.getXFieldOperand();
            if(field == null) return;
            //It is expected that developers either build the project or copy-paste the code in a random package..

            //Scala code:
            //1. HttpsURLConnection.setDefaultHostnameVerifier(SecurityBypasser.AllHosts);
            if(field.getClassName().endsWith("SecurityBypasser$AllHosts$") && field.getName().equals("MODULE$")) {
                bugReporter.reportBug(new BugInstance(this, WEAK_HOSTNAME_VERIFIER_TYPE, Priorities.NORMAL_PRIORITY) //
                        .addClass(this).addMethod(this).addSourceLine(this));
            }
            //Scala code:
            //2. val trustAllCerts = Array[TrustManager](SecurityBypasser.AllTM)
            else if(field.getClassName().endsWith("SecurityBypasser$AllTM$") && field.getName().equals("MODULE$")) {
                bugReporter.reportBug(new BugInstance(this, WEAK_TRUST_MANAGER_TYPE, Priorities.NORMAL_PRIORITY) //
                        .addClass(this).addMethod(this).addSourceLine(this));
            }
        }
    
<no_super_class>