class GoogleApiKeyDetector implements Detector {

    private static final String HARD_CODE_PASSWORD_TYPE = "HARD_CODE_PASSWORD";

    private BugReporter bugReporter;

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

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

    @Override
    public void report() {
    }
}

        JavaClass javaClass = classContext.getJavaClass();

        boolean keyStringField = false;
        for (Field f : javaClass.getFields()) {
            if (f.getName().equals("keyString")) { //The expected field name
                keyStringField = true;
                break;
            }
        }

        if (!keyStringField) { //No key field identify
            return;
        }

        //Class name left unchanged
        if (javaClass.getClassName().contains("UrlSigner")) {

            bugReporter.reportBug(new BugInstance(this, HARD_CODE_PASSWORD_TYPE, Priorities.NORMAL_PRIORITY) //
                    .addClass(javaClass).addField(new FieldVariable(javaClass.getClassName(), "keyString", "Ljava/lang/String;")));
            return;
        }

        //Event if the class name was refactor, the method "signRequest" would probably be left.
        for (Method m : javaClass.getMethods()) {
            MethodGen methodGen = classContext.getMethodGen(m);

            if (methodGen != null && "signRequest".equals(methodGen.getName())) {
                bugReporter.reportBug(new BugInstance(this, HARD_CODE_PASSWORD_TYPE, Priorities.NORMAL_PRIORITY) //
                        .addClass(javaClass).addField(new FieldVariable(javaClass.getClassName(), "keyString", "")));
            }
        }
    
<no_super_class>