Claudenw commented on code in PR #240:
URL: https://github.com/apache/creadur-rat/pull/240#discussion_r1582027702


##########
apache-rat-core/src/main/java/org/apache/rat/report/claim/ClaimStatistic.java:
##########
@@ -57,45 +58,71 @@ public int getCounter(Counter counter) {
         return count == null ? 0 : count[0];
     }
 
-    /**
-     * @return Returns a map with the file types. The map keys
-     * are file type names and the map values
-     * are integers with the number of resources matching
-     * the file type.
-     */
-    public Map<Counter, int[]> getCounterMap() {
-        return counterMap;
+    public void incCounter(Counter key, int value) {
+        final int[] num = counterMap.get(key);
+
+        if (num == null) {
+            counterMap.put(key, new int[] { value });
+        } else {
+            num[0] += value;

Review Comment:
   I had not thought about atomic properties, but I did think the array 
solution is no longer required.  I think I have a solution using a concurrent 
map and a IncrementableInt class.  I will put that together shortly.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@creadur.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to