-
Notifications
You must be signed in to change notification settings - Fork 0
Sprint 6: unlimited history + tests #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
* src/manager/InMemoryHistoryManager.java
+ Реализован двусвязный список + HashMap<id,Node>
+ add(task) теперь удаляет дубликаты через removeNode за O(1)
+ remove(id) — новый метод HistoryManager
* src/manager/TaskManager.java
+ в интерфейс добавлен void remove(int id)
* src/manager/InMemoryTaskManager.java
+ вызовы historyManager.remove(...) в removeTask / removeEpic / removeSubtask
* src/manager/HistoryManager.java
+ объявлен метод remove(int id)
* tests
+ HistoryManagerTest — проверяет отсутствие дублей и порядок
+ InMemoryTaskManagerTest — проверка очистки истории при удалении,
истории > 10, дубль-просмотров
+ TaskManagerHistoryIntegrationTest — интеграция: удаление эпика убирает
эпик и все Subtask'и из истории
Issue: sprint-6 / ТЗ «неограниченная история без дублей»
LexLippi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Привет!
Хорошая работа!
Есть несколько мелких замечаний, которые необходимо исправить!
Желаю удачи!
| Node oldTail = tail; | ||
| Node n = new Node(oldTail, task, null); | ||
| tail = n; | ||
| if (oldTail == null) head = n; else oldTail.next = n; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Лучше в соответветствии с Google Java Code Style всегда использовать фигурные скобки, даже когда они опциональны:
https://google.github.io/styleguide/javaguide.html#s4.1.1-braces-always-used
| /* ───── вспомогательные ───── */ | ||
| private void linkLast(Task task) { | ||
| Node oldTail = tail; | ||
| Node n = new Node(oldTail, task, null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Лучше не использовать однобуквенные названия переменных, хотя в таком простом коде это можно оставить
| tail = n; | ||
| if (oldTail == null) head = n; else oldTail.next = n; | ||
| } | ||
| private void removeNode(Node n) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Замечания аналогичные предыдущему методу
| } | ||
| private List<Task> getTasks() { | ||
| List<Task> list = new ArrayList<>(); | ||
| for (Node n = head; n != null; n = n.next) list.add(n.data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Аналогично про фигурные скобки
LexLippi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Привет!
Отличная работа!
Желаю удачи в следующих спринтах!
src/manager/InMemoryHistoryManager.java
src/manager/TaskManager.java
src/manager/InMemoryTaskManager.java
src/manager/HistoryManager.java
tests
Issue: sprint-6 / ТЗ «неограниченная история без дублей»