release 4.0.6
chore: release 4.0.6
主要变更:
- 默认 logStrategy 由 BASIC 改为 NONE,对齐 OkHttp HttpLoggingInterceptor 默认行为
- 全局共享 OkHttpClient:新增 retrofitBaseOkHttpClient Bean,所有 @RetrofitClient
通过 newBuilder() 派生,复用 connectionPool 与 dispatcher;新增 DisposableBean
钩子在 ApplicationContext 关闭时 shutdown dispatcher、evict 连接池、关闭 cache - BASE_URL_MAP 与 resourceNameCache 由 static 字段下沉为 RetrofitConfigBean /
Degrade Bean 实例字段,避免多 ClassLoader / 多 ApplicationContext 场景下的
Class 强引用泄漏 - AppContextUtils.getBeanOrNew 仅捕获 NoSuchBeanDefinitionException,其他容器
异常向上抛,避免 Bean 构造失败被静默降级为非托管实例 - BeanExtendUtils.setProperty 反射写失败改为 warn 日志,不再静默吞
- RetrofitUtils.readResponseBody 增加 8KB 上限,避免大响应体撑爆堆内存或污染日志
- RetryInterceptor 资源管理重构,避免重复 close 与 body() 判空 anti-pattern
- RetrofitException 异常 message 在 cause.getMessage() 为 null 时回退到类型名