ottlinger commented on code in PR #685:
URL: https://github.com/apache/creadur-rat/pull/685#discussion_r3490857417


##########
apache-rat-core/src/main/java/org/apache/rat/config/results/ClaimValidator.java:
##########
@@ -71,10 +72,14 @@ public boolean hasErrors() {
      * @param value the value to set. A negative value specifies no maximum 
value.
      */
     public void setMax(final ClaimStatistic.Counter counter, final int value) {
-        MutableInt maxValue = max.compute(counter, (k, v) -> {
+        if (counter == null) {
+            DefaultLog.getInstance().warn("`null` passed as argument to 
setMax() -- ignoring");
+            return;
+        }
+        MutableInt maxValue = max.computeIfPresent(counter, (k, v) -> {
             v.setValue(value < 0 ? Integer.MAX_VALUE : value);
             return v; });
-        min.compute(counter, (k, v) ->  {
+        min.computeIfPresent(counter, (k, v) ->  {
             if (v.intValue() > maxValue.intValue()) {

Review Comment:
   @Claudenw the IDE marks this line as possible NPE for maxValue.intValue due 
to the computerIfPresent before.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to