Map<String,Object> pp = new HashMap<>();
pp.put("subscriberCode", sn);
pp.put("currentTime", UTCTimeUtil.getUTCDateTimeStr());
pp.put("durationBalance", new Integer(0));
解释
英文
com.snt.crm.business.service.impl.SubTrafficCDRServiceImpl.saveVsatCdr(JSONObject) invokes inefficient new Integer(int) constructor; use Integer.valueOf(int) instead
Performance - Method invokes inefficient Number constructor; use static valueOf instead
Using new Integer(int) is guaranteed to always result in a new object whereas Integer.valueOf(int) allows caching of values to be done by the compiler, class library, or JVM. Using of cached values avoids object allocation and the code will be faster.
Values between -128 and 127 are guaranteed to have corresponding cached instances and using valueOf is approximately 3.5 times faster