-
Notifications
You must be signed in to change notification settings - Fork 0
Java06. ДЗ 01, Егоров Антон #6
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: master
Are you sure you want to change the base?
Conversation
| } | ||
| public void setAllFiles(Map<String, ArrayList<Integer>> allFiles) { | ||
| this.allFiles = allFiles; | ||
| } |
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.
зачем тут геттеры-сеттеры, если они не используются) надеюсь, в следующих частях класс приведен в порядок
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.
Это чтобы сериализовывалось.
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 final String infoFileName = ".myGitData"; | ||
| private final String storageFolder = ".mygitdata"; | ||
|
|
||
| void findRepInformation() throws JsonParseException, JsonMappingException, IOException, UnversionedException { |
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.
кишки торчать наружу не должны, тестам следует смотреть на файлы на диске, т.к. это то, с чем работает пользователь
| } | ||
| } | ||
|
|
||
| void increaseRevisionNumber() { |
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, можно заинлайнить, т.к. всего одно использование и метод однострочный
| //System.out.println("trying write file to " + storage); | ||
| Files.copy(Paths.get("").resolve(filename), getStoragePath(filename, revision)); | ||
| ArrayList<Integer> revisions = inform.allFiles.get(getPathRealRelative(filename).toString()); | ||
| if (revisions == 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.
см computeIfAbsent (идея подсвечивает, эклипс молчит?)
| } | ||
| return "revision: " + revision + "\n" | ||
| + inform.commitMessages.get(revision - 1) + "\n" | ||
| + inform.timestamps.get(revision - 1); |
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.
лог должен выводить список ревизий с указанной
No description provided.