?利用eclipse的調(diào)試工具,發(fā)現(xiàn)在應用自己的內(nèi)部對象的時候,報空對象異常,????
??? private static final int LARGE_HASH_CAPACITY = 300;????
??? private static final FAlarmFilterListChanger instance = new FAlarmFilterListChanger();????
??? /*
??? ?* 告警過濾規(guī)則列表配置
??? ?*/
??? private static Hashtable<Integer,FAlarmFilterList> alarmFilterHash?? = new????? Hashtable<Integer,FAlarmFilterList>(LARGE_HASH_CAPACITY);??????????? //告警過濾規(guī)則整體
private boolean InitialFilterList()
??? {
??? ??? boolean isSuccess = true;
??? ??? try{ ?? ??? ??
??? ??? ??? /*
??? ??? ??? ?* 清除所有的過濾器
??? ??? ??? ?*/
??? ??? ??? FAlarmFilterListChanger.getAlarmFilterHash().clear();???
??? ??? ??? FAlarmFilterListChanger.getAlmLevFilterHash().clear();
??? ??? ??? FAlarmFilterListChanger.getAlmObjFilterHash().clear();???????????
在調(diào)用初始化時總是出錯,
?? 想起java類的初始化順序的問題,修改如下,問題就解決了
private static final int LARGE_HASH_CAPACITY = 300;???
????
??? /*
??? ?* 告警過濾規(guī)則列表配置
??? ?*/
??? private static Hashtable<Integer,FAlarmFilterList> alarmFilterHash?? = new????? Hashtable<Integer,FAlarmFilterList>(LARGE_HASH_CAPACITY);??????????? //告警過濾規(guī)則整體
?//放在所有static 方法的最后
??? private static final FAlarmFilterListChanger instance = new FAlarmFilterListChanger();
private boolean InitialFilterList()
??? {
??? ??? boolean isSuccess = true;
??? ??? try{ ?? ??? ??
??? ??? ??? /*
??? ??? ??? ?* 清除所有的過濾器
??? ??? ??? ?*/
??? ??? ??? FAlarmFilterListChanger.getAlarmFilterHash().clear();???
??? ??? ??? FAlarmFilterListChanger.getAlmLevFilterHash().clear();
??? ??? ??? FAlarmFilterListChanger.getAlmObjFilterHash().clear();