mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-25 01:44:27 +00:00
This change enables the script editor to display and validate generic type arguments for method parameters that are erased to Object in Java's built-in collection interfaces. MOTIVATION ---------- Java's Map, Collection, List, Deque, and concurrent variants use Object-typed parameters (e.g., Map.get(Object), Collection.contains(Object)) for backward-compatibility reasons. When the receiver is parameterized (e.g., HashMap<String, Integer>), the editor should show get(String) instead of get(Object) to provide better hints and stricter validation. IMPLEMENTATION -------------- New GenericParameterAdapter utility (contract-level rules, NOT per-concrete-class): - Covers 8 JDK collection contracts exhaustively (Map, ConcurrentMap, Collection, List, Set, Deque, BlockingQueue, BlockingDeque) - 35+ rules total mapping erased Object params to appropriate type arguments (K, V, or E) - Integrated into MethodInfo.fromReflection() so all code paths (autocomplete, hover, validation) use the same adapted parameter types - Hover signature rendering now routes through MethodInfo for parameterized receivers, ensuring consistency with autocomplete Related-to: Generic type argument substitution framework (TypeSubstitutor, GenericContext) which already applied V correctly; this extends that same mechanism to K/E for the JDK's intentionally-erased-for-compatibility method parameters.