Skip to content

Commit 05889e0

Browse files
committed
Added authors and update CONTRIBUTING.MD
1 parent 0767646 commit 05889e0

File tree

32 files changed

+210
-63
lines changed

32 files changed

+210
-63
lines changed

0-0-intro/src/main/java/com/bobocode/intro/Introduction.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
* <p>
1414
* Throughout the course you will need to implement hundreds of methods. And this is a simple example of how it's all
1515
* organized. You read the Java Doc, implement a method and run the test.
16+
*
17+
* @author Taras Boychuk
1618
*/
1719
public class Introduction {
1820
/**

0-0-intro/src/test/java/com/bobocode/intro/IntroductionTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
* PLEASE NOTE:
1919
* - annotation @{@link Order} is used to help you to understand which method should be implemented first.
2020
* - annotation @{@link DisplayName} is used to provide you more detailed instructions.
21+
*
22+
* @author Taras Boychuk
2123
*/
2224
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
2325
class IntroductionTest {

1-0-java-basics/1-3-1-crazy-generics/src/main/java/com/bobocode/basics/CrazyGenerics.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
* Hint: in some cases you will need to refactor the code, like replace {@link Object} with a generic type. In order
2020
* cases you will need to add new fields, create new classes, or add new methods. Always try to read java doc and update
2121
* the code according to it.
22+
*
23+
* @author Taras Boychuk
2224
*/
2325
public class CrazyGenerics {
2426
/**

1-0-java-basics/1-3-1-crazy-generics/src/test/java/com/bobocode/basics/CrazyGenericsTest.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,11 @@
2626
import static org.mockito.Mockito.when;
2727

2828
/**
29-
* This test class uses Reflection API only for learning purposes. It should NOT be used as an example of how to write
30-
* production tests.
29+
* A reflection-based test class for {@link CrazyGenerics}.
30+
* <p>
31+
* PLEASE NOTE: we use Reflection API only for learning purposes. It should NOT be used for production tests.
32+
*
33+
* @author Taras Boychuk
3134
*/
3235
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
3336
public class CrazyGenericsTest {

1-0-java-basics/1-5-0-hello-annotations/src/main/java/com/bobocode/basics/HelloAnnotationsExercise.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
* todo: Create an annotation @{@link Exercise}.
99
* todo: Add String value that will store exercise name
1010
* todo: Add complexityLevel with a default {@link Level} basic
11+
*
12+
* @author Taras Boychuk
1113
*/
1214
public class HelloAnnotationsExercise { // todo: mark class with the annotation according to the javadoc
1315
}

2-0-data-structures-and-algorithms/2-2-1-node/src/main/java/com/bobobode/cs/Node.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* objects and build more comprehensive data structures on top of those liked nodes.
77
*
88
* @param <T> a generic type T
9+
* @author Taras Boychuk
910
*/
1011
public class Node<T> {
1112
// todo:

2-0-data-structures-and-algorithms/2-2-1-node/src/main/java/com/bobobode/cs/Nodes.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
/**
66
* A class that consists of static methods only and provides util methods for {@link Node}.
7+
*
8+
* @author Taras Boychuk
79
*/
810
public class Nodes {
911
private Nodes() {

2-0-data-structures-and-algorithms/2-2-2-stack/src/main/java/com/bobocode/cs/LinkedStack.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
* A node is implemented as inner static class {@link Node<T>}.
99
*
1010
* @param <T> generic type parameter
11+
* @author Taras Boychuk
12+
* @author Serhii Hryhus
1113
*/
1214
public class LinkedStack<T> implements Stack<T> {
1315

2-0-data-structures-and-algorithms/2-2-2-stack/src/main/java/com/bobocode/cs/Stack.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
* custom linked nodes)
77
*
88
* @param <T> type parameter
9+
* @author Taras Boychuk
10+
* @author Serhii Hryhus
911
*/
1012
public interface Stack<T> {
1113

2-0-data-structures-and-algorithms/2-2-2-stack/src/test/java/com/bobocode/cs/StackTest.java renamed to 2-0-data-structures-and-algorithms/2-2-2-stack/src/test/java/com/bobocode/cs/LinkedStackTest.java

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,33 @@
1313
import static org.assertj.core.api.Assertions.assertThatNullPointerException;
1414
import static org.junit.jupiter.api.Assertions.assertThrows;
1515

16+
/**
17+
* A reflection-based test class for {@link LinkedStack}.
18+
* <p>
19+
* PLEASE NOTE: we use Reflection API only for learning purposes. It should NOT be used for production tests.
20+
*
21+
* @author Ivan Virchenko
22+
* @author Taras Boychuk
23+
*/
1624
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
17-
class StackTest {
18-
25+
class LinkedStackTest {
1926
private static final String PROPER_CLASSNAME = "Node";
2027

21-
private static final Predicate<Field> NODE_FIELD_PREDICATE = field -> field.getType().getSimpleName().equals(PROPER_CLASSNAME)
22-
&& field.getName().toLowerCase().contains("head") || field.getName().toLowerCase().contains("first");
23-
private static final Predicate<Field> SIZE_FIELD_PREDICATE = field -> field.getName().toLowerCase().contains("size");
24-
private static final Predicate<Field> NODE_ELEMENT_FIELD = field -> field.getName().toLowerCase().contains("element")
28+
private static final Predicate<Field> NODE_FIELD_PREDICATE = field ->
29+
field.getType().getSimpleName().equals(PROPER_CLASSNAME)
30+
&& field.getName().toLowerCase().contains("head")
31+
|| field.getName().toLowerCase().contains("first");
32+
33+
private static final Predicate<Field> SIZE_FIELD_PREDICATE = field ->
34+
field.getName().toLowerCase().contains("size");
35+
36+
private static final Predicate<Field> NODE_ELEMENT_FIELD_PREDICATE = field ->
37+
field.getName().toLowerCase().contains("element")
2538
|| field.getName().toLowerCase().contains("value")
2639
|| field.getName().toLowerCase().contains("item");
27-
private static final Predicate<Field> NODE_NEXT_FIELD = field -> field.getType().getSimpleName().equals(PROPER_CLASSNAME)
40+
41+
private static final Predicate<Field> NODE_NEXT_FIELD_PREDICATE = field ->
42+
field.getType().getSimpleName().equals(PROPER_CLASSNAME)
2843
&& field.getName().toLowerCase().contains("next");
2944

3045
private Stack<Integer> intStack = new LinkedStack<>();
@@ -77,7 +92,7 @@ void checkProperElementField() {
7792
var fields = getInnerClass().getDeclaredFields();
7893

7994
var elementField = Arrays.stream(fields)
80-
.filter(NODE_ELEMENT_FIELD)
95+
.filter(NODE_ELEMENT_FIELD_PREDICATE)
8196
.findAny()
8297
.orElseThrow();
8398
var nodeTypeParameter = getInnerClass().getTypeParameters()[0];
@@ -93,7 +108,7 @@ void checkProperNextField() {
93108
Field[] fields = getInnerClass().getDeclaredFields();
94109

95110
boolean hasNext = Arrays.stream(fields)
96-
.anyMatch(NODE_NEXT_FIELD);
111+
.anyMatch(NODE_NEXT_FIELD_PREDICATE);
97112

98113
assertThat(hasNext).isTrue();
99114
}
@@ -294,7 +309,7 @@ private Field getHeadField() {
294309

295310
private Field getNodeElementField(Object node) {
296311
Field fieldElement = Arrays.stream(node.getClass().getDeclaredFields())
297-
.filter(NODE_ELEMENT_FIELD)
312+
.filter(NODE_ELEMENT_FIELD_PREDICATE)
298313
.findAny()
299314
.orElseThrow();
300315
fieldElement.setAccessible(true);
@@ -303,7 +318,7 @@ private Field getNodeElementField(Object node) {
303318

304319
private Field getNodeNextField(Object node) {
305320
Field field = Arrays.stream(node.getClass().getDeclaredFields())
306-
.filter(NODE_NEXT_FIELD)
321+
.filter(NODE_NEXT_FIELD_PREDICATE)
307322
.findAny()
308323
.orElseThrow();
309324
field.setAccessible(true);

0 commit comments

Comments
 (0)