代码在我导入的项目中Eclipse会报错Erasure of method convert(Class, Map) is the same as another method in type WeixinConvertUtils但是在同事的idea环境是没问题的 请问有人知道这个是什么原因导致的和解决方案吗
package org.jrx.framework.weixin.utils;
import java.util.Map;
import org.apache.log4j.Logger;
import org.jrx.framework.core.utils.ExceptionUtils;
import org.jrx.framework.weixin.dicts.WeixinParamDicts;
import org.jrx.framework.weixin.process.event.ProcessEvent;
import org.jrx.framework.weixin.process.event.ProcessMsgEvent;
/**
* 微信转换工具类
* @ProjectName jrx-weixin
* @ClassName WeixinConvertUtils
*/
public class WeixinConvertUtils {
private static final Logger logger = Logger.getLogger(WeixinConvertUtils.class);
/**
* 请求体转为处理事件
* @Title: convert
* @param <T>
* @param clazz 处理事件类
* @param requestMap 请求体
* @return
*/
public static <T extends ProcessMsgEvent> T convert(Class<T> clazz, Map<String, String> requestMap) {
T o = null;
try {
o = clazz.newInstance();
o.setOpenid(requestMap.get(WeixinParamDicts.FROM_USER_NAME));
o.setOfficalAccount(requestMap.get(WeixinParamDicts.TO_USER_NAME));
o.setCreateTime(requestMap.get(WeixinParamDicts.CREATE_TIME));
o.setMsgType(requestMap.get(WeixinParamDicts.MSG_TYPE));
o.setMsgId(requestMap.get(WeixinParamDicts.MSGID));
} catch (InstantiationException e) {
logger.error(ExceptionUtils.getExceptionMsg(e) + ":", e);
} catch (IllegalAccessException e) {
logger.error(ExceptionUtils.getExceptionMsg(e) + ":", e);
}
return o;
}
/**
* 请求体转为处理事件
* @Title: convert
* @param <E>
* @param clazz 处理事件类
* @param requestMap 请求体
* @return
*/
public static <E extends ProcessEvent> E convert(Class<E> clazz, Map<String, String> requestMap) {
E o = null;
try {
o = clazz.newInstance();
o.setOpenid(requestMap.get(WeixinParamDicts.FROM_USER_NAME));
o.setOfficalAccount(requestMap.get(WeixinParamDicts.TO_USER_NAME));
o.setCreateTime(requestMap.get(WeixinParamDicts.CREATE_TIME));
o.setMsgType(requestMap.get(WeixinParamDicts.MSG_TYPE));
o.setEvent(requestMap.get(WeixinParamDicts.EVENT));
} catch (InstantiationException e) {
logger.error(ExceptionUtils.getExceptionMsg(e) + ":", e);
} catch (IllegalAccessException e) {
logger.error(ExceptionUtils.getExceptionMsg(e) + ":", e);
}
return o;
}
}