Menu

#40 make StatsInputStream thread safe

Release 1.2.16
Accepted
None
Medium
Defect
2015-11-27
2015-11-27
No

All maps in class are static, HashMap not threadSafe. ConcurrentHashMap will sove the problem. Сould you fix and release new version via Maven?

public class StatsInputStream extends InputStream {

private static Map<string, biginteger=""> totalBytes = new HashMap<string, biginteger="">();
private static Map<string, biginteger=""> totalRead = new HashMap<string, biginteger="">();
private static Map<string, long=""> totalTime = new HashMap<string, long="">();</string,></string,></string,></string,></string,></string,>

Discussion


Log in to post a comment.