我只是按照这里的建议尝试了 PlaceHistoryMapperWithFactory 。所以我的 AppPlaceHistoryMapper 看起来像这样:
@WithTokenizers({ InfoPlace.Tokenizer.class, LogPlace.Tokenizer.class })
public interface AppPlaceHistoryMapper extends PlaceHistoryMapperWithFactory<TokenizerFactory> {
}
我也改变了杜松子酒模块:
bind(PlaceHistoryMapperWithFactory.class).to(AppPlaceHistoryMapper.class);
但我不会 gwt 编译。我明白了
[INFO] Compiling module de.stalabw.zensus2011.adb.AuswertungsDB
[INFO] Scanning for additional dependencies: ...ClientInjectorImpl.java
[INFO] Adding '57' new generated units
[INFO] Validating newly compiled units
[INFO] Ignored 1 unit with compilation errors in first pass.
[INFO] Compile with -strict or with -logLevel set to TRACE or DEBUG to see all errors.
[INFO] [ERROR] Errors in '...PlaceHistoryMapperWithFactoryImpl.java'
[INFO] [ERROR] Line 10: The interface PlaceHistoryMapperWithFactory cannot be implemented more than once with different arguments: PlaceHistory
MapperWithFactory<Void> and PlaceHistoryMapperWithFactory
[INFO] [ERROR] Cannot proceed due to previous errors
我刚刚在我的单元测试中修复了同样的错误。我有一个模拟实现。我刚变
public class PlaceHistoryMapperMock extends AbstractPlaceHistoryMapper<void> implements
AppPlaceHistoryMapper
到
public class PlaceHistoryMapperMock extends AbstractPlaceHistoryMapper<TokenizerFactory> implements
AppPlaceHistoryMapper
错误消失了。但是如何为我的“真实”代码修复它?