{
  "id": "java/cannot-resolve-method-in-object",
  "signature": "error: cannot find symbol: method X in class Y",
  "signature_zh": "错误：找不到符号：方法 X 在类 Y 中",
  "regex": "error: cannot find symbol\\n.*symbol:\\s+method\\s+\\w+",
  "domain": "java",
  "category": "compilation_error",
  "subcategory": null,
  "root_cause": "The compiler cannot find a method signature matching the invocation, typically due to a typo, incorrect argument types, or missing method in the class hierarchy.",
  "root_cause_type": "generic",
  "root_cause_zh": "编译器找不到与调用匹配的方法签名，通常是由于拼写错误、参数类型不正确或类层次结构中缺少方法。",
  "versions": [
    {
      "version": "Java 8",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Java 11",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Java 17",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Java 21",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "The method is not defined in the imported class, so the error persists.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Overload resolution fails due to signature mismatch, causing a different compilation error.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Cast may compile but leads to ClassCastException at runtime, not resolving the compile-time error.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Verify the method name and its parameter types against the class's API documentation. For example, if calling `list.sort(null)`, ensure `List` has a `sort` method (Java 8+).",
      "success_rate": 0.9,
      "how": "Verify the method name and its parameter types against the class's API documentation. For example, if calling `list.sort(null)`, ensure `List` has a `sort` method (Java 8+).",
      "condition": "",
      "sources": []
    },
    {
      "action": "Add the missing method to the class or use an existing equivalent method. Code example: `list.stream().sorted().collect(Collectors.toList())` instead of `list.sort(null)`.",
      "success_rate": 0.85,
      "how": "Add the missing method to the class or use an existing equivalent method. Code example: `list.stream().sorted().collect(Collectors.toList())` instead of `list.sort(null)`.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Check the classpath for version conflicts: use `mvn dependency:tree` or `gradle dependencies` to ensure the correct version of a library is used that defines the method.",
      "success_rate": 0.8,
      "how": "Check the classpath for version conflicts: use `mvn dependency:tree` or `gradle dependencies` to ensure the correct version of a library is used that defines the method.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Verify the method name and its parameter types against the class's API documentation. For example, if calling `list.sort(null)`, ensure `List` has a `sort` method (Java 8+).",
    "Add the missing method to the class or use an existing equivalent method. Code example: `list.stream().sorted().collect(Collectors.toList())` instead of `list.sort(null)`.",
    "Check the classpath for version conflicts: use `mvn dependency:tree` or `gradle dependencies` to ensure the correct version of a library is used that defines the method."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://docs.oracle.com/javase/tutorial/java/javaOO/methods.html",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.92,
  "resolvable": "true",
  "first_seen": "2023-08-15",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}