@Override
    public AnnotationVisitor visitAnnotation(String descriptor, boolean visible) {
        //if (!descriptor.equals("Lorg/pf4j/Extension;")) {
        if (!Type.getType(descriptor).getClassName().equals(Extension.class.getName())) {
            return super.visitAnnotation(descriptor, visible);
        }

        return new AnnotationVisitor(ASM_VERSION) {

            @Override
            public AnnotationVisitor visitArray(final String name) {
                if ("ordinal".equals(name) || "plugins".equals(name) || "points".equals(name)) {
                    return new AnnotationVisitor(ASM_VERSION, super.visitArray(name)) {

                        @Override
                        public void visit(String key, Object value) {
                            log.debug("Load annotation attribute {} = {} ({})", name, value, value.getClass().getName());
                            if ("ordinal".equals(name)) {
                                extensionInfo.ordinal = Integer.parseInt(value.toString());
                            } else if ("plugins".equals(name)) {
                                if (value instanceof String) {
                                    log.debug("Found plugin {}", value);
                                    extensionInfo.plugins.add((String) value);
                                } else if (value instanceof String[]) {
                                    log.debug("Found plugins {}", Arrays.toString((String[]) value));
                                    extensionInfo.plugins.addAll(Arrays.asList((String[]) value));
                                } else {
                                    log.debug("Found plugin {}", value.toString());
                                    extensionInfo.plugins.add(value.toString());
                                }
                            } else {
                                String pointClassName = ((Type) value).getClassName();
                                log.debug("Found point " + pointClassName);
                                extensionInfo.points.add(pointClassName);
                            }

                            super.visit(key, value);
                        }
                    };
                }

                return super.visitArray(name);
            }

        };
    }
@Test
    void visitArrayShouldHandlePluginsAttribute() {
        ExtensionInfo extensionInfo = new ExtensionInfo("org.pf4j.asm.ExtensionInfo");
        ClassVisitor extensionVisitor = new ExtensionVisitor(extensionInfo);

        AnnotationVisitor annotationVisitor = extensionVisitor.visitAnnotation("Lorg/pf4j/Extension;", true);
        AnnotationVisitor arrayVisitor = annotationVisitor.visitArray("plugins");

        arrayVisitor.visit("key", "plugin1");

        assertTrue(extensionInfo.getPlugins().contains("plugin1"));
    }