class CorsRegistryCORSDetector extends OpcodeStackDetector {

    private BugReporter bugReporter;

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

    @Override
    public void sawOpcode(int seen) {

        //printOpCode(seen);
        if (seen == Const.INVOKEVIRTUAL && getNameConstantOperand().equals("allowedOrigins")) {
            if ("org/springframework/web/servlet/config/annotation/CorsRegistration".equals(getClassConstantOperand())) {
                OpcodeStack.Item item = stack.getStackItem(0); //First item on the stack is the last
                if(item.isArray()) {
                    String[] strings=getStringArray(item);
                    String pattern="*";
                    for (String s: strings) {
                        if (s.equals(pattern)) {
                             bugReporter.reportBug(new BugInstance(this, "PERMISSIVE_CORS", HIGH_PRIORITY)
                        .addClassAndMethod(this).addSourceLine(this));
                             break;
                        }
                    }
                }
            }
        }
    }
    public String[] getStringArray(OpcodeStack.Item item){<FILL_FUNCTION_BODY>}
    public String getStringFromIdx(int idx) {
        Constant constant= getConstantPool().getConstant(idx);
        int s = ((ConstantString) constant).getStringIndex();
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        DataOutputStream outputStream=new DataOutputStream(baos);
        try {
            Constant string = getConstantPool().getConstant(s);
            if (string!=null) {
                string.dump(outputStream);
            } else {
                return null;
            }

        } catch (IOException e) {
            e.printStackTrace();
        }
        return baos.toString().substring(3);
    }
}

        Integer argumentsNum = (Integer) item.getConstant();
        String[] strings = new String[argumentsNum];
        for (int i=0; i<argumentsNum; i++) {
            int idx=-5-5*i;
            int stringIdx=getNextCodeByte(idx);
//            System.out.println(stringIdx);
            String s=getStringFromIdx(stringIdx);
//            System.out.println(Arrays.toString(s.toCharArray()));
            strings[i]=s;
        }
        return strings;
    
<no_super_class>