find_casts
Locate all type casts to a specified Java class to identify unsafe downcasts, find refactoring opportunities, and analyze type conversion patterns in your codebase.
Instructions
Find all casts to a type ((Foo) x expressions).
JDT-UNIQUE: This fine-grained search is not available in LSP.
USAGE: Provide fully qualified type name OUTPUT: All locations where casting to this type occurs
Useful for:
Identifying unsafe downcasts
Finding refactoring opportunities (replace cast with polymorphism)
Understanding type conversion patterns
Requires load_project to be called first.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| typeName | Yes | Fully qualified type name to find casts to | |
| maxResults | No | Maximum results to return (default 100) |