diff --git a/TDD-pure-function/src/main/java/de/edu/hsfulda/ciip/tdd/BownlingCalculator.java b/TDD-pure-function/src/main/java/de/edu/hsfulda/ciip/tdd/BownlingCalculator.java index 3166e56..8908da4 100644 --- a/TDD-pure-function/src/main/java/de/edu/hsfulda/ciip/tdd/BownlingCalculator.java +++ b/TDD-pure-function/src/main/java/de/edu/hsfulda/ciip/tdd/BownlingCalculator.java @@ -6,10 +6,10 @@ import java.util.regex.Pattern; public class BownlingCalculator { public int evaluate(String listOfThrows) { - Matcher matcher = Pattern.compile("\\d").matcher(listOfThrows); int sum =0; - while (matcher.find()) { - sum+=Integer.parseInt(matcher.group()); + Matcher singleDigit = Pattern.compile("\\d").matcher(listOfThrows); + while (singleDigit.find()) { + sum+=Integer.parseInt(singleDigit.group()); } return sum; }