fixed something...

This commit is contained in:
jinyu 2016-11-01 12:42:18 +08:00
parent 363aa4bc9b
commit d3554f0f70

View File

@ -11,6 +11,7 @@ import io.netty.util.internal.logging.InternalLoggerFactory;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import com.foxinmy.weixin4j.exception.WeixinException; import com.foxinmy.weixin4j.exception.WeixinException;
@ -40,11 +41,9 @@ public class WeixinMessageDecoder extends
private Map<String, AesToken> aesTokenMap = new ConcurrentHashMap<String, AesToken>(); private Map<String, AesToken> aesTokenMap = new ConcurrentHashMap<String, AesToken>();
public WeixinMessageDecoder(Map<String, AesToken> aesTokenMap) { public WeixinMessageDecoder(final Map<String, AesToken> aesTokenMap) {
// this.aesTokenMap = aesTokenMap; for (Entry<String, AesToken> entry : aesTokenMap.entrySet()) {
AesToken[] tokens = aesTokenMap.values().toArray(new AesToken[0]); this.aesTokenMap.put(entry.getKey(), entry.getValue());
for (AesToken token : tokens) {
aesTokenMap.put(token.getWeixinId(), token);
} }
} }