Skip to content

Commit f64ffc6

Browse files
author
mikr
committed
Merge branch 'master' of https://github.com/Maiklins/tutorials into JAVA-7244-Review_log_statements_for_projects
� Conflicts: � algorithms-searching/src/test/java/com/baeldung/algorithms/quadtree/QuadTreeSearchUnitTest.java
2 parents d7e298b + f6820ce commit f64ffc6

768 files changed

Lines changed: 41777 additions & 20368 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

algorithms-genetic/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,4 @@
5050
<commons-codec.version>1.11</commons-codec.version>
5151
</properties>
5252

53-
</project>
53+
</project>

algorithms-miscellaneous-5/pom.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<dependency>
3838
<groupId>org.junit.platform</groupId>
3939
<artifactId>junit-platform-commons</artifactId>
40-
<version>${junit.platform.version}</version>
40+
<version>${junit-platform.version}</version>
4141
</dependency>
4242
<dependency>
4343
<groupId>org.assertj</groupId>
@@ -53,7 +53,6 @@
5353
<commons-codec.version>1.11</commons-codec.version>
5454
<commons-math3.version>3.6.1</commons-math3.version>
5555
<guava.version>28.1-jre</guava.version>
56-
<junit.platform.version>1.6.0</junit.platform.version>
5756
</properties>
5857

5958
</project>

algorithms-miscellaneous-5/src/test/java/com/baeldung/algorithms/prim/PrimUnitTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package com.baeldung.algorithms.prim;
22

3+
import org.junit.Test;
4+
35
import java.util.ArrayList;
46
import java.util.List;
57

