{"record":{"id":"01a3192f993ac1c4","repo":"clojure/clojure","slug":"module-requires-asm6","errorCode":null,"errorMessage":"Module requires ASM6","messagePattern":"Module requires ASM6","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"src/jvm/clojure/asm/ClassVisitor.java","lineNumber":153,"sourceCode":"  public void visitSource(final String source, final String debug) {\n    if (cv != null) {\n      cv.visitSource(source, debug);\n    }\n  }\n\n  /**\n   * Visit the module corresponding to the class.\n   *\n   * @param name the fully qualified name (using dots) of the module.\n   * @param access the module access flags, among {@code ACC_OPEN}, {@code ACC_SYNTHETIC} and {@code\n   *     ACC_MANDATED}.\n   * @param version the module version, or {@literal null}.\n   * @return a visitor to visit the module values, or {@literal null} if this visitor is not\n   *     interested in visiting this module.\n   */\n  public ModuleVisitor visitModule(final String name, final int access, final String version) {\n    if (api < Opcodes.ASM6) {\n      throw new UnsupportedOperationException(\"Module requires ASM6\");\n    }\n    if (cv != null) {\n      return cv.visitModule(name, access, version);\n    }\n    return null;\n  }\n\n  /**\n   * Visits the nest host class of the class. A nest is a set of classes of the same package that\n   * share access to their private members. One of these classes, called the host, lists the other\n   * members of the nest, which in turn should link to the host of their nest. This method must be\n   * called only once and only if the visited class is a non-host member of a nest. A class is\n   * implicitly its own nest, so it's invalid to call this method with the visited class name as\n   * argument.\n   *\n   * @param nestHost the internal name of the host class of the nest (see {@link\n   *     Type#getInternalName()}).\n   */","sourceCodeStart":135,"sourceCodeEnd":171,"githubUrl":"https://github.com/clojure/clojure/blob/f3b143341d6efc6428b523b2eaa099a6cc99156e/src/jvm/clojure/asm/ClassVisitor.java#L135-L171","documentation":"Modules (module-info classes, Java 9+) require the ASM6 visitor API. ClassVisitor.visitModule throws UnsupportedOperationException when the visitor's api is below Opcodes.ASM6 and a module is being visited.","triggerScenarios":"Parsing a module-info.class or any class visit that triggers visitModule with a visitor built with api < Opcodes.ASM6 (ASM4/ASM5).","commonSituations":"Scanning a JDK 9+ application that uses the module system with legacy ASM-based tooling; annotation processors or agents built against ASM5 encountering module-info.class on the classpath.","solutions":["Pass Opcodes.ASM6 or later to the ClassVisitor super constructor","Upgrade the ASM dependency to a version supporting modules","Skip module-info.class files in classpath scanners","Handle UnsupportedOperationException as a signal to upgrade tooling"],"exampleFix":"// before\nsuper(Opcodes.ASM5);\n// after\nsuper(Opcodes.ASM6);","handlingStrategy":"try-catch","validationCode":"if (visitorApi < Opcodes.ASM6) { throw new IllegalStateException(\"Module support requires ASM6+ visitor\"); }","typeGuard":null,"tryCatchPattern":"try { visitor.visitModule(name, access, version); } catch (UnsupportedOperationException e) { log.warn(\"Visitor too old for modules, skipping module-info\"); }","preventionTips":["Use ASM6+ api in any tooling that may encounter module-info.class","Filter module-info.class out of classpath scans","Track ASM feature matrix (modules=ASM6, nests=ASM7, records=ASM8) when choosing api levels"],"tags":["asm","modules","java-9"],"backgroundTag":"unsupported-operation","analyzedSha":"f3b143341d6efc6428b523b2eaa099a6cc99156e","analyzedAt":"2026-09-09T12:04:58.961Z","contentChangedAt":"2026-09-09T12:04:58.961Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}