这个问题是生产环境爆出来的,事后需要写1份分析报告,虽然关于hashmap这几天看了不少,但是始终写不出这个报告,希望有所帮助java.lang.NullPointerExceptionatcom.sinosoft.lis.sch...
这个问题是生产环境爆出来的,事后需要写1份分析报告,虽然关于hashmap这几天看了不少,但是始终写不出这个报告,希望有所帮助
java.lang.NullPointerException
at com.sinosoft.lis.schema.LCContSchema.equals(LCContSchema.java:4196)
at java.util.HashMap.areEqualKeys(HashMap.java:880)
at java.util.HashMap.c(HashMap.java:527)
at java.util.HashMap.getEntry(HashMap.java:512)
at java.util.HashMap.containsKey(HashMap.java:433)
-----
下面这个是 lccontschema中 关于equals的代码片段
public boolean equals(Object otherObject)
{
if (this == otherObject) return true;
if (otherObject == null) return false;
if (getClass() != otherObject.getClass()) return false;
LCContSchema other = (LCContSchema)otherObject;
return
GrpContNo.equals(other.getGrpContNo())
&& ContNo.equals(other.getContNo())
&& ProposalContNo.equals(other.getProposalContNo())
程序中具体方法是
tmpMap.put(inContSchema, "DELETE"); --lccontshcema
tmpMap.put(contSchema, "INSERT"); --lccontshcema
tmpMap.put(tLCContStateSet, "INSERT");
这个tmpmap 就是 hashmap 。
有人说,这是 hashcode 造成的 ,可是怎么造成的 谁看懂 能告诉我一下呢
展开