class SamlIgnoreCommentsDetector extends OpcodeStackDetector {

    private static final String SAML_IGNORE_COMMENTS = "SAML_IGNORE_COMMENTS";
    private static final InvokeMatcherBuilder SET_IGNORE_COMMENTS = invokeInstruction()
            .atClass(
                    "org.opensaml.xml.parse.BasicParserPool",
                    "org.opensaml.xml.parse.StaticBasicParserPool"
            )
            .atMethod("setIgnoreComments");

    private BugReporter bugReporter;

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

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


        if (seen == Const.INVOKEVIRTUAL && SET_IGNORE_COMMENTS.matches(this)) {
            final OpcodeStack.Item item = stack.getStackItem(0);
            /* item has signature of Integer, check "instanceof" added to prevent cast from throwing exceptions */

            if (StackUtils.isConstantInteger(item) && (Integer) item.getConstant()  == 0) {
                bugReporter.reportBug(new BugInstance(this, SAML_IGNORE_COMMENTS, Priorities.HIGH_PRIORITY) //
                        .addClass(this).addMethod(this).addSourceLine(this));
            }
        }
    
<no_super_class>