Skip to content

Commit 7a097c6

Browse files
committed
Fixed sonar issues for day 2
1 parent 76b309b commit 7a097c6

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ To run all solutions, simply run `./gradlew run`. If you want to run the solutio
2020
| Day | Part 1 | Part 2 |
2121
|---------|---------|---------|
2222
| 1 |||
23-
| 2 | | |
23+
| 2 | | |
2424
| 3 |||
2525
| 4 |||
2626
| 5 |||
@@ -44,6 +44,6 @@ To run all solutions, simply run `./gradlew run`. If you want to run the solutio
4444
| 23 |||
4545
| 24 |||
4646
| 25 |||
47-
| **SUM** | **1** | **1** |
47+
| **SUM** | **2** | **2** |
4848

49-
Total: 2
49+
Total: 4

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plugins {
44

55
// project meta data
66
group 'de.havox_design.aoc2015'
7-
version '0.1.4'
7+
version '0.1.5'
88

99
// Switch to gradle "all" distribution.
1010
wrapper {

day02/src/main/java/de/havox_design/aoc2015/day02/Dimensions.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,14 @@ public static Dimensions getForDataRow(String dataRow) {
5050
throw new IllegalArgumentException("Expected data row to have format of LxWxH with L=length, W=width, H=height.");
5151
}
5252

53-
int length, width, height;
5453
try {
55-
length = Integer.parseInt(elements[0]);
56-
width = Integer.parseInt(elements[1]);
57-
height = Integer.parseInt(elements[2]);
54+
int length = Integer.parseInt(elements[0]);
55+
int width = Integer.parseInt(elements[1]);
56+
int height = Integer.parseInt(elements[2]);
57+
58+
return new Dimensions(length, width, height);
5859
} catch (NumberFormatException e) {
5960
throw new IllegalArgumentException("Expected data row to have format of LxWxH with L=length, W=width, H=height with integer values.", e);
6061
}
61-
62-
return new Dimensions(length, width, height);
6362
}
6463
}

0 commit comments

Comments
 (0)