6-
import org.junit.Test;
7-
88
public class PrimUnitTest {
99

1010
@Test

algorithms-miscellaneous-6/pom.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<dependency>
2323
<groupId>org.junit.platform</groupId>
2424
<artifactId>junit-platform-commons</artifactId>
25-
<version>${junit.platform.version}</version>
25+
<version>${junit-platform.version}</version>
2626
</dependency>
2727
<dependency>
2828
<groupId>org.assertj</groupId>
@@ -46,7 +46,6 @@
4646
<properties>
4747
<guava.version>28.1-jre</guava.version>
4848
<org.assertj.core.version>3.9.0</org.assertj.core.version>
49-
<junit.platform.version>1.6.0</junit.platform.version>
5049
<commons-math3.version>3.6.1</commons-math3.version>
5150
</properties>
5251

algorithms-searching/src/main/java/com/baeldung/algorithms/dfs/Graph.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,13 @@ public void dfsWithoutRecursion(int start) {
2929
stack.push(start);
3030
while (!stack.isEmpty()) {
3131
int current = stack.pop();
32-
isVisited[current] = true;
33-
visit(current);
34-
for (int dest : adjVertices.get(current)) {
35-
if (!isVisited[dest])
36-
stack.push(dest);
32+
if(!isVisited[current]){
33+
isVisited[current] = true;
34+
visit(current);
35+
for (int dest : adjVertices.get(current)) {
36+
if (!isVisited[dest])
37+
stack.push(dest);
38+
}
3739
}
3840
}
3941
}

algorithms-searching/src/main/java/com/baeldung/algorithms/suffixtree/SuffixTree.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
import org.slf4j.LoggerFactory;
99

1010
public class SuffixTree {
11+
1112
private static final Logger LOGGER = LoggerFactory.getLogger(SuffixTree.class);
13+
1214
private static final String WORD_TERMINATION = "$";
1315
private static final int POSITION_UNDEFINED = -1;
1416
private Node root;

algorithms-searching/src/test/java/com/baeldung/algorithms/dfs/GraphUnitTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import java.util.List;
44

5-
import com.baeldung.algorithms.dfs.Graph;
65
import org.junit.Test;
76

87
public class GraphUnitTest {

algorithms-searching/src/test/java/com/baeldung/algorithms/quadtree/QuadTreeSearchUnitTest.java

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import org.slf4j.LoggerFactory;
1111

1212
public class QuadTreeSearchUnitTest {
13-
13+
1414
private static final Logger LOGGER = LoggerFactory.getLogger(QuadTreeSearchUnitTest.class);
1515

1616
private static QuadTree quadTree;
@@ -20,7 +20,7 @@ public static void setUp() {
2020
Region area = new Region(0, 0, 400, 400);
2121
quadTree = new QuadTree(area);
2222

23-
float[][] points = new float[][] { { 21, 25 }, { 55, 53 }, { 70, 318 }, { 98, 302 },
23+
float[][] points = new float[][] { { 21, 25 }, { 55, 53 }, { 70, 318 }, { 98, 302 },
2424
{ 49, 229 }, { 135, 229 }, { 224, 292 }, { 206, 321 }, { 197, 258 }, { 245, 238 } };
2525

2626
for (int i = 0; i < points.length; i++) {
@@ -35,26 +35,28 @@ public static void setUp() {
3535
public void givenQuadTree_whenSearchingForRange_thenReturn1MatchingItem() {
3636
Region searchArea = new Region(200, 200, 250, 250);
3737
List<Point> result = quadTree.search(searchArea, null, "");
38+
3839
LOGGER.debug(result.toString());
3940
LOGGER.debug(quadTree.printSearchTraversePath());
40-
41+
4142
Assert.assertEquals(1, result.size());
42-
Assert.assertArrayEquals(new float[] { 245, 238 },
43+
Assert.assertArrayEquals(new float[] { 245, 238 },
4344
new float[]{result.get(0).getX(), result.get(0).getY() }, 0);
4445
}
45-
46+
4647
@Test
4748
public void givenQuadTree_whenSearchingForRange_thenReturn2MatchingItems() {
4849
Region searchArea = new Region(0, 0, 100, 100);
4950
List<Point> result = quadTree.search(searchArea, null, "");
51+
5052
LOGGER.debug(result.toString());
5153
LOGGER.debug(quadTree.printSearchTraversePath());
52-
54+
5355
Assert.assertEquals(2, result.size());
54-
Assert.assertArrayEquals(new float[] { 21, 25 },
56+
Assert.assertArrayEquals(new float[] { 21, 25 },
5557
new float[]{result.get(0).getX(), result.get(0).getY() }, 0);
56-
Assert.assertArrayEquals(new float[] { 55, 53 },
58+
Assert.assertArrayEquals(new float[] { 55, 53 },
5759
new float[]{result.get(1).getX(), result.get(1).getY() }, 0);
58-
60+
5961
}
6062
}

algorithms-sorting-2/pom.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<dependency>
3333
<groupId>org.junit.jupiter</groupId>
3434
<artifactId>junit-jupiter-api</artifactId>
35-
<version>${junit-jupiter-api.version}</version>
35+
<version>${junit-jupiter.version}</version>
3636
<scope>test</scope>
3737
</dependency>
3838
<dependency>
@@ -47,7 +47,6 @@
4747
<commons-math3.version>3.6.1</commons-math3.version>
4848
<org.assertj.core.version>3.9.0</org.assertj.core.version>
4949
<commons-codec.version>1.11</commons-codec.version>
50-
<junit-jupiter-api.version>5.3.1</junit-jupiter-api.version>
5150
</properties>
5251

5352
</project>

algorithms-sorting/pom.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
<dependency>
3434
<groupId>org.junit.jupiter</groupId>
3535
<artifactId>junit-jupiter-api</artifactId>
36-
<version>${junit-jupiter-api.version}</version>
36+
<version>${junit-jupiter.version}</version>
3737
<scope>test</scope>
3838
</dependency>
3939
<dependency>
@@ -48,7 +48,6 @@
4848
<commons-math3.version>3.6.1</commons-math3.version>
4949
<org.assertj.core.version>3.9.0</org.assertj.core.version>
5050
<commons-codec.version>1.11</commons-codec.version>
51-
<junit-jupiter-api.version>5.3.1</junit-jupiter-api.version>
5251
</properties>
5352

5453
</project>

0 commit comments

Comments
 (0)