Skip to content

Task 3#18

Open
South12309 wants to merge 3 commits intoFAANG-School:masterfrom
South12309:task_3
Open

Task 3#18
South12309 wants to merge 3 commits intoFAANG-School:masterfrom
South12309:task_3

Conversation

@South12309
Copy link
Copy Markdown

task 3 is done

@@ -0,0 +1,7 @@
package task_3;

public class EmptyCoursesException extends Exception{
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

RuntimeException

}

public void setGradeValue(int gradeValue) {
if (gradeValue<=0 || gradeValue>5) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Вынести числа в константы


public void setGradeValue(int gradeValue) {
if (gradeValue<=0 || gradeValue>5) {
throw new IllegalArgumentException("Оценка должна быть от 1 до 5");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

А какая по факту?

import java.util.Map;

public class SimpsonsSchool {
// private List<SimpsonsGrade> simpsonsGradeList = new ArrayList<>();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Удалить

try {
school.getCharacterTranscript(school.characterList.get(1));
} catch (EmptyCoursesException e) {
throw new RuntimeException(e);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Залогировать, как минимум

System.out.println(e.getMessage());
e.printStackTrace();
}
//simpsonsGradeList.add(new SimpsonsGrade(course, character, gradeValue));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Удалить

character.getGrades().add(new SimpsonsGrade(course, character, gradeValue));
} catch (IllegalArgumentException e) {
System.out.println(e.getMessage());
e.printStackTrace();
Copy link
Copy Markdown
Contributor

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.

2 participants