Skip to content

Conversation

@pvktk
Copy link
Owner

@pvktk pvktk commented Sep 17, 2018

No description provided.

@pvktk pvktk changed the title Hw git 1 Java06. ДЗ 01, Егоров Антон Sep 17, 2018
}
public void setAllFiles(Map<String, ArrayList<Integer>> allFiles) {
this.allFiles = allFiles;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

зачем тут геттеры-сеттеры, если они не используются) надеюсь, в следующих частях класс приведен в порядок

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Это чтобы сериализовывалось.

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 {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

кишки торчать наружу не должны, тестам следует смотреть на файлы на диске, т.к. это то, с чем работает пользователь

}
}

void increaseRevisionNumber() {

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) {

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);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

лог должен выводить список ревизий с указанной

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants