Conversation
…Ivanov # Conflicts: # src/main/java/Main.java
…eature/konstantinIvanov
# Conflicts: # README.md # src/main/java/homework_1/Main.java
| import java.util.LinkedList; | ||
| import java.util.List; | ||
|
|
||
| public final class ImmutableClass { |
There was a problem hiding this comment.
Your class is not immutable. I can pass List and then change it, because when you get/set mutable field, you don't make deep copy, you pass the same object (in constructor and in getNew)
| import static org.junit.jupiter.api.Assertions.assertEquals; | ||
| import static org.junit.jupiter.api.Assertions.assertThrows; | ||
|
|
||
| public class RandomCharsTableTest extends UnitBase { |
There was a problem hiding this comment.
Most of your tests are failing. Please check
|
|
||
| import static java.nio.charset.StandardCharsets.UTF_8; | ||
|
|
||
| public class CustomFileReader { |
| public class Main { | ||
|
|
||
| public static void main(String[] args) { | ||
| new CustomRegexMatcher().run(); |
There was a problem hiding this comment.
Opt: you could add some greetings message with input example
| int result = power.rec(fir, sec); | ||
| System.out.println(result); | ||
| } catch (Exception e) { | ||
| System.out.println("Only 2 non-negative integers are allowed"); |
There was a problem hiding this comment.
| System.out.println("Only 2 non-negative integers are allowed"); | |
| System.out.println(e.getCause()); |
Opt
There was a problem hiding this comment.
Because you write this message twice in code
| if (secondNumber > 0 ) { | ||
| return firstNumber * rec(firstNumber, secondNumber-1); | ||
| } | ||
| return rec(firstNumber, secondNumber) * secondNumber; |
There was a problem hiding this comment.
What is the case when this line will be used? You don't test it
src/main/java/homework_6/Main.java
Outdated
| Map<MapProblemsMutableGenerator, String> map = new HashMap<>(); | ||
| MapProblemsMutableGenerator m1 = new MapProblemsMutableGenerator(1, "name"); | ||
| MapProblemsMutableGenerator same = new MapProblemsMutableGenerator(1, "name"); | ||
| MapProblemsMutableGenerator m2 = new MapProblemsMutableGenerator(2, "name2"); | ||
| MapProblemsMutableGenerator m3 = new MapProblemsMutableGenerator(3, "name3"); | ||
| MapProblemsMutableGenerator m4 = new MapProblemsMutableGenerator(4, "name4"); | ||
| map.put(m1, "1"); | ||
| map.put(m2, "2"); | ||
| map.put(m3, "3"); | ||
| map.put(m4, "4"); | ||
| System.out.println(m1.equals(same)); | ||
| System.out.println("Trying to get any value by key"); | ||
| map.get(m1); | ||
| map.get(m2); | ||
| map.get(m3); | ||
| map.get(m4); |
There was a problem hiding this comment.
You just override key/value pair, there's no mutable key problem.
There was a problem hiding this comment.
Also, in upper example, collision does appear, but it is not seen in console (opt)
| package homework_7; | ||
|
|
||
| public class Main { | ||
| public static void main(String[] args) { |
There was a problem hiding this comment.
Code conventions are generally not followed, and Functional interface is created with mistakes (you declare generics, but don't use them)
|
|
||
| import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
|
||
| public class CustomAnnotationTest extends UnitBase { |
There was a problem hiding this comment.
You can test it all in one test case (opt)
src/main/java/homework_3/Flower.java
Outdated
| make class final | ||
| A parameterized constructor should initialize all the fields performing a deep copy | ||
| Deep Copy of objects should be performed in the getter methods | ||
| */public final class Flower { |
There was a problem hiding this comment.
Doesn't fit the requirement from Homework char
|
|
||
| import java.util.Objects; | ||
|
|
||
| public class MapProblemsMutableGenerator { |
There was a problem hiding this comment.
Where's mutable key problem?

No description provided.