mapstruct / mapstruct/mapstruct-idea
Wrong usage of mappers factory should be able to remove static initializer
未關閉
還沒有人認領這個 Issue。
- 主要語言
- Java
- 星號
- 168
- 分支
- 41
- PR 合併指標
- 30 天內沒有已合併 PR
描述
Why reviewing PR #179 @hduelme pointed out that the Wrong usage of mappers factory does not work (i.e. it does not remove it) with the following code:
@Mapper(componentModel = "spring")
abstract class WrongComponentModelMapper {
static {
Mappers.getMapper(WrongComponentModelMapper.class);
}
Target map(Target source);
}
or
@Mapper(config = MyConfig.class, componentModel = "spring")
interface WrongComponentModelMapper {
WrongComponentModelMapper INSTANCE = () -> {
return Mappers.getMapper(WrongComponentModelMapper.class);
};
Target map(Target source);
}
We need to see if we can support this.
貢獻指南
這個儲存庫沒有索引到貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
先重現 issue 中的靜態初始化器和介面欄位範例,並追蹤 IntelliJ plugin 目前如何處理 Mappers.getMapper 的使用。查看 PR #179 周圍的討論以了解背景。完成的標準是確定這些模式是否可以獲得支援;如果可以,則透過涵蓋兩個範例來驗證其行為。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- java
- 領域
- tooling
- Issue 類型
- 功能
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 活躍度
- 停滯
- 描述清晰度
- 需要釐清
- 新手友好度
- 35/